An OceanBase database in MySQL mode provides a data dictionary where tables are protected. You can access the tables only by using a debug build. A dictionary view is used to access a data dictionary. In MySQL mode, you can use INFORMATION_SCHEMA tables and SHOW statements to access the data stored in data dictionary tables.
Types
An OceanBase database in MySQL mode provides the following types of dictionary views: information_schema.* views, oceanbase.CDB_* views, and mysql.* views.
information_schema.* views
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 instead of base tables.
mysql.* views
mysql.* views are system views and contain tables that store the information required to run the server of an OceanBase database in MySQL mode. In most cases, mysql.* views are data dictionary tables that store the metadata of database objects and system tables for other operations. An OceanBase database supports specific mysql.* views such as mysql.help_* views that store server help information, mysql.time_zone* views that record time zone information, and mysql.user and mysql.db views that record information about user privileges.
oceanbase.CDB_* views
Each DBA_* view in an OceanBase database corresponds to an oceanbase.CDB_* view in the SYS tenant. You can obtain information about specific database objects in the SYS tenant and user tenants from oceanbase.CDB_* views.
Working mechanism
The dictionary object cache is a shared global cache. It stores previously accessed data dictionary objects in memory to reuse objects and minimize the disk I/O. The dictionary object cache adopts the least recently used (LRU) eviction strategy. This means that the cache evicts the objects that are least used in recent times.
The dictionary object cache consists of cache partitions that store different types of objects. The size limit is configurable for some cache partitions and hard-coded for others.
Storage
In OceanBase Database, the data dictionary that stores the metadata of each tenant as a whole is stored only in the SYS tenant.
The data dictionary that stores the metadata for a specific tenant is stored in the dictionary table dedicated to the tenant. Therefore, each set of data dictionary tables is stored in its own dedicated tenant and is not accessible to other tenants.