Note
This view is available starting with V4.3.0.
Purpose
The USER_MVIEWS view displays information about materialized views.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | YES | The name of the owner of the materialized view. |
| 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. Valid values:
NoteThis column is retained for compatibility and its value is N by default. |
| UPDATE_LOG | VARCHAR2(128) | NO | The name of the update log file for an updatable materialized view.
NoteThis column is retained for compatibility 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 retained for compatibility 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 retained for compatibility and its value is NULL by default. |
| REWRITE_ENABLED | VARCHAR2(1) | NO | Indicates whether query rewrite is enabled. Valid values:
|
| REWRITE_CAPABILITY | VARCHAR2(9) | NO | Indicates whether the materialized view meets the requirements for query rewrite. Valid values:
NoteThis column is retained for compatibility and its value is NULL by default. |
| REFRESH_MODE | VARCHAR2(6) | NO | The refresh mode of the materialized view. Valid values:
|
| REFRESH_METHOD | VARCHAR2(8) | NO | The default method used to refresh the materialized view. This value can be overridden by using an API. Valid values:
|
| BUILD_MODE | VARCHAR2(9) | NO | The method used to populate the materialized view during creation. Valid values:
|
| FAST_REFRESHABLE | VARCHAR2(18) | NO | Indicates whether the materialized view is suitable for incremental (fast) refresh. Valid values:
NoteThis column is retained for compatibility and its value is NULL by default. |
| LAST_REFRESH_TYPE | VARCHAR2(8) | NO | The method used for the last refresh. Valid values:
|
| 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. Valid values:
NoteThis column is retained for compatibility and its value is NULL by default. |
| AFTER_FAST_REFRESH | VARCHAR2(19) | NO | The STALENESS value that appears after the 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 indicates that the value is used when fast refresh is not applicable to the materialized view.
NoteThis column is retained for compatibility and its value is NULL by default. |
| UNKNOWN_PREBUILT | VARCHAR2(1) | NO | Indicates whether the materialized view is prebuilt. Valid values:
NoteThis column is retained for compatibility and its value is N by default. |
| UNKNOWN_PLSQL_FUNC | VARCHAR2(1) | NO | Indicates whether the materialized view contains PL/SQL functions. Valid values:
NoteThis column is retained for compatibility and its value is N by default. |
| UNKNOWN_EXTERNAL_TABLE | VARCHAR2(1) | NO | Indicates whether the materialized view contains external tables. Valid values:
NoteThis column is retained for compatibility and its value is N by default. |
| UNKNOWN_CONSIDER_FRESH | VARCHAR2(1) | NO | Indicates whether the materialized view is considered fresh.
NoteThis column is available only for compatibility and defaults to N. |
| UNKNOWN_IMPORT | VARCHAR2(1) | NO | Indicates whether the materialized view is imported.
NoteThis column is available only for compatibility and defaults to N. |
| UNKNOWN_TRUSTED_FD | VARCHAR2(1) | NO | Indicates whether the materialized view is refreshed using trusted constraints.
NoteThis column is available only for compatibility and defaults to N. |
| COMPILE_STATE | VARCHAR2(19) | NO | The validity of the materialized view relative to the objects it depends on.
NoteThis column is available only for compatibility and defaults to 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 available only for compatibility and defaults to Y. |
| STALE_SINCE | DATE | NO | The start time when the materialized view became stale.
NoteThis column is available only for compatibility and defaults to NULL. |
| NUM_PCT_TABLES | NUMBER | NO | The number of PCT base tables.
NoteThis column is available only for compatibility and defaults to NULL. |
| NUM_FRESH_PCT_REGIONS | NUMBER | NO | The number of fresh PCT partition regions.
NoteThis column is available only for compatibility and defaults to NULL. |
| NUM_STALE_PCT_REGIONS | NUMBER | NO | The number of stale PCT partition regions.
NoteThis column is available only for compatibility and defaults to NULL. |
| SEGMENT_CREATED | VARCHAR2(3) | NO | Indicates whether the materialized view was created using the SEGMENT CREATION DEFERRED clause.
NoteThis column is available only for compatibility and defaults to NO. |
| EVALUATION_EDITION | VARCHAR2(128) | NO | The version name of the version object referenced in the expression column.
NoteThis column is available only for compatibility and defaults to 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. In versions earlier than the specified version, the stored results of the materialized view data are considered unavailable. If no such version is specified, this value is NULL.
NoteThis column is available only for compatibility and defaults to 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 available only for compatibility and defaults to NULL. |
| DEFAULT_COLLATION | VARCHAR2(100) | NO | The default collation of the materialized view.
NoteThis column is available only for compatibility and defaults to 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.USER_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: +000061787 05:15:05.788800000
1 row in set
