SQL Language (MOSC)

MOSC Banner

SQL to retrieve username, role and privs - 10g r2

edited May 1, 2012 8:07PM in SQL Language (MOSC) 5 commentsAnswered
Hi,

We are trying to generate a list of a database user alongwith what role(s) and privilege(s)
it has. It is a 10g R2 database

 

If we are not mistaken, the required data dictionary views involved in the query would be

1. DBA_USERS -->     to retrieve USERNAME
2. DBA_SYS_PRIVS --> to retrieve PRIVILEGE
3. DBA_ROLE_PRIVS --> to retrive GRANTED_ROLE
 

The format of the report should be like

username    privilege        granted_role

ABC     create table     connect
                             resource

XYZ     create table     connect
            create sequence  resource
            create view    


Could someone please provide us with the query that would allow us to generate the above output?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center