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 name of the database. |
| 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 comment 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. |
| DEFAULT_TABLESPACE | varchar(30) | NO | The default tablespace name.
NoteThis column is available starting with V5.0.1. |
Sample query
In the system tenant, query the metadata of the database test2 in the tenant with ID 1002.
obclient> SELECT * FROM oceanbase.CDB_OB_DATABASES
WHERE TENANT_ID =1002
AND DATABASE_NAME = 'test2'\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1002
DATABASE_NAME: test2
IN_RECYCLEBIN: NO
COLLATION: utf8mb4_bin
READ_ONLY: NO
COMMENT:
TABLEGROUP_NAME: NULL
DEFAULT_TABLESPACE: ts1
1 row in set
