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 OceanBase Database in Oracle mode.
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 role has been granted the ADMIN option. |
Sample query
Query the table privileges granted to the role ROLE1 that users can access.
obclient [SYS]> SELECT * FROM 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