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 materialized view owner. |
| MVIEW_NAME | VARCHAR2(128) | YES | The name of the materialized view. |
| CONTAINER_NAME | VARCHAR2(128) | YES | The name of the materialized view container table. |
| 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 for updatable materialized views.
NoteThis column is compatible only and defaults to NULL. |
| MASTER_ROLLBACK_SEG | VARCHAR2(128) | NO | The rollback segment for the master site or master materialized view site.
NoteThis column is compatible only and defaults to NULL. |
| MASTER_LINK | VARCHAR2(128) | NO | The database link for the master site or 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 it does, the following rules apply:
NoteThis column is compatible only and defaults to NULL. |
| REFRESH_MODE | VARCHAR2(6) | NO | The refresh mode for the materialized view.
|
| REFRESH_METHOD | VARCHAR2(8) | NO | The default method for refreshing the materialized view (can be overridden via 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 fast (incremental) refresh.
NoteThis column is compatible only and defaults to 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 its master view.
NoteThis column is compatible only and defaults to NULL. |
| AFTER_FAST_REFRESH | VARCHAR2(19) | NO | The STALENESS value that will appear after a fast refresh is applied to this materialized view. The values are the same as those in the STALENESS column. If the value is NA, it indicates that this value is used when a fast refresh is not applicable to the 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 | 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 by 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 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 for compatibility only. The default value is Y. |
| STALE_SINCE | DATE | NO | The start time when the materialized view becomes 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 the latest 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 is created by 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. 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 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 all 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.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