Note
This view is available starting with V2.2.77.
Purpose
Describes the table privileges granted to a role. It provides information about the roles that a user 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 ADMIN option is granted to the role. |
Sample query
Query the table privileges granted to the role ROLE1 that a user 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