Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays information about database privileges.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The username of the user to which the privilege is granted. |
| TABLE_CATALOG | varchar(512) | NO | The name of the catalog to which the table belongs. The value of this column is always def. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| PRIVILEGE_TYPE | varchar(64) | NO | The type of the privilege. |
| IS_GRANTABLE | varchar(3) | NO | Indicates whether the privilege can be granted. |
Sample query
Query database privilege information and display the first five records.
obclient [oceanbase]> SELECT * FROM information_schema.SCHEMA_PRIVILEGES LIMIT 5;
The query result is as follows:
+------------+---------------+--------------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE |
+------------+---------------+--------------------+----------------+--------------+
| 'root'@'%' | def | information_schema | ALTER | NO |
| 'root'@'%' | def | information_schema | CREATE | NO |
| 'root'@'%' | def | information_schema | DELETE | NO |
| 'root'@'%' | def | information_schema | DROP | NO |
| 'root'@'%' | def | information_schema | INSERT | NO |
+------------+---------------+--------------------+----------------+--------------+
5 rows in set