这些视图中记录了每个物化视图上次执行刷新操作的时间,并且给出每个物化视图中的数据是否是和基表同步的。由于MV_T_ID刚刚进行了刷新,因此状态是FRESH,而另外两个由于在刷新(建立)之后,基表又进行了DML操作,因此状态为NEEDS_COMPILE。如果这时对基表进行DML操作,则MV_T_ID的状态也会变为NEEDS_COMPILE。
zx@ORA11G>insert into t values (4, 'zf', 'sd');
1 row created.
zx@ORA11G>commit;
Commit complete.
zx@ORA11G>select mview_name,last_refresh_date, staleness from user_mviews;
MVIEW_NAME LAST_REFRESH_DATE STALENESS
------------------------------ ----------------- -------------------
MV_T_BOTH 20170809 15:45:10 NEEDS_COMPILE
MV_T_ID 20170809 15:58:30 NEEDS_COMPILE
MV_T_NAME 20170809 15:45:05 NEEDS_COMPILE
zx@ORA11G>select * from mlog$_t;
ID NAME M_ROW$$ SEQUENCE$$ SNAPTIME$$ D O CHANGE_VECTOR$$ XID$$
-------------------- ---------- ------------------------------ -------------------- ----------------- - - ------------------------------ --------------------
1 zx AAAVs6AAEAAAAJVAAA 8 20170809 15:58:30 I N FE 2814882911093459
2 wl AAAVs6AAEAAAAJVAAB 9 20170809 15:58:30 I N FE 2814882911093459
3 yc AAAVs6AAEAAAAJVAAC 10 20170809 15:58:30 I N FE 2814882911093459
3 yc AAAVs6AAEAAAAJVAAC 11 20170809 15:58:30 U U 08 2814882911093459
3 yc AAAVs6AAEAAAAJVAAC 12 20170809 15:58:30 U N 08 2814882911093459
2 wl AAAVs6AAEAAAAJVAAB 13 20170809 15:58:30 D O 00 2814882911093459
4 zf AAAVs6AAEAAAAJVAAD 14 40000101 00:00:00 I N FE 844463584838593