Note
This view is available starting with V4.0.0.
Overview
The system tenant displays the database metadata of all tenants.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| DATABASE_NAME | varchar(128) | NO | Database Name |
| IN_RECYCLEBIN | varchar(3) | NO | Whether the database is in the recycle bin:
|
| COLLATION | varchar(128) | NO | Default Database COLLATION |
| READ_ONLY | varchar(3) | NO |
|
| COMMENT | varchar(2048) | NO | Database Description |
Sample query
In the sys tenant, query the database metadata of the tenant with ID 1002.
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
