Grant select_catalog_role role 没有立即生效

今天Grant select_catalog_role 给一个普通用户, 但是并不能查询动态性能视图。翻开官方文档才知道还需要Enable ROLE。

Grant 所有的系统权限会立即生效

Grant 角色 却不能立即生效, 需要SET ROLE 之后才能访问那些字典表和性能视图表。

When Grants and Revokes Take Effect

Depending on the privilege that is granted or revoked, a grant or revoke takes effect at different times.

The grants and revokes take effect as follows:

  • All grants and revokes of system and object privileges to anything (users, roles, and PUBLIC) take immediate effect.

  • All grants and revokes of roles to anything (users, other roles, PUBLIC) take effect only when a current user session issues a SET ROLE statement to reenable the role after the grant and revoke, or when a new user session is created after the grant or revoke.

You can see which roles are currently enabled by examining the SESSION_ROLES data dictionary view.

https://docs.oracle.com/database/121/DBSEG/authorization.htm#DBSEG99973

 

grant select any dictionary to test;  ---立即生效

grant select_catalog_role to test;  ---需要SETROLE

set role SELECT_CATALOG_ROLE;


select * from dba_role_privs where GRANTEE='TEST';

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值