当我从模式 A 查询模式 C 中的表时,我得到ORA-01031: 权限不足当我从模式 B 查询同一个表时,我得到ORA-00942: 表或视图不存在。在表上,两个模式都没有任何权限。为什么在这种情况下我会收到不同的错误消息?
你可能会得到ORA-01031: insufficient privileges
代替ORA-00942: table or view does not exist
当您在桌子上至少拥有一项特权,但没有必要的特权时。
创建模式
SQL> create user schemaA identified by schemaA;
User created.
SQL> create user schemaB identified by schemaB;
User created.
SQL> create user test_user identified by test_user;
User created.
SQL> grant connect to test_user;
Grant succeeded.
创建对象和权限
在不授予 SELECT 的情况下授予模式像 DELETE 这样的权限是不常见的,但也是可能的。
SQL> create table schemaA.table1(a number);
Table created.
SQL> create table schemaB.table2(a number);
Table created.
SQL> grant delete on schemaB.table2 to test_user;
Grant succeeded.
以 TEST_USER 身份连接并尝试查询表
这表明有some表上的特权会更改错误消息。
SQL> select * from schemaA.table1;
select * from schemaA.table1
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from schemaB.table2;
select * from schemaB.table2
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)