How can I enumerate the list of privileges granted to an Oracle role?

Chris Farmer picture Chris Farmer · Mar 10, 2010 · Viewed 75.8k times · Source

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

create role MyRole;

It's been granted the ability 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 enumerate the specific list of privileges that were granted to the role? I am interested in discovering the specific tables and the rights this role has with respect to each table. How can I recover this information?

Answer

Shyamkkhadka picture Shyamkkhadka · Sep 12, 2012

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

SELECT * FROM ROLE_TAB_PRIVS WHERE ROLE = 'MyRole';