ORACLE quick way to refresh materialized views (11g)

Source: Internet
Author: User

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.