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 |
| TABLEGROUP_NAME | varchar(128) | NO | Name of the table group bound to the database |
Sample query
Query the database metadata of the tenant with ID 1002 in 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