gpt4 book ai didi

oracle - Oracle 的备用模式中的外键?

转载 作者:行者123 更新时间:2023-12-04 00:15:15 25 4
gpt4 key购买 nike

我有两个模式,我们称它们为 BOB 和 FRED。我需要从架构 BOB 调用架构 FRED 中的表,以将该表中的主键用作外键。我已经为架构 FRED 设置了适当的授权以允许 BOB 访问它,但是每当我运行脚本时,它都会提示我没有正确的权限。我需要在某处更改其他设置吗?这甚至可以做到吗?

我的FK创作如下:

ALTER TABLE "BOB"."ITEMGROUP" WITH CHECK ADD CONSTRAINT FK_ITEMS_ITEM FOREIGN KEY (ItemID)
REFERENCES "FRED"."ITEMS"(ItemID)

我正在做赠款:
GRANT ALTER ON "FRED"."ITEMS" TO "BOB"

我收到此错误消息:
SQL Error: ORA-01031: insufficient privileges 
01031. 00000 - "insufficient privileges"

*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.

*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label.

最佳答案

你需要:

grant references on "FRED"."ITEMS" TO "BOB"

this “问汤姆”

关于oracle - Oracle 的备用模式中的外键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12199349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com