Users roles and privilage in database


select lpad(‘ ‘, 2*level) || granted_role “User, his roles and privileges”
from
  (
  /* THE USERS */
    select null grantee, username granted_role
    from dba_users
  /* THE ROLES TO ROLES RELATIONS */
  union
    select grantee, granted_role
    from dba_role_privs
  /* THE ROLES TO PRIVILEGE RELATIONS */
  union
    select grantee, privilege
    from dba_sys_privs
  )
start with grantee is null
connect by grantee = prior granted_role;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: