Oracle - 更新物化视图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6098104/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 23:44:42  来源:igfitidea点击:

Oracle - Updating Materialized Views

oracleoracle10gmaterialized-views

提问by contactmatt

How can I update a materialized view? Is there any downside to updating materialized views? I'm in a situation where I can either

如何更新物化视图?更新物化视图有什么缺点吗?我处于一种情况,我可以

  1. Update the materialized view (OR)
  2. Copy the records to another table, update them, truncate or drop the materialized view table, insert the updated records back into the materialized view.
  1. 更新物化视图 (OR)
  2. 将记录复制到另一个表,更新它们,截断或删除物化视图表,将更新的记录插入回物化视图。

These two options revolve around the long amount of time required to rebuild the materialized view (literally 5+ days).

这两个选项围绕重建物化视图所需的大量时间(字面意思是 5 天以上)而展开。

Version : Oracle 10g

版本:Oracle 10g

采纳答案by ik_zelf

The intention of a materialized view is to store the results of some complex long running query that the query rewrite mechanism can use to save lots of time. It looks like the sql that is used to build the MV needs some tweeking.

物化视图的目的是存储一些复杂的长时间运行查询的结果,查询重写机制可以使用这些结果来节省大量时间。看起来用于构建 MV 的 sql 需要一些 tweeking。

You cannot update an MV, unless you meant doing a full/fast refresh/rebuild.

您不能更新 MV,除非您打算进行完整/快速刷新/重建。

What is eating the time in during the MV refresh? Did you check the addm reports? Did you configure full or fast refreshes?

MV刷新期间吃的时间是什么?你检查过addm报告吗?您是否配置了完全刷新或快速刷新?