System views of OceanBase Database include dictionary views and performance views. This topic provides an overview of dictionary views and system views and describes how to query these views.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Dictionary views
OceanBase Database provides protected data dictionaries and allows you to obtain their information only through dictionary views.
The following table describes the content of different types of dictionary views.
| Prefix | Privilege | Content | Remarks |
|---|---|---|---|
| DBA_ | Database administrator | All objects | Some views prefixed with DBA_ include additional columns that contain information useful to the database administrator. |
| ALL_ | All users | Objects on which users have privileges | Views prefixed with ALL_ include objects owned by users. |
| USER_ | All users | Objects owned by users | Views prefixed with USER_ usually do not include the OWNER column. |
Views prefixed with
DBA_Display all relevant information in the entire database. Only database administrators can access views prefixed with
DBA_.Views prefixed with
ALL_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.
Views prefixed with
USER_These are the views that are most frequently used by regular database users. These views:
Reference the private environment of a user in the database, including metadata about schema objects created by the user and privileges granted by the user
Display only rows related to a user and return a subset of the information in views prefixed with
ALL_.Contain the same columns as other views, except that the
OWNERcolumn is implicitly contained.Can have abbreviated
PUBLICsynonyms for convenience.
Performance views
Performance views are derived from virtual tables that are created based on database memory structures. They provide only data related to internal disk structures and memory structures and are called dynamic performance views because they are mainly related to performance.
Names of performance views start with V$. In most cases, a V$ view corresponds to a GV$ view, which is a global V$ view. If you query a GV$ view in an OceanBase cluster, the V$ view information from all qualified database instances is returned.
Query system views
You can query a system view by using the SELECT statement.
Sample statements:
obclient> SELECT * FROM DBA_VIEWS;
obclient> SELECT * FROM ALL_VIEWS;