OceanBase Database V4.x has five view systems: OceanBase-specific views, MySQL-compatible views, Oracle-compatible views, Oracle-compatible views in MySQL tenants, and Oracle-compatible views in the sys tenant. The following table describes the view systems.
| Category | Type | Format |
|---|---|---|
| OceanBase-specific views | Data dictionary views | DBA_OB_* |
| CDB_OB_* | ||
| Dynamic performance views | GV$OB_* | |
| V$OB_* | ||
| MySQL-compatible views | Data dictionary views | information_schema.* |
| mysql.* | ||
| Oracle-compatible views | Data dictionary views | SYS.DBA_*, SYS.USER_*, or SYS.ALL_* |
| Dynamic performance views | SYS.V$* or SYS.GV$* | |
| Oracle-compatible views in MySQL tenants | Data dictionary views | oceanbase.DBA_* |
| Dynamic performance views | oceanbase.V$* or oceanbase.GV$* | |
| Oracle-compatible views in the sys tenant | Data dictionary views | oceanbase.CDB_* |
OceanBase-specific views
OceanBase-specific views include data dictionary views and dynamic performance views.
Data dictionary views are named in the
DBA_OB_*orCDB_OB_*format.DBA_OB_*: Views visible only to thesystenant display information about database objects managed by thesystenant. Views visible to all tenants display information about tenant-level database objects specific to OceanBase Database.CDB_OB_*: Views of this type display information about database objects of all tenants in thesystenant. Generally, a view named in this format corresponds to a tenant-level data dictionary view named in theDBA_OB_*format.
Dynamic performance views are named in the
GV$OB_*orV$OB_*format.GV$OB_*: Views of this type display the running status and performance metrics of the entire cluster. They 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
systenant, information about all tenants is returned. - If you query a view from a user tenant, information about the current tenant is returned.
- If you query a view from the
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, queryGV$OB_*views.
MySQL-compatible views
MySQL-compatible views include only two types of data dictionary views:
information_schema.*: Views of this type display database metadata of MySQL tenants, including the names of databases or tables, data types of columns, and access privileges.mysql.*: Views of this type provide access to data dictionary tables that store metadata of database objects and system tables intended for other purposes. For example, themysql.help_*view provides some help information on the server side, themysql.time_zone_*view displays information related to the time zone, and themysql.userandmysql.dbviews record some information related to user privileges.
Oracle-compatible views
Oracle-compatible views include data dictionary views and dynamic performance views.
Data dictionary views are named in the
SYS.DBA_*,SYS.USER_*, orSYS.ALL_*format.SYS.DBA_*: These views display all relevant information in the entire database. Only database administrators can access views prefixed withDBA_.SYS.ALL_*: These views provide an overview of the database for users. In addition to the schema objects owned by users, these views return the schema objects on which users are publicly or explicitly granted privileges.SYS.USER_*: Views of this type display only rows related to users, which are a subset of theSYS.ALL_*views. These views contain the same columns as other data dictionary views, except that these views do not contain theOWNERcolumn.
Dynamic performance views are named in the
SYS.V$*orSYS.GV$*format.SYS.V$*: Views of this type display the running status and performance metrics of the node to which the client connects. They provide status information about only the node to which the client connects. To obtain status information about other nodes, querySYS.GV$*views.SYS.GV$*: Views of this type display the running status and performance metrics of the entire cluster. They 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
systenant, information about all tenants is returned. - If you query a view from a user tenant, information about the current tenant is returned.
- If you query a view from the
Oracle-compatible views in MySQL tenants
Oracle-compatible views in MySQL tenants include data dictionary views and dynamic performance views.
Data dictionary views are named in the
oceanbase.DBA_*format.These data dictionary views display metadata and performance metric information of a database, which are similar to
DBA_*views in an Oracle database. These views typically provide DBA-level access to information about all objects and system status in the database.Dynamic performance views are named in the
oceanbase.V$*oroceanbase.GV$*format.oceanbase.V$*: Views of this type display performance and status information about the current OBServer node. They are accessible only on the current OBServer node.oceanbase.GV$*: Views of this type display performance and status information of the entire cluster, which can be accessed across the entire cluster.
Oracle-compatible views in the sys tenant
Oracle-compatible views in the sys tenant contain only data dictionary views named in the oceanbase.CDB_* format. Views of this type provide information about some database objects in the sys tenant and user tenants, including all object information, partition information, and table information. Oracle databases provide standard data dictionary views for these database objects. These views can be accessed cross tenants. For example, CDB_OBJECTS can display the information about database objects of all tenants.