The system views of OceanBase Database are classified into dictionary views and performance views. This topic introduces dictionary and performance views and describes how to query these views.
Dictionary views
OceanBase Database has a data dictionary, which is protected and can only be accessed through dictionary views.
Dictionary views consist of the information listed in the following table.
| Prefix | Privilege | Content | Remarks |
|---|---|---|---|
| DBA_ | Database administrators | All objects | Some DBA_ views have additional columns that contain useful information for administrators. |
| ALL_ | All users | Objects to which users have privileges | ALL_ views include objects owned by users. |
| USER_ | All users | Objects owned by users | USER_ views usually exclude the OWNER column. |
Views with the prefix
DBA_Views with the prefix
DBA_display all relevant information in the entire database.DBA_views are intended only for administrators.Views with the prefix
ALL_Views with the prefix
ALL_refer to the user's overall perspective of the database. In addition to the schema objects owned by users, these views return information about the schema objects that are granted to users through public or explicit authorization.Views with the prefix
USER_Views with the prefix
USER_are the ones that are most likely to be of interest to typical database users. These views:Refer to the user's private environment in the database, including metadata about schema objects created by the user, permissions granted by the user, and so on.
Display only rows relevant to the user, returning a subset of the information in
ALL_views.Contain the same columns as other views, but with the implicit
OWNERcolumn.Can have abbreviated
PUBLICsynonyms for convenience.
Performance views
Performance views are virtual tables built on the database's memory structure. They provide data on internal disk and memory structures and are primarily related to performance, known as dynamic performance views.
The names of performance views start with V$. Almost every V$ view has a corresponding GV$ view, which is a global V$ view. In an OceanBase cluster, querying a GV$ view returns information about all qualified V$ views.
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;