Note
This view is available starting with V2.2.77.
Purpose
ALL_TAB_PRIVS lists the object privileges that meet the following conditions:
The current user is the owner of the object, or the grantor of the object privilege, or the grantee of the object privilege.
The grantee of the object privilege is an activated role or the PUBLIC role.
Applicability
This view is applicable only to OceanBase Database in Oracle-compatible mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTOR | VARCHAR2(128) | NO | The username of the grantor. |
| GRANTEE | VARCHAR2(128) | NO | The username of the grantee. |
| TABLE_SCHEMA | VARCHAR2(128) | NO | The schema of the object. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the object. |
| PRIVILEGE | VARCHAR2(40) | NO | The privilege of the object. |
| GRANTABLE | VARCHAR2(3) | NO | Indicates whether the privilege can be granted with the GRANT OPTION. |
| HIERARCHY | VARCHAR2(10) | NO | Indicates whether the privilege can be granted with the HIERARCHY OPTION. |
Sample query
Query the object privileges granted to the TEST3 user.
obclient [SYS]> SELECT * FROM ALL_TAB_PRIVS WHERE GRANTEE='TEST3';
The query result is as follows:
+---------+---------+--------------+------------+-----------+-----------+-----------+
| GRANTOR | GRANTEE | TABLE_SCHEMA | TABLE_NAME | PRIVILEGE | GRANTABLE | HIERARCHY |
+---------+---------+--------------+------------+-----------+-----------+-----------+
| SYS | TEST3 | SYS | TBL3 | SELECT | NO | NO |
| SYS | TEST3 | SYS | TBL3 | UPDATE | NO | NO |
+---------+---------+--------------+------------+-----------+-----------+-----------+
2 rows in set