Maintain Mvgroup; Examples Of Maintain - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

MAINTAIN MVGROUP

MAINTAIN MVGROUP mvgroupname, REFRESH mv-refresh-option
mv-refresh-option is:
[RECOMPUTE | CANCEL]
[{WITH | WITHOUT |DO ONLY} MVLOG CLEANUP
mvgroupname
is the ANSI name of the materialized view group to be maintained. It can be a one or two-part
name.
The REFRESH utility can be applied to both incremental MVs and recomputed MVs. The
REFRESH utility optimizes the refresh of MVGROUP. HP recommends that you gather all the
MVs to refresh at a specific time into one group and refresh them together.
If for any reason the refresh of some MVs in the MVGROUP fails, the utility reports the failures.
In case of partial failure, you can refresh either the whole MV group or specific MVs again. If
the base tables did not change since the last attempt to refresh, no performance penalty is incurred.
In an environment where updates happen continuously, all the MVs are affected by the second
refresh. Refreshing individual MVs out of group context might lead to a state where different
MVs in the group are not in sync with each other.
RECOMPUTE
when used, the MVs in the MVGROUP are cleared and repopulated from scratch. Contrast
this with incremental refresh when the RECOMPUTE option is not used. In this case, only
changes since the last refresh are applied.
CANCEL
helps recover from failure situations. In certain cases, reissuing the MAINTAIN operation
may not work. For example, when the system has a disk space issue and the MAINTAIN
operation keeps failing due to insufficient disk space. In such a case, the operation is canceled
and resources are freed up until the bigger issue is resolved.
MVLOG CLEANUP
gives control over cleaning the table logs from entries that are no longer needed. The default
option is WITH MVLOG CLEANUP, where the logs are cleaned at the end of the refresh. If you
want to run the log cleanup outside the refresh window, specify WITHOUT MVLOG CLEANUP
and invoke the utility again with DO ONLY MVLOG CLEANUP outside the refresh window.
This option gives you control over when you clear the logs.
Note that if an ON REQUEST MV is not refreshed, the data in the log tables of the base table
is accumulated and cannot be cleaned up. This is also true for ON REQUEST MVs that were
created but not yet initialized.
For additional information on materialized views, see
Statement" (page

Examples of MAINTAIN

Displays all tasks that are done on table t1_090:
maintain table t1_090, all, display;
Displays all tasks that are done on table t1_090 but shows the actual execution:
maintain table t1_090, all;
Refreshes mvgroup MVG_090:
maintain mvgroup MVG_090, refresh;
Reorganizes index T1_090_2:
maintain index T1_090_2, reorg;
Shows the internal SQL statements that will be used for each task:
184
SQL Utilities
60).
"CREATE MATERIALIZED VIEW

Advertisement

Table of Contents
loading

Table of Contents