Note
This view is available starting with V4.3.0.
Purpose
The ALL_MVIEWS view displays information about 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 defaults to N. |
| UPDATE_LOG | VARCHAR2(128) | NO | The name of the update log file for updatable materialized views.
NoteThis column is compatible only and defaults to NULL. |
| 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 defaults to NULL. |
| MASTER_LINK | VARCHAR2(128) | NO | The database link of the master site or the master materialized view site.
NoteThis column is compatible only and defaults to 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 compatible only and defaults to 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 compatible only and defaults to NULL. |
| LAST_REFRESH_TYPE | VARCHAR2(8) | NO | The method used for the most recent refresh.
|
| LAST_REFRESH_DATE | DATE | YES | The date of the most recent refresh of the materialized view. |
| LAST_REFRESH_END_TIME | DATE | NO | The end time of the most recent 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 defaults to NULL. |
| AFTER_FAST_REFRESH | VARCHAR2(19) | NO | The STALENESS value that appears when a fast refresh is applied to this materialized view. The value is the same as that of the STALENESS column. If the value is NA, it is used when fast refresh is not applicable to this materialized view.
NoteThis column is compatible only and defaults to NULL. |
| UNKNOWN_PREBUILT | VARCHAR2(1) | NO | Indicates whether the materialized view is prebuilt.
NoteThis column is compatible only and defaults to N. |
| UNKNOWN_PLSQL_FUNC | VARCHAR2(1) | NO | Indicates whether the materialized view contains PL/SQL functions.
NoteThis column is compatible only and defaults to N. |
| UNKNOWN_EXTERNAL_TABLE | VARCHAR2(1) | NO | Indicates whether the materialized view contains external tables.
NoteThis column is compatible only and defaults to N. |
| UNKNOWN_CONSIDER_FRESH | VARCHAR2(1) | NO | Whether the materialized view is considered fresh
NoteThis column is compatible only, and the default value is N. |
| UNKNOWN_IMPORT | VARCHAR2(1) | NO | Whether the materialized view is imported
NoteThis column is compatible only, and the default value is N. |
| UNKNOWN_TRUSTED_FD | VARCHAR2(1) | NO | Whether the materialized view is refreshed by using trusted constraints
NoteThis column is compatible only, and 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 compatible only, and the default value is NULL. |
| USE_NO_INDEX | VARCHAR2(1) | NO | Whether the materialized view is created by using the USING NO INDEX clause (Y) or the default index (N). The USING NO INDEX clause prevents the creation of the default index.
NoteThis column is compatible only, and the default value is Y. |
| STALE_SINCE | DATE | NO | The start time when the materialized view becomes stale
NoteThis column is compatible only, and the default value is NULL. |
| NUM_PCT_TABLES | NUMBER | NO | The number of PCT base tables
NoteThis column is compatible only, and the default value is NULL. |
| NUM_FRESH_PCT_REGIONS | NUMBER | NO | The number of fresh PCT partition regions
NoteThis column is compatible only, and the default value is NULL. |
| NUM_STALE_PCT_REGIONS | NUMBER | NO | The number of stale PCT partition regions
NoteThis column is compatible only, and the default value is NULL. |
| SEGMENT_CREATED | VARCHAR2(3) | NO | Whether the materialized view is created by using the SEGMENT CREATION DEFERRED clause.
NoteThis column is compatible only, and the default value is NO. |
| EVALUATION_EDITION | VARCHAR2(128) | NO | The name of the version object referenced in the expression column
NoteThis column is compatible only, and 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 compatible only, and 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 compatible only, and the default value is NULL. |
| DEFAULT_COLLATION | VARCHAR2(100) | NO | The default collation of the materialized view
NoteThis column is compatible only, and the default value is NULL. |
| ON_QUERY_COMPUTATION | VARCHAR2(1) | NO | 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
Query the information of the materialized view and display the first record.
obclient [SYS]> SELECT * FROM SYS.ALL_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: +000061498 05:15:05.788800000
1 row in set