Note
This view is available starting with V2.2.77.
Purpose
Describes the table privileges granted to roles. It provides information about the roles that users can access.
Applicability
This view is available only in Oracle-compatible mode of OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| ROLE | VARCHAR2(128) | NO | The name of the role. |
| OWNER | VARCHAR2(128) | NO | The owner of the object. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the object. |
| COLUMN_NAME | VARCHAR2(128) | NO | The name of the column, if applicable. |
| PRIVILEGE | VARCHAR2(40) | NO | The object privileges granted to the role. |
| GRANTABLE | VARCHAR2(3) | NO | Indicates whether the ADMIN option is granted to the role. |
Sample query
Query the table privileges granted to the role ROLE1 that users can access.
obclient [SYS]> SELECT * FROM SYS.ROLE_TAB_PRIVS WHERE ROLE = 'ROLE1';
The query result is as follows:
+-------+-------+------------+-------------+-----------+-----------+
| ROLE | OWNER | TABLE_NAME | COLUMN_NAME | PRIVILEGE | GRANTABLE |
+-------+-------+------------+-------------+-----------+-----------+
| ROLE1 | SYS | TBL2 | NULL | UPDATE | NO |
| ROLE1 | SYS | TBL2 | NULL | SELECT | NO |
+-------+-------+------------+-------------+-----------+-----------+
2 rows in set