Nit*_*ish 11 oracle privileges
当我从模式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.
Run Code Online (Sandbox Code Playgroud)
创建对象和权限
在不授予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.
Run Code Online (Sandbox Code Playgroud)
以TEST_USER身份连接并尝试查询表
这表明在表上拥有一些权限会更改错误消息.
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>
Run Code Online (Sandbox Code Playgroud)
ORA-01031: insufficient privileges当对象存在于架构中但无权访问该对象时,就会发生这种情况。
ORA-00942: table or view does not exist当当前模式中不存在该对象时发生。如果该对象存在于另一个模式中,则需要使用 .. 来访问它。如果所有者未授予对调用模式的访问权限,您仍然可能会收到权限不足的错误。
| 归档时间: |
|
| 查看次数: |
101798 次 |
| 最近记录: |