Is it possible to partially refresh a materialized view in Oracle?

我只是一个虾纸丫 提交于 2019-12-01 03:06:30
Conrad

Partition by date as in answer 3 (skaffman).

You could just do the refresh of a normal mv(table_refreshed below) and than use the exchange keyword i.e.

ALTER TABLE all_partitions
  EXCHANGE PARTITION to_calculate
  WITH TABLE table_refreshed
  WITHOUT VALIDATION
  UPDATE GLOBAL INDEXES;
Galghamon

After more reading and judging by the lack of answers to this question, I come come to the conclusion that it is not possible to refresh a single partition of a materialized view.

If you can give a syntax example that proves otherwise, I will happily mark your answer the accepted one.

To others who might find this questions useful in the future: you might also want to know that in Oracle 10g, refreshing a partition (or any mview) will cause Oracle to issue DELETE, followed by INSERT.

If this is giving you performance problems (like me), there is an option to use atomic_refresh => false, which will TRUNCATE, then INSERT /*+APPEND*/.

Visitor

I have been able to refresh a single partition of a materialized view with partition change tracking.

It seems to require that the view is created with REFRESH FAST WITH ROWID option and DBMS_MVIEW.REFRESH is called with 'P' method.

You can partition materialized views just as you can with normal tables. Partition your mview by date, and then you can refresh only the required partition.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!