授予普通用户查看执行计划权限



SQL> create role plustrace
;

Role created.


SQL> grant select on v_$sesstat to plustrace;

Grant succeeded.

SQL> grant select on v_$statname to plustrace;

Grant succeeded.

SQL> grant select on v_$session to plustrace;

Grant succeeded.

SQL> grant select on v_$sql_plan to plustrace;

Grant succeeded.

SQL> grant select on v_$sql_plan_statistics_all to plustrace;

Grant succeeded.

SQL> grant select on v_$sql to plustrace;

Grant succeeded.

SQL> grant plustrace to dba with admin option;

Grant succeeded.


SQL> grant plustrace to public; --所有用户

Grant succeeded.

--role,priv dict_view & table, can tell by predicate

/* index */
select * from DBA_ROLES;
select * from sys.system_privilege_map;
select * from sys.table_privilege_map;

/* contain */
select * from ROLE_ROLE_PRIVS where role='DBA';
select * from ROLE_SYS_PRIVS where role='DBA';
select * from ROLE_TAB_PRIVS where role='DBA';

/* owner */
select * from DBA_ROLE_PRIVS where grantee = 'HR';
select * from DBA_SYS_PRIVS where grantee = 'HR';
select * from DBA_TAB_PRIVS where grantee = 'HR';

/* object */
select * from table_privileges where table_name = 'V_$SESSION';

--there is also a SYS.COLUMN_PRIVILEGES ...
/* oracle中权限分为 角色级,系统级,对象级
权限授予的对象可以是 用户,PUBLIC(特殊用户,代表全部),角色
*/

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28859270/viewspace-776222/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28859270/viewspace-776222/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值