Note
This view is available starting with V2.2.77.
Purpose
The ALL_TAB_PRIVS view lists object privileges granted to the following:
The current user as the owner, grantor, or grantee of the object privilege.
The PUBLIC role or an activated role as the grantee of the object privilege.
Applicability
This view applies only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTOR | VARCHAR2(128) | NO | The username that granted the privilege. |
| GRANTEE | VARCHAR2(128) | NO | The username to which the privilege is granted. |
| 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 granted to 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