Note
This view is available starting with V2.2.77.
Purpose
This view describes the system privileges granted to users and roles. This view does not display the USERNAME column.
Applicability
This view is applicable only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | VARCHAR2(128) | NO | The name of the grantee, user, or role to which the privilege is granted. |
| PRIVILEGE | VARCHAR2(40) | NO | The system privilege granted. |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the management option is granted. |
Sample query
Query the system privileges granted to the DBA role and display the first five records.
obclient [SYS]> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='DBA' AND ROWNUM <=5;
The query result is as follows:
+---------+------------------+--------------+
| GRANTEE | PRIVILEGE | ADMIN_OPTION |
+---------+------------------+--------------+
| DBA | CREATE SESSION | YES |
| DBA | CREATE TABLE | YES |
| DBA | CREATE ANY TABLE | YES |
| DBA | ALTER ANY TABLE | YES |
| DBA | BACKUP ANY TABLE | YES |
+---------+------------------+--------------+
5 rows in set