Neoview SQL Reference Manual (R2.4 SP2)

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. See “Database Object Names” (page 230).
The REFRESH utility can be applied to both incremental materialized views (MVs) and
recomputed MVs. The REFRESH utility optimizes the refresh of MVGROUP.
NOTE: 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, the second
refresh affects all the MVs. 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 you 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 “CREATE MATERIALIZED VIEW
Statement” (page 63).
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;
MAINTAIN Command 215