Internal tables
OceanBase provides the following types of internal tables:
Core system tables (core tables in short)
Common system tables
Virtual tables
Information_Schema tables
Multi-tenancy
OceanBase is deployed as a multi-tenant architecture. The tenants are categorized into two types: common tenant and root tenant. System tables are all stored under the root tenant and the tenant ID in the primary key is used to distinguish the content of each tenant. Inside each tenant, a read-only view containing the data of the tenant is created.
After the multi-tenancy feature is introduced, system tables are named with the following conventions:
All tables prefixed by __all contain the data of all tenants, and all tables prefixed by __tenant contain only the data of a single tenant.
Virtual tables are prefixed by __all_virtual or __tenant_virtual depending on whether the table contains the data of all tenants or contains only the data of a single tenant.
For example, __all_virtual_session_variable contains the information about session variables of all tenants and is internally implemented as a virtual table; while the __tenant_virtual_session_variable table contains the information about session variables of only a single tenant and is internally implemented as a virtual table.
The following describes the system tables under the root tenant and common tenants.
Root tenant
Core tables
__all_core_table, __all_root_table, __all_table, __all_column, __all_database, __all_tablegroup, __all_tenant, and __all_ddl_operation
Mode and user privilege tables
__all_part, __all_database, __all_tablegroup, __all_user, __all_table_privilege, and __all_database_privilege in addition to __all_table and __all_column.
Partition position information tables
Tables of this type are divided into two levels. The first level is __all_root_table, which cannot be partitioned. The second level is __all_meta_table.
The position information of all system tables is recorded in the __all_root_table table.
System tables related to tenants, resource pools, and units
System tables related to the deployment of zones and servers
Table related to system configuration: __all_sys_parameter
Tables related to system variables and system status: __all_sys_variable and __all_sys_stat
Table related to Data Definition Language (DDL) operations: __all_ddl_operation
Other tables, for example, various statistical system tables and system tables added for implementing specific features.
Common tenant
Read-only views prefixed by __tenant, which record the internal information of tenants.
Information_schema tables, which are standard information_schema views defined in SQL and are views of other system tables.