Dbms_mview.refresh () function in Oracle10g

Source: Internet
Author: User
Dbms_mview.refresh (

Dbms_mview.refresh (

Dbms_mview.refresh ('table name', 'F') -- fast refresh, that is, incremental refresh
Dbms_mview.refresh ('table name', 'C') -- completely refresh
We often use materialized views to synchronize or migrate data. In the refreshing process of dbms_mview, you can use the parallel refreshing feature to effectively reduce the full refreshing time. The following is a process example:
Create materialized view log on test; -- create a materialized view log
Create table mv_test as select * fromtest @ lnk_testdb where 1 = 2; -- create the same table structure as the source table
Create materialized view mv_test on prebuilt table refresh fast
Select * fromtest @ lnk_testdb; -- create a Materialized View
Let's take a look at the meanings of common refresh process parameters:
PROCEDURE REFRESH
Argument Name Type In/Out Default?
-------------------------------------------------------------------
Tab table of VARCHAR2 (227) IN/OUT
METHOD VARCHAR2 IN DEFAULT
ROLLBACK_SEG VARCHAR2 IN DEFAULT
PUSH_DEFERRED_RPC BOOLEAN IN DEFAULT
REFRESH_AFTER_ERRORS BOOLEAN IN DEFAULT
PURGE_OPTION BINARY_INTEGER IN DEFAULT
PARALLELISM BINARY_INTEGER in default -- here is the parallel control parameter
HEAP_SIZE BINARY_INTEGER IN DEFAULT
ATOMIC_REFRESH BOOLEAN IN DEFAULT
NESTED BOOLEAN IN DEFAULT
For example, we need to refresh an mv_test Materialized View:
Begin
Dbms_mview.refresh (TAB => 'mv _ test', METHOD => 'complete', PARALLELISM => 8 );
End;
Incremental refresh does not need to use parallelism. Generally, it is unnecessary.
Begin
Dbms_mview.refresh (TAB => 'mv _ test', METHOD => 'fast ', PARALLELISM => 1 );
End;
If this parallelism parallel parameter is specified only during refresh, the parallel function cannot be enabled. The following is the original description of this document:
At the outset, it appears that the PARALLELISM parameter will invoke a parallel refresh of the materialized view. however, it doesn' t. the dynamic performance views V $ PX_PROCESS and V $ PX_SESSION provide information on the parallel execution processes and the sessions using parallel execution respectively. when the above refresh process is running, if we query these views, we will see that there are no parallel execution processes in use.
To enable parallelism during refresh, you can use the following three methods:
1. Modify the parallelism attribute of the master table
2. Create a materialized view log to define the parallelism attribute
3. When creating a materialized view, use hint

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.