授予普通使用者檢視執行計劃許可權

tthero00boo發表於2013-11-10



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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章