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