Purpose
This view lists the system privileges granted to the current user.
Applicability
This view is available starting with OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| USERNAME | VARCHAR2(128) | NO | The user who is granted the privilege. |
| PRIVILEGE | VARCHAR2(40) | NO | The system privilege granted to the user. |
| ADMIN_OPTION | VARCHAR2(3) | NO | Indicates whether the administrative option is granted. |
Sample query
Query the system privileges granted to the SYS user and display the first 5 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