Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of all databases in the system tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| DATABASE_NAME | varchar(128) | NO | The database name. |
| IN_RECYCLEBIN | varchar(3) | NO | Indicates whether the database is in the recycle bin:YESNO |
| COLLATION | varchar(128) | NO | The default COLLATION of the database. |
| READ_ONLY | varchar(3) | NO | |
| COMMENT | varchar(2048) | NO | The description of the database. |
Sample query
Query the metadata of the tenant with ID 1002 in the system tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_DATABASES WHERE TENANT_ID =1002;
The query result is as follows:
+-----------+--------------------+---------------+--------------------+-----------+--------------------+
| TENANT_ID | DATABASE_NAME | IN_RECYCLEBIN | COLLATION | READ_ONLY | COMMENT |
+-----------+--------------------+---------------+--------------------+-----------+--------------------+
| 1002 | infotest | NO | utf8mb4_general_ci | NO | |
| 1002 | test | NO | utf8mb4_general_ci | NO | test schema |
| 1002 | __public | NO | utf8mb4_general_ci | YES | public schema |
| 1002 | __recyclebin | NO | utf8mb4_general_ci | YES | recyclebin schema |
| 1002 | mysql | NO | utf8mb4_general_ci | NO | MySql schema |
| 1002 | information_schema | NO | utf8mb4_general_ci | NO | information_schema |
| 1002 | oceanbase | NO | utf8mb4_general_ci | NO | system database |
+-----------+--------------------+---------------+--------------------+-----------+--------------------+
7 rows in set