How to list all the roles existing in Oracle database?
I have been searching in the tables :
ROLE_TAB_PRIVS ROLE_SYS_PRIVS ROLE_ROLE_PRIVS SELECT * FROM ROLE_TAB_PRIVS WHERE ROLE = 'ROLETEST';
but I can't find a role that I have just created.
Querying DBA/USER Privilege Views A database administrator (DBA) for Oracle can simply execute a query to view the rows in DBA_SYS_PRIVS , DBA_TAB_PRIVS , and DBA_ROLE_PRIVS to retrieve information about user privileges related to the system , tables , and roles , respectively.
Unlike schema objects, roles are not contained in any schema. Therefore, a user who creates a role can be dropped with no effect on the role. Roles are designed to ease the administration of an end-user system and schema object privileges and are often maintained in Oracle Internet Directory.
select * from dba_role_privs where grantee = 'SCHEMA_NAME'; All the role granted to the schema will be listed.
Got the answer :
SELECT * FROM DBA_ROLES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With