Note
This view is available starting with V2.2.77.
Purpose
Describes the roles granted to all users and in the database.
Applicability
This view is available only in OceanBase Database in Oracle-compatible mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | VARCHAR2(30) | NO | The name of the user or role that received the grant. |
| GRANTED_ROLE | VARCHAR2(30) | NO | The name of the granted role. |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the grant included the ADMIN option. |
| DEFAULT_ROLE | VARCHAR2(3) | NO | Indicates whether the role is designated as the default role for the user. |
Sample query
Query 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 setQuery 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