The MySQL mode of OceanBase Database provides a data dictionary where tables are protected. A dictionary view is used to access a data dictionary table. In MySQL mode, you can use INFORMATION_SCHEMA tables and SHOW statements to access the data stored in data dictionary tables.
Composition
The MySQL mode of OceanBase Database provides the following types of dictionary views: views with the INFORMATION_SCHEMA. prefix, views with the OCEANBASE.CDB/DBA prefix, and views with the MYSQL. prefix.
Views with the INFORMATION_SCHEMA. prefix
INFORMATION_SCHEMA allows you to access the database metadata in a MySQL tenant. For example, you can obtain the name of a database or table, the data type of a column, or access privileges. INFORMATION_SCHEMA is also called a data dictionary or a system catalog. INFORMATION_SCHEMA is a database or schema in a MySQL tenant and is used to store information about all other databases maintained by the MySQL tenant. The INFORMATION_SCHEMA database contains several read-only tables. These tables are actually views rather than base tables.
Views with the MYSQL. prefix
Views with the MYSQL. prefix are system views in OceanBase Database's MySQL mode. These views include tables that store the necessary information for the server to run in the OceanBase Database's MySQL mode. Generally, views with the mysql. prefix contain data dictionary tables that store metadata for database objects and system tables used for other operational purposes. OceanBase Database is compatible with some mysql-prefixed views. For example, the help_* views contain server-side help information, the time_zone* views store timezone-related information, and the USER and DB views record information related to user privileges.
Views with the OCEANBASE.CDB/DBA prefix
In OceanBase Database, you can use each view with the DBA_ prefix to obtain the corresponding information of some database objects of the current tenant. Views with the CDB prefix under the oceanbase database of the sys tenant can be used to obtain information about some database objects of all tenants in the current cluster.
Storage
The metadata of different types of database objects of a tenant is persisted in the corresponding data dictionary table of the tenant. In principle, a tenant can only access its own data dictionary tables by using the corresponding dictionary views. However, the sys tenant can access the data dictionary tables of all tenants in the current cluster by using the corresponding dictionary views.