OceanBase-specific views

2023-12-25 08:49:42  Updated

OceanBase-specific views display information specific to OceanBase Database.

Concept

OceanBase-specific views refer to the views that are defined and implemented by OceanBase Database itself. These views are used to display the metadata information and system status information of the database, including tables, columns, indexes, users, roles, permissions, and more. These views are typically stored in the system tablespace, and they are read-only, meaning they cannot be modified or deleted.

Storage location

OceanBase-specific views under MySQL tenants and sys tenants are stored under the oceanbase database, while views under Oracle tenants are stored under SYS.

View types

Different view types by scenario

OceanBase-specific views can be classified into data dictionary views and dynamic performance views by scenario and the information displayed.

Note

An OB_* prefix is used to distinguish OceanBase-specific views from other views.

Data dictionary views

OceanBase-specific data dictionary views include the following types:

  • DBA_OB_*: Views visible only to the sys tenant display information about database objects managed by the sys tenant, such as the DBA_OB_SERVERS and DBA_OB_UNITS views. Views that are accessible to all tenants display the information about OceanBase database objects at the tenant level, such as DBA_OB_LS_LOCATIONS and DBA_OB_TABLEGROUPS.

  • CDB_OB_*: Views that display the information about database objects of all tenants and are accessible in the sys tenant only, which are usually tenant-level data dictionary views prefixed with DBA_OB_, such as CDB_OB_LS_LOCATIONS and CDB_OB_TABLEGROUPS.

Dynamic performance views

OceanBase-specific dynamic performance views include the following types:

  • GV$OB_*: Views of this type display the running status and performance metrics of the entire cluster. Views of this type provide global status information and are accessible in the entire cluster. The information returned varies based on the access privileges.

    • If you query a view from the sys tenant, information about all tenants is returned.
    • If you query a view from a user tenant, information about the current tenant is returned.
  • V$OB_*: Views of this type display the running status and performance metrics of only the node to which the client connects. To obtain the status information about other nodes, query GV$OB_* views.

In versions earlier than OceanBase Database V4.0.0, some OceanBase-specific views do not have the OB_ prefix, such as v$plan_cache_stat and v$obrpc_outgoing. In OceanBase Database V4.0.0 and later, all OceanBase-specific views have the OB_ prefix in their names, such as V$OB_PLAN_CACHE_STAT and V$OB_RPC_OUTGOING

Different view types by access privilege

OceanBase-specific views can be classified into data dictionary views of the sys tenant and tenant-level data dictionary views by access privilege.

Data dictionary views of the sys tenant

The sys tenant data dictionary views are accessible only to the system administrator (SYSDBA) and system user (SYS). These views display the metadata and system status information of the entire database, including information about tables, columns, indexes, users, roles, and privileges. These views are usually stored in the system tablespace and read-only. You cannot modify or delete them.

Tenant-level data dictionary views

Tenant-level data dictionary views are accessible to regular users and tenant administrators. These views display the metadata and system status information of the current tenant, including information about tables, columns, indexes, users, roles, and privileges. These views are usually stored in the user tablespace and read-only. You cannot modify or delete them. A sys tenant data dictionary view can display the metadata and system status information of the entire database, including information of all tenants. A tenant-level data dictionary view can display the metadata and system status information of only the current tenant, and cannot display information about other tenants.

References

Contact Us