Note
This view is available starting with V4.0.0.
Purpose
This view displays the database metadata of the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| 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 | Whether the database is in a read-only state. Valid values:
|
| COMMENT | varchar(2048) | NO | Database Description |
Sample query
In the sys tenant, query the database metadata of the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_DATABASES;
The query result is as follows:
+--------------------+---------------+--------------------+-----------+--------------------+
| DATABASE_NAME | IN_RECYCLEBIN | COLLATION | READ_ONLY | COMMENT |
+--------------------+---------------+--------------------+-----------+--------------------+
| sys_external_tbs | NO | utf8mb4_general_ci | NO | |
| test | NO | utf8mb4_general_ci | NO | test schema |
| ORAAUDITOR | NO | utf8mb4_general_ci | NO | oracle sys schema |
| LBACSYS | NO | utf8mb4_general_ci | NO | oracle sys schema |
| SYS | NO | utf8mb4_general_ci | NO | oracle sys schema |
| __public | NO | utf8mb4_general_ci | YES | public schema |
| __recyclebin | NO | utf8mb4_general_ci | YES | recyclebin schema |
| mysql | NO | utf8mb4_general_ci | NO | MySql schema |
| information_schema | NO | utf8mb4_general_ci | NO | information_schema |
| oceanbase | NO | utf8mb4_general_ci | NO | system database |
+--------------------+---------------+--------------------+-----------+--------------------+
10 rows in set
