Created
November 19, 2008 08:21
-
-
Save tothda/26456 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
lpad(' ', 2*level) || granted_role "User, his roles and privileges" | |
from | |
( | |
/* THE USERS */ | |
select | |
null grantee, | |
username granted_role | |
from | |
dba_users | |
where | |
username like upper('%&enter_username%') | |
/* 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment