Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting the list of roles/privileges which allow access to a object

KunwarMay 6 2012 — edited May 7 2012
hi friends,
Sometimes i am not able to find the exact reason why a particular user has access to a particular object. There are so many roles granted to a user that i get confused in reaching the correct role through the schema browser of TOAD which enables that user to do a select or any other operation on a particular operation on given object.

Can you please guide me in writing a simple query which will tell me why a particular user has a particular access to a particular object?

I tried to use the below script but no success in getting to my goal:
 SELECT DBMS_METADATA.GET_DDL('USER', '&&a')|| '/' DDL  FROM DBA_USERS WHERE ROWNUM <2
 UNION ALL
 SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','&&a' )|| '/' DDL FROM DBA_USERS where rownum <2
 UNION ALL
 SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT', '&&a') || '/' DDL FROM DBA_USERS where rownum <2
I am using oracle 11.1.0.7.0.

regds,
Kunwar
This post has been answered by ittichai on May 7 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2012
Added on May 6 2012
2 comments
572 views