Note
This view is available starting with V1.4.
Purpose
This view displays database privileges.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The account name to which privileges are granted. |
| TABLE_CATALOG | varchar(512) | NO | A fixed value (def). |
| TABLE_SCHEMA | varchar(128) | NO | The database name. |
| PRIVILEGE_TYPE | varchar(64) | NO | The granted privilege. |
| IS_GRANTABLE | varchar(3) | NO | Indicates whether the privilege can be granted to other users. |
Sample query
Query the database privileges and display the first 5 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