Note
This view is available starting with V2.2.77.
Purpose
Describes the roles granted to the current user.
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 PUBLIC |
| GRANTED_ROLE | VARCHAR2(30) | NO | The name of the role granted to the user |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the ADMIN option is specified for 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 the current user.
obclient [SYS]> SELECT * FROM USER_ROLE_PRIVS;
The query result is as follows:
+---------+--------------+--------------+--------------+
| GRANTEE | GRANTED_ROLE | ADMIN_OPTION | DEFAULT_ROLE |
+---------+--------------+--------------+--------------+
| SYS | ROLE1 | YES | YES |
| SYS | ROLE2 | YES | YES |
+---------+--------------+--------------+--------------+
2 rows in set
