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

时间:2009-08-24 14:51:20

标签: oracle view materialized

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

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;

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

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

1 个答案:

答案 0 :(得分:7)

这真的很简单。

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>