Note
This view is available starting with V4.0.0.
Purpose
This view displays the metadata of 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 | The read-only status of the database. Valid values:
|
| COMMENT | varchar(2048) | NO | The description of the database. |
Sample query
In the sys tenant, query the metadata of databases in 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