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 that receives the grant. |
| GRANTED_ROLE | VARCHAR2(30) | NO | The name of the granted role. |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the ADMIN option is specified in the grant. |
| DEFAULT_ROLE | VARCHAR2(3) | NO | Indicates whether the role is specified as the default role of the user. |
Sample query
Query the roles granted to 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 setQuery the roles granted to 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