2017-06-13 87 views
-1

如何向角色授予读取和创建视图特权?Oracle:如何授予对角色的读取和创建视图特权?

这里是我做的步骤:

  1. GRANT语句的作用 “CUSTOM_ROLE”:

    GRANT SELECT ON MY_VIEW_1到CUSTOM_ROLE;

  2. 将该角色分配给用户ID:

    GRANT CUSTOM_ROLE TO USERID_123;

错误:

01924. 00000 - "role '%s' not granted or does not exist" 

*Cause: Either the role was not granted to the user, or the role did not exist. 

*Action: Create the role or grant the role to the user and retry 
      the operation. 

敬请帮助。谢谢。

回答

1

在授予之前创建角色。该消息说该角色不存在。

我会建议你使用检查角色的存在:

select role from dba_roles where role = 'CUSTOM_ROLE'; 

如果该查询将不返回任何行,然后使用

CREATE ROLE custom_role; 

创建它。

看到这个:

https://www.techonthenet.com/oracle/roles.php

详情