【发布时间】:2012-02-27 06:39:52
【问题描述】:
当涉及到多模式设置时,我无法理解 Oracle 中哪些是可能的,哪些是不可能的。假设我有两个模式 A 和 B:
-- with user SYS connect as SYSDBA
-- note: ALL PRIVILEGES are granted for simplicity in the scope of this question.
-- real life databases would have more fine-grained grants...
create user A identified by A;
grant all privileges to A;
create user B identified by B;
grant all privileges to B;
-- with user A
create table A.REFERENCED_TABLE (
ID number(7) not null,
constraint REFERENCED_TABLE_PK primary key (ID)
);
-- with user A or B
create table B.REFERENCING_TABLE (
A_ID number(7) not null,
constraint REFERENCING_TABLE_FK
foreign key (A_ID)
references A.REFERENCED_TABLE(ID)
on delete cascade
);
但上述说法导致
ORA-01031: insufficient privileges
如何使一个架构中的表引用另一个架构中的表?是否还有一些GRANT 失踪?这甚至可能吗?
【问题讨论】:
标签: sql oracle foreign-keys schema grant