How can I list the privileges granted to the Oracle role?

I have a generic Oracle role that was created long ago:

create role MyRole; 

He was given the opportunity to select, insert, update and delete from some tables and views.

 grant select on sometable to MyRole; grant insert on sometable to MyRole; grant select on someothertable to MyRole; -- etc. 

How can I now list a specific list of privileges granted to a role? I am interested in discovering the specific tables and the rights that this role has with respect to each table. How can I recover this information?

+7
oracle plsql roles
source share
2 answers

You can simply search from the data dictionary ROLE_TAB_PRIVS . And do like this

SELECT * FROM ROLE_TAB_PRIVS WHERE ROLE = 'MyRole';

+8
source share

this works well:

 SELECT DBA_TAB_PRIVS.GRANTEE, TABLE_NAME, PRIVILEGE,DBA_ROLE_PRIVS.GRANTEE FROM DBA_TAB_PRIVS, DBA_ROLE_PRIVS WHERE DBA_TAB_PRIVS.GRANTEE = DBA_ROLE_PRIVS.GRANTED_ROLE AND DBA_TAB_PRIVS.GRANTEE='<ENTER GROUP ROLE HERE>' AND DBA_ROLE_PRIVS.GRANTEE = '<ENTER ROLE HERE>' ORDER BY DBA_ROLE_PRIVS.GRANTEE 
+3
source share

All Articles