Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of the databases in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| 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 | OCP obtains the read-only status of the database:
|
| COMMENT | varchar(2048) | NO | The description of the database. |
Sample query
Query the metadata of the databases in the current user 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