我正在尝试创建一个 View ,并将问题归结为无法创建引用不同架构中的表的 View 。
例如,我可以这样做:
select count(*) from otherschema.othertable;
我能做到:
create view foo as select count(*) as bar from oneofmytables;
但是如果我尝试:
create view foo as select count(*) as bar from otherschema.othertable;
我收到“权限不足”错误。我还需要什么额外权限?
最佳答案
您是否直接授予其他用户的表?或者是通过角色?您需要直接授予权限才能创建引用其他表的对象( View 、过程等)。作为快速测试,在 SQL*Plus 中
SQL> set role none;
SQL> select count(*) from otherschema.othertable;
如果失败,则问题在于您已通过角色被授予对该表的权限。
关于Oracle:跨模式创建 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4855412/