ITPub博客

首页 > 数据库 > Oracle > mv complate刷新时使用DELETE OR TRUNCATE!

mv complate刷新时使用DELETE OR TRUNCATE!

原创 Oracle 作者:qqmengxue 时间:2011-12-22 12:00:12 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/10130206/viewspace-1056922/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 提取rpm文件内容
请登录后发表评论 登录
全部评论

注册时间:2009-03-26

  • 博文量
    169
  • 访问量
    589147