mv complate刷新时使用DELETE OR TRUNCATE!

本文探讨了在使用dbms_mview.refresh函数刷新多个Materialized Views时,如何正确使用Truncate操作。讨论了在不同设置下atomic_refresh与Truncate的关系,并提供了实例说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

You Asked

I am seeing that when I use the dbms_mview.refresh function to refresh a group of Materialized Views, that the view contents are deleted. I have also seen that if I set atomic_refresh to False, that Truncate should be used. In reading the description of atomic_refresh indicates whether the group of MV's is refresh together or as independent refreshes. It does not discuss 'Delete' vs 'Truncate'.

My situation is that I have several MV's that are quite large and would prefer to refresh them using Truncate.

My question, If I provide a list of MV's to the dbms_mview.refresh function, what is the use of Truncate, based on the setting of atomic_refresh? Or, should I be doing something else to ensure that Truncate is used?
[@more@]

and we said...

http://asktom.oracle.com/pls/ask/search?p_string=%22atomic_refresh%22



we've talked about this a couple of times.


If you "have several MV's that are quite large and would prefer to refresh them using Truncate", in 10g and above you would use atomic_refresh=>FALSE

that permits us to user

truncate+insert/*+APPEND*/

to rebuild the MV (the MV disappears for a while, becomes empty - you have to expect that)

else, if atomic_refresh=>TRUE, we use

delete+insert

to rebuild the MV (the MV never disappears, transactional consistency is there)



If you use a list like mv1,mv2... - and atomic_refresh=>FALSE, it'll use truncate+insert/*+Append*/ on them in turn.

引自:http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1857127200346321681

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10130206/viewspace-1056922/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10130206/viewspace-1056922/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值