SQL> select owner,mview_name,LAST_REFRESH_DATE,STALENESS,MASTER_LINK,REFRESH_MODE,REFRESH_METHOD from all_mviews;

OWNER      MVIEW_NAME LAST_REFRESH_DATE   STALENESS           MASTER_LIN REFRES REFRESH_
---------- ---------- ------------------- ------------------- ---------- ------ --------
TESTER     T1MV       2012-09-02 20:46:04 UNDEFINED           @NEWDB.MDU DEMAND FAST
TESTER     T2MV       2012-09-02 20:44:26 UNDEFINED           @NEWDB.MDU DEMAND FORCE

SQL> exec dbms_refresh.refresh('mvadmin.rep_refresh');

PL/SQL procedure successfully completed.

SQL> select owner,mview_name,LAST_REFRESH_DATE,STALENESS,MASTER_LINK,REFRESH_MODE,REFRESH_METHOD from all_mviews;

OWNER      MVIEW_NAME LAST_REFRESH_DATE   STALENESS           MASTER_LIN REFRES REFRESH_
---------- ---------- ------------------- ------------------- ---------- ------ --------
TESTER     T1MV       2012-09-02 20:47:23 UNDEFINED           @NEWDB.MDU DEMAND FAST
TESTER     T2MV       2012-09-02 20:44:26 UNDEFINED           @NEWDB.MDU DEMAND FORCE

 

最后居然发现是由于tester.t2mv没有被加入到刷新组rep_refresh,在将其加入到刷新组之后,一切都正常了。

加入到刷新组:

BEGIN
DBMS_REFRESH.ADD (
name => 'mvadmin.rep_refresh',
list => 'tester.t2mv',
lax => TRUE);
END;
/

刷新刷新组:

SQL> exec dbms_refresh.refresh('"MVADMIN"."REP_REFRESH"');

PL/SQL procedure successfully completed.

查看两个视图的刷新时间,发现是一致的了。

SQL> select owner,mview_name,LAST_REFRESH_DATE,STALENESS from all_mviews;

OWNER                          MVIEW_NAME                     LAST_REFRESH_DATE   STALENESS
------------------------------ ------------------------------ ------------------- -------------------
TESTER                         T1MV                           2012-09-03 10:36:01 UNDEFINED
TESTER                         T2MV                           2012-09-03 10:36:01 UNDEFINED