Note
This view is available starting with V4.3.0.
Purpose
The DBA_MVIEWS view is used to display information about all materialized views.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | YES | The name of the materialized view owner. |
| MVIEW_NAME | VARCHAR2(128) | YES | The name of the materialized view. |
| CONTAINER_NAME | VARCHAR2(128) | YES | The name of the container table of the materialized view. |
| QUERY | CLOB | NO | The query that defines the materialized view. |
| QUERY_LEN | NUMBER | NO | The length of the query, in bytes. |
| UPDATABLE | VARCHAR2(1) | NO | Indicates whether the materialized view is updatable.
NoteThis column is compatible only, and its value is N by default. |
| UPDATE_LOG | VARCHAR2(128) | NO | The name of the update log for an updatable materialized view.
NoteThis column is compatible only, and its value is NULL by default. |
| MASTER_ROLLBACK_SEG | VARCHAR2(128) | NO | The rollback segment of the master site or the master materialized view site.
NoteThis column is compatible only, and its value is NULL by default. |
| MASTER_LINK | VARCHAR2(128) | NO | The database link of the master site or the master materialized view site.
NoteThis column is compatible only, and its value is NULL by default. |
| REWRITE_ENABLED | VARCHAR2(1) | NO | Indicates whether query rewrite is enabled.
|
| REWRITE_CAPABILITY | VARCHAR2(9) | NO | Indicates whether the materialized view meets the requirements for query rewrite. If the materialized view meets the requirements, it must follow these rules:
NoteThis column is compatible only, and its value is NULL by default. |
| REFRESH_MODE | VARCHAR2(6) | NO | The refresh mode of the materialized view.
|
| REFRESH_METHOD | VARCHAR2(8) | NO | The default method for refreshing the materialized view (which can be overridden by an API).
|
| BUILD_MODE | VARCHAR2(9) | NO | How the materialized view is populated during creation.
|
| FAST_REFRESHABLE | VARCHAR2(18) | NO | Indicates whether the materialized view is suitable for incremental (fast) refresh.
NoteThis column is compatible only, and its value is NULL by default. |
| LAST_REFRESH_TYPE | VARCHAR2(8) | NO | The method used for the last refresh.
|
| LAST_REFRESH_DATE | DATE | YES | The date when the materialized view was last refreshed. |
| LAST_REFRESH_END_TIME | DATE | NO | The end time of the last refresh of the materialized view. |
| STALENESS | VARCHAR2(19) | NO | The relationship between the content of the materialized view and the content of the materialized view master.
NoteThis column is compatible only, and its value is NULL by default. |
| AFTER_FAST_REFRESH | VARCHAR2(19) | NO | The STALENESS value that appears when the fast refresh is applied to this materialized view. Its value is the same as that of the STALENESS column. If the value is NA, it indicates that this value is used when fast refresh is not applicable to the materialized view.
NoteThis column is compatible only, and its value is NULL by default. |
| UNKNOWN_PREBUILT | VARCHAR2(1) | NO | Indicates whether the materialized view is prebuilt.
NoteThis column is compatible only, and its value is N by default. |
| UNKNOWN_PLSQL_FUNC | VARCHAR2(1) | NO | Indicates whether the materialized view contains PL/SQL functions.
NoteThis column is compatible only, and its value is N by default. |
| UNKNOWN_EXTERNAL_TABLE | VARCHAR2(1) | NO | Indicates whether the materialized view contains external tables.
NoteThis column is compatible only, and its value is N by default. |
| UNKNOWN_CONSIDER_FRESH | VARCHAR2(1) | NO | Indicates whether the materialized view is considered fresh.
NoteThis column is for compatibility only. The default value is N. |
| UNKNOWN_IMPORT | VARCHAR2(1) | NO | Indicates whether the materialized view is imported.
NoteThis column is for compatibility only. The default value is N. |
| UNKNOWN_TRUSTED_FD | VARCHAR2(1) | NO | Indicates whether the materialized view is refreshed using trusted constraints.
NoteThis column is for compatibility only. The default value is N. |
| COMPILE_STATE | VARCHAR2(19) | NO | The validity of the materialized view relative to the objects it depends on.
NoteThis column is for compatibility only. The default value is NULL. |
| USE_NO_INDEX | VARCHAR2(1) | NO | Indicates whether the materialized view was created using the USING NO INDEX clause (Y) or using the default index (N). The USING NO INDEX clause prevents the creation of the default index.
NoteThis column is for compatibility only. The default value is Y. |
| STALE_SINCE | DATE | NO | The start time when the materialized view became stale
NoteThis column is for compatibility only. The default value is NULL. |
| NUM_PCT_TABLES | NUMBER | NO | The number of PCT base tables
NoteThis column is for compatibility only. The default value is NULL. |
| NUM_FRESH_PCT_REGIONS | NUMBER | NO | The number of fresh PCT partition regions
NoteThis column is for compatibility only. The default value is NULL. |
| NUM_STALE_PCT_REGIONS | NUMBER | NO | The number of stale PCT partition regions
NoteThis column is for compatibility only. The default value is NULL. |
| SEGMENT_CREATED | VARCHAR2(3) | NO | Indicates whether the materialized view was created using the SEGMENT CREATION DEFERRED clause.
NoteThis column is for compatibility only. The default value is NO. |
| EVALUATION_EDITION | VARCHAR2(128) | NO | The version name of the version object referenced in the expression column
NoteThis column is for compatibility only. The default value is NULL. |
| UNUSABLE_BEFORE | VARCHAR2(128) | NO | The name of the oldest version in which the stored results of the materialized view subquery can be used for query rewriting. The stored results of the materialized view data are considered unavailable in versions earlier than the specified version. If no such version is specified, this value is NULL.
NoteThis column is for compatibility only. The default value is NULL. |
| UNUSABLE_BEGINNING | VARCHAR2(128) | NO | The name of the oldest version in which the stored results of the materialized view subquery cannot be used for query rewriting. In the specified version and any of its descendants, the data cannot be used for query rewriting. If no such version is specified, this value is NULL.
NoteThis column is for compatibility only. The default value is NULL. |
| DEFAULT_COLLATION | VARCHAR2(100) | NO | The default collation for the materialized view
NoteThis column is for compatibility only. The default value is NULL. |
| ON_QUERY_COMPUTATION | VARCHAR2(1) | NO | Indicates whether the materialized view is a real-time materialized view
|
| REFRESH_DOP | NUMBER(38) | NO | The parallelism level for background refresh of the materialized view. The default value is 0.
Note
|
| DATA_SYNC_SCN | NUMBER(38) | NO | The data SCN of the materialized view.
NoteThis column is available starting with OceanBase Database V4.3.5 BP2. |
| DATA_SYNC_DELAY | VARCHAR2(128) | NO | The data synchronization delay of the materialized view, in seconds.
NoteThis column is available starting with OceanBase Database V4.3.5 BP2. |
Sample query
Query all materialized views and display the first record.
obclient [SYS]> SELECT * FROM SYS.DBA_MVIEWS WHERE ROWNUM < = 1\G
The query result is as follows:
*************************** 1. row ***************************
OWNER: SYS
MVIEW_NAME: MV_TBL1
CONTAINER_NAME: __mv_container_500033
QUERY: select "SYS"."TBL1"."COL1" AS "COL1","SYS"."TBL1"."COL2" AS "COL2" from "SYS"."TBL1" where ("SYS"."TBL1"."COL3" >= 20)
QUERY_LEN: 118
UPDATABLE: N
UPDATE_LOG: NULL
MASTER_ROLLBACK_SEG: NULL
MASTER_LINK: NULL
REWRITE_ENABLED: N
REWRITE_CAPABILITY: NULL
REFRESH_MODE: DEMAND
REFRESH_METHOD: FORCE
BUILD_MODE: IMMEDIATE
FAST_REFRESHABLE: NULL
LAST_REFRESH_TYPE: COMPLETE
LAST_REFRESH_DATE: 05-FEB-26
LAST_REFRESH_END_TIME: 05-FEB-26
STALENESS: NULL
AFTER_FAST_REFRESH: NULL
UNKNOWN_PREBUILT: N
UNKNOWN_PLSQL_FUNC: N
UNKNOWN_EXTERNAL_TABLE: N
UNKNOWN_CONSIDER_FRESH: N
UNKNOWN_IMPORT: N
UNKNOWN_TRUSTED_FD: N
COMPILE_STATE: NULL
USE_NO_INDEX: Y
STALE_SINCE: NULL
NUM_PCT_TABLES: NULL
NUM_FRESH_PCT_REGIONS: NULL
NUM_STALE_PCT_REGIONS: NULL
SEGMENT_CREATED: NO
EVALUATION_EDITION: NULL
UNUSABLE_BEFORE: NULL
UNUSABLE_BEGINNING: NULL
DEFAULT_COLLATION: NULL
ON_QUERY_COMPUTATION: N
REFRESH_DOP: 0
DATA_SYNC_SCN: 1770280407840630000
DATA_SYNC_DELAY: +000000053 03:49:29.568000000
1 row in set