1. On demand: Use the stored procedures in the Dbms_mview package to enable manual refresh (default setting) refresh [Fast|complete|force] View refreshes: Complete: Refresh all. A query statement that is equivalent to performing a new view creation. Fast: Incremental Refresh. Assuming the previous refresh time is T1, when refreshing the materialized view using the fast mode, only add T1 to the view to the current time period, the master table has changed. To record this change, an materialized view Log table is also required to establish an incremental refresh materialized view. Create materialized view Log on (the primary table name). (This statement also takes effect when multiple tables are created, and there are two categories of visual charts in the original table: Mlog$_table_name and Rupd$_table_name) force: This is the default way to refresh data. When you can use fast mode, the data refresh will be in fast mode; otherwise, use the complete method.
2. On commit: Refresh after transaction commits
Use of
⑴ materialized views for quick refresh only
⑵ requires on commit to refresh object permissions
⑶ If a refresh failure requires manual refresh
3. Never: Disable materialized view refresh
Refresh at scheduled time: using the start with and next options. Refreshes at intervals (specified by next), starting at a specified time; For example, we're going to flush a full mv_test materialized view: Begin
Dbms_mview.refresh (tab=> ' mv_test ',
Method=> ' COMPLETE ',
PARALLELISM=>8);
End
/incremental refreshes do not need to use what parallelism, usually, is not necessary. Begin
Dbms_mview.refresh (tab=> ' mv_test ',
Method=> ' FAST ',
PARALLELISM=>1);
End
/Alternatively, this can also be done: exec dbms_mview.refresh (' mv_test ', ' F ');
Create matherialized View Emp_data
Pctfree 5
tablespace Example
Storage (initial 50K next 50K)
Refresh Fast Next Sysdate + 7
As SELECT ...;
Create matherialized View Emp_data
Pctfree 5
tablespace Example
Using index storage (initial 25K next 25K)
Refresh start with round (Sysdate + 1) + 11/24
Next Next_day (Trunc (sysdate), ' MONDAY ') + 15/24
As SELECT * FROM Sh.customers@remote Union
SELECT * from Sh.customers@local;