ORACLE:物化视图 - 更改 START WITH CLAUSE

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1322859/
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-10 02:06:54  来源:igfitidea点击:

ORACLE : Materialized view- change START WITH CLAUSE

oracleviewmaterialized

提问by ddallala

I created a Materialized view using the following code:

我使用以下代码创建了一个物化视图:

CREATE MATERIALIZED VIEW M_USER_HIERARCHY 

BUILD IMMEDIATE
REFRESH COMPLETE
START WITH TO_DATE('25-Aug-2009 10:34:24','dd-mon-yyyy hh24:mi:ss')
NEXT SYSDATE + 1     
WITH PRIMARY KEY
AS 
SELECT   * FROM V_USER_HIERARCHY;

However, I want to be able to change the START WITH date AFTER this code has been executed. I have been looking into the ALL_MVIEW_* tables but could not find where the setting for the START_DATE is.

但是,我希望能够在执行此代码后更改 START WITH 日期。我一直在查看 ALL_MVIEW_* 表,但找不到 START_DATE 的设置位置。

Does anyone know how to change the START_WITH date of a Materialized View ?

有谁知道如何更改物化视图的 START_WITH 日期?

回答by APC

It's really quite straightforward.

这真的很简单。

SQL> create materialized view emp_data
  2  as select * from emp
  3  /

Materialized view created.

SQL> ALTER MATERIALIZED VIEW emp_data
  2     REFRESH COMPLETE
  3     START WITH TRUNC(SYSDATE+1) + 12/24
  4     NEXT SYSDATE+1
  5  /

Materialized view altered.

SQL>