ORA-01952:未授予“ROJIB”的系统权限

时间:2015-09-01 10:36:44

标签: sql database oracle

为什么我得到ORA-01952:系统权限未授予'ROJIB'?

创建角色:

SQL> create role security;

Role created.

然后为角色'security'创建授权:

SQL> grant create table,create view to security;

Grant succeeded.

为用户授予:

SQL> grant security to rojib;

Grant succeeded.

在撤销后,我收到错误:

SQL> revoke create table from rojib;
revoke create table from rojib
*
ERROR at line 1:
ORA-01952: system privileges not granted to 'ROJIB'

1 个答案:

答案 0 :(得分:3)

  

为什么我会获得ORA-01952:系统特权未被授予' ROJIB' ?

这是因为您授予了对 ROLE SECURITY的权限,因此您需要 REVOKE 来自 ROLE <的权限< / strong> SECURITY,而非 USER

例如,

创建一个USER:

SQL> CREATE USER TEST IDENTIFIED BY TEST;

User created.

创建一个角色:

SQL> CREATE ROLE SECURITY;

Role created.

授予ROLE权限:

SQL> GRANT CREATE TABLE,CREATE VIEW TO SECURITY;

Grant succeeded.

向用户授予ROLE:

SQL> GRANT SECURITY TO TEST;

Grant succeeded.

撤销ROLE的权限:

SQL> REVOKE CREATE TABLE FROM SECURITY;

Revoke succeeded.

从用户撤消ROLE:

SQL> REVOKE SECURITY FROM TEST;

Revoke succeeded.