Note
This view is available starting with V2.2.77.
Purpose
This view describes the roles granted to all users and roles in the database.
Applicability
This view is available starting with OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | VARCHAR2(30) | NO | The name of the user or role to which the privilege is granted. |
| GRANTED_ROLE | VARCHAR2(30) | NO | The name of the granted role. |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the grant includes the ADMIN option. |
| DEFAULT_ROLE | VARCHAR2(3) | NO | Indicates whether the role is designated as the default role for the user. |
Sample query
View the roles owned by user
USER2.obclient [SYS]> SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTEE ='USER2';The query result is as follows:
+---------+--------------+--------------+--------------+ | GRANTEE | GRANTED_ROLE | ADMIN_OPTION | DEFAULT_ROLE | +---------+--------------+--------------+--------------+ | USER2 | ROLE1 | NO | YES | +---------+--------------+--------------+--------------+ 1 row in setView the roles owned by role
ROLE1.obclient [SYS]> SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTEE ='ROLE1';The query result is as follows:
+---------+--------------+--------------+--------------+ | GRANTEE | GRANTED_ROLE | ADMIN_OPTION | DEFAULT_ROLE | +---------+--------------+--------------+--------------+ | ROLE1 | ROLE2 | NO | YES | +---------+--------------+--------------+--------------+ 1 row in set