You can view roles in the system and the privileges of a role.
View roles by using views
You can view roles in the system, roles granted to a role, and the privileges of a role.
View roles in the system
To view roles in the system, query the
DBA_ROLESview as the administrator.obclient> SELECT * FROM DBA_ROLES; +----------+-------------------+---------------------+ | ROLE | PASSWORD_REQUIRED | AUTHENTICATION_TYPE | +----------+-------------------+---------------------+ | CONNECT | NO | NONE | | RESOURCE | NO | NONE | | DBA | NO | NONE | | PUBLIC | NO | NONE | | ROLE1 | NO | NONE | +----------+-------------------+---------------------+ 5 rows in setFor more information about the
DBA_ROLESview, see DBA_ROLES.View roles granted to a role
To view roles granted to a role, query the
ROLE_ROLE_PRIVSview. If no roles are granted to the role, no result is returned.obclient> SELECT * FROM ROLE_ROLE_PRIVS WHERE role='ROLE1'; +-------+--------------+--------------+ | ROLE | GRANTED_ROLE | ADMIN_OPTION | +-------+--------------+--------------+ | ROLE1 | ROLE2 | NO | +-------+--------------+--------------+ 1 row in setFor more information about the
ROLE_ROLE_PRIVSview, see ROLE_ROLE_PRIVS.View the system privileges of a role
To view the system privileges of a role, query the
ROLE_SYS_PRIVSview as the administrator.obclient> SELECT * FROM ROLE_SYS_PRIVS WHERE role='CONNECT'; +---------+----------------+--------------+ | ROLE | PRIVILEGE | ADMIN_OPTION | +---------+----------------+--------------+ | CONNECT | CREATE SESSION | NO | +---------+----------------+--------------+ 1 row in setFor more information about the
ROLE_SYS_PRIVSview, see ROLE_SYS_PRIVS.View the object privileges of a role
To view the object privileges of a role, query the
ROLE_TAB_PRIVSview.obclient> SELECT * FROM ROLE_TAB_PRIVS WHERE role='ROLE1'; +-------+-------+------------+-------------+-----------+-----------+ | ROLE | OWNER | TABLE_NAME | COLUMN_NAME | PRIVILEGE | GRANTABLE | +-------+-------+------------+-------------+-----------+-----------+ | ROLE1 | SYS | T1 | NULL | SELECT | NO | +-------+-------+------------+-------------+-----------+-----------+ 1 row in setFor more information about the
ROLE_TAB_PRIVSview, see ROLE_TAB_PRIVS.