Note
This view is available starting with V4.0.0.
Overview
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 read-only state. Valid values:
|
| COMMENT | varchar(2048) | NO | Database Description |
Sample query
Users can query the database metadata of their own tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_DATABASES;
The query result is as follows:
+--------------------+---------------+--------------------+-----------+--------------------+
| DATABASE_NAME | IN_RECYCLEBIN | COLLATION | READ_ONLY | COMMENT |
+--------------------+---------------+--------------------+-----------+--------------------+
| infotest | NO | utf8mb4_general_ci | NO | |
| test | NO | utf8mb4_general_ci | NO | test 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 |
+--------------------+---------------+--------------------+-----------+--------------------+
7 rows in set
