oracle refresh force,Oracle -當用DBMS_MVIEW.REFRESH刷新“按需刷新”視圖時,會發生什么...

I have the following materialized view -

我有以下物化的觀點

CREATE MATERIALIZED VIEW TESTRESULT

ON PREBUILT TABLE WITH REDUCED PRECISION

REFRESH FORCE ON DEMAND

WITH PRIMARY KEY

AS

SELECT...

FROM...

WHERE...

This materialized view has no backing MATERIALIZED VIEW LOG. As seen in the clause above this MV has "ON DEMAND" specifies, and according to Oracle documentation,

這個物化視圖沒有支持物化視圖日志。正如在上面的子句中看到的,這個MV有“隨需應變”指定,並且根據Oracle文檔,

"[ON DEMAND] indicate[s] that the materialized view will be refreshed on demand by calling one of the three DBMS_MVIEW refresh procedures."

“[按需]通過調用三個DBMS_MVIEW刷新過程中的一個,表明[s]物化視圖將按需刷新。”

When I call DBMS_MVIEW.REFRESH('TESTRESULT') , what is occuring? Is it manually checking each record to see if it has been updated?

當我調用DBMS_MVIEW.REFRESH('TESTRESULT')時,發生了什么?它是否手動檢查每個記錄以查看它是否已被更新?

Oracle Version: 10g

Oracle版本:10 g

1 个解决方案

#1

6

By default (and this default changes in different versions of Oracle), that will do a full, atomic refresh on the materialized view. That means that the data in the materialized view will be deleted, the underlying query will be re-executed, and the results will be loaded into the materialized view. You can make the refresh more efficient by passing in a value of FALSE for the ATOMIC_REFRESH parameter, i.e.

默認情況下(以及在不同版本的Oracle中發生的缺省更改),將對物化視圖執行完整的原子刷新。這意味着在物化視圖中的數據將被刪除,基礎查詢將被重新執行,結果將被加載到物化視圖中。您可以通過為ATOMIC_REFRESH參數傳遞一個FALSE值來提高刷新的效率,例如。

dbms_mview.refresh( 'TESTRESULT', atomic_refresh => false );

That will cause the materialized view to be truncated, the query re-executed, and the results inserted into the materialized view via a direct path insert. That will be more efficient than an atomic refresh but the materialized view will be empty during the refresh.

這將導致物化視圖被截斷、查詢被重新執行,並通過直接路徑插入將結果插入物化視圖。這比原子刷新更有效,但在刷新期間物化視圖將為空。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值