Oracle:跨模式创建 View ?

标签 oracle view schema

我正在尝试创建一个 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/

相关文章:

xml - Delphi 不会解析外部 DTD 文件

database - 我应该为版本、代码库、可部署文件使用什么数据库表结构?

java - "Literal does not match the format string"错误

python - 如何在过滤器中使用 "or"

oracle - 在 Oracle 中从 varchar 查找下一个 id

android - Linearlayout 中的背景图像

drupal - 如何在不带面板的 View Drupal 7 中获取组 ID 作为上下文

oracle - 为什么我的新用户可以在oracle中以sysdba登录?

sql - 可能的递归或分析查询。这可以通过 SQL 完成还是需要脚本?

sql - 如何从 Oracle SQL 语句中读取数据并将其传递给其他 shell 脚本?