← Security
Oracle · Security

How to list all roles and privileges granted to a user in Oracle

Show every role, system privilege, and object privilege granted to one account, from DBA_ROLE_PRIVS, DBA_SYS_PRIVS, and DBA_TAB_PRIVS.

Tested on11g12c18c19c21c23ai26ai

List every role, system privilege, and object privilege granted directly to one account.

-- Roles granted
SELECT granted_role, admin_option, default_role
FROM   dba_role_privs
WHERE  grantee = UPPER('&&username')
ORDER  BY granted_role;

-- System privileges
SELECT privilege, admin_option
FROM   dba_sys_privs
WHERE  grantee = UPPER('&username')
ORDER  BY privilege;

-- Object privileges
SELECT owner, table_name, privilege, grantable
FROM   dba_tab_privs
WHERE  grantee = UPPER('&username')
ORDER  BY owner, table_name, privilege;
SecurityPrivilegesRoles