5

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

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 日期?

4

1 回答 1

8

这真的很简单。

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>
于 2009-08-24T15:00:12.603 回答