Note
This view is available starting with V2.2.77.
Purpose
This view describes the roles granted to all users and the roles in the database.
Applicability
This view is applicable only to OceanBase Database in Oracle mode.
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 grant includes the ADMIN option. |
| DEFAULT_ROLE | VARCHAR2(3) | NO | Indicates whether the role is specified as the default role for the user. |
Sample query
View the roles owned by the
USER2user.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 the
ROLE1role.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
