Purpose
This view displays the object privileges granted to the current user.
Applicability
This view is available only in Oracle mode of OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | VARCHAR2(128) | NO | The username of the user who is granted the access privilege. |
| OWNER | VARCHAR2(128) | NO | The owner of the object. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the object. |
| GRANTOR | VARCHAR2(128) | NO | The username of the user who executes the grant operation. |
| PRIVILEGE | VARCHAR2(40) | NO | The privilege of the object. |
| GRANTABLE | VARCHAR2(3) | NO | Indicates whether the privilege can be granted through the GRANT OPTION. |
| HIERARCHY | VARCHAR2(10) | NO | Indicates whether the privilege can be granted through the HIERARCHY OPTION. |
Sample query
A user queries the object privileges granted to him.
obclient [TEST3]> SELECT * FROM USER_TAB_PRIVS;
The query result is as follows:
+---------+-------+------------+---------+-----------+-----------+-----------+
| GRANTEE | OWNER | TABLE_NAME | GRANTOR | PRIVILEGE | GRANTABLE | HIERARCHY |
+---------+-------+------------+---------+-----------+-----------+-----------+
| TEST3 | SYS | TBL3 | SYS | UPDATE | NO | NO |
| TEST3 | SYS | TBL3 | SYS | SELECT | NO | NO |
+---------+-------+------------+---------+-----------+-----------+-----------+
2 rows in set