Note
This view is available starting with V4.3.0.
Purpose
The DBA_MVIEWS view displays 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 only compatible and the default value is N. |
| UPDATE_LOG | VARCHAR2(128) | NO | The name of the update log file for an updatable materialized view.
NoteThis column is only compatible and the default value is NULL. |
| MASTER_ROLLBACK_SEG | VARCHAR2(128) | NO | The rollback segment of the master site or the master materialized view site.
NoteThis column is only compatible and the default value is NULL. |
| MASTER_LINK | VARCHAR2(128) | NO | The database link of the master site or the master materialized view site.
NoteThis column is only compatible and the default value is NULL. |
| REWRITE_ENABLED | VARCHAR2(1) | NO | Indicates whether rewrite is enabled.
|
| REWRITE_CAPABILITY | VARCHAR2(9) | NO | Indicates whether the materialized view meets the conditions for rewrite. If yes, the following rules must be followed:
NoteThis column is only compatible and the default value is NULL. |
| REFRESH_MODE | VARCHAR2(6) | NO | The refresh mode of the materialized view.
|
| REFRESH_METHOD | VARCHAR2(8) | NO | The default method used to refresh 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 only compatible and the default value is NULL. |
| 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 only compatible and the default value is NULL. |
| AFTER_FAST_REFRESH | VARCHAR2(19) | NO | The STALENESS value that will appear after a fast refresh is applied to this materialized view. It has the same values as 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 only compatible and the default value is NULL. |
| UNKNOWN_PREBUILT | VARCHAR2(1) | NO | Indicates whether the materialized view is prebuilt.
NoteThis column is only compatible and the default value is N. |
| UNKNOWN_PLSQL_FUNC | VARCHAR2(1) | NO | Indicates whether the materialized view contains PL/SQL functions.
NoteThis column is only compatible and the default value is N. |
| UNKNOWN_EXTERNAL_TABLE | VARCHAR2(1) | NO | Indicates whether the materialized view contains external tables.
NoteThis column is only compatible and the default value is N. |
| 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 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 of 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 of the 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
obclient [SYS]> SELECT * FROM SYS.DBA_MVIEWS WHERE ROWNUM < = 1\G
The query result is as follows:
*************************** 1. row ***************************
OWNER: SYS
MVIEW_NAME: MV1_TBL3_TBL4
CONTAINER_NAME: MV1_TBL3_TBL4
QUERY: select "SYS"."TBL3"."ID" AS "ID1","SYS"."TBL4"."ID" AS "ID2","SYS"."TBL3"."NAME" AS "NAME","SYS"."TBL4"."AGE" AS "AGE" from "SYS"."TBL3","SYS"."TBL4" where ("SYS"."TBL3"."ID" = "SYS"."TBL4"."ID")
QUERY_LEN: 195
UPDATABLE: N
UPDATE_LOG: NULL
MASTER_ROLLBACK_SEG: NULL
MASTER_LINK: NULL
REWRITE_ENABLED: N
REWRITE_CAPABILITY: NULL
REFRESH_MODE: DEMAND
REFRESH_METHOD: COMPLETE
BUILD_MODE: IMMEDIATE
FAST_REFRESHABLE: NULL
LAST_REFRESH_TYPE: COMPLETE
LAST_REFRESH_DATE: 22-APR-25
LAST_REFRESH_END_TIME: 22-APR-25
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: 1745315408781183000
DATA_SYNC_DELAY: +000061142 05:15:05.788800000
1 row in set