Guest User

Untitled

a guest
Feb 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. select
  2. lpad(' ', 2*level) || granted_role "User, his roles and privileges"
  3. from
  4. (
  5. /* THE USERS */
  6. select
  7. null grantee,
  8. username granted_role
  9. from
  10. dba_users
  11. where
  12. username like upper('%&enter_username%')
  13. /* THE ROLES TO ROLES RELATIONS */
  14. union
  15. select
  16. grantee,
  17. granted_role
  18. from
  19. dba_role_privs
  20. /* THE ROLES TO PRIVILEGE RELATIONS */
  21. union
  22. select
  23. grantee,
  24. privilege
  25. from
  26. dba_sys_privs
  27. )
  28. start with grantee is null
  29. connect by grantee = prior granted_role;
Add Comment
Please, Sign In to add comment