Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of all databases under the sys 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. Valid values:
|
| COLLATION | varchar(128) | NO | The default collation of the database. |
| READ_ONLY | varchar(3) | NO |
|
| COMMENT | varchar(2048) | NO | The description of the database. |
| TABLEGROUP_NAME | varchar(128) | NO | The name of the table group to which the database is bound.
NoteThis column is available starting with V4.4.1. |
Sample query
Query the metadata of the database of the tenant with the tenant ID 1002 under the sys tenant.
obclient> SELECT * FROM oceanbase.CDB_OB_DATABASES WHERE TENANT_ID =1002 LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1002
DATABASE_NAME: oceanbase
IN_RECYCLEBIN: NO
COLLATION: utf8mb4_general_ci
READ_ONLY: NO
COMMENT: system database
TABLEGROUP_NAME: NULL
1 row in set