Wednesday, May 23, 2007

Mview log is not purged

Today during analyze the growing trend of one tablespace and noticed that the biggest segment is a materialized view log. What a big size ! 7Gb , while the master table is only 21Mb.

After do some research, suspected this could be an orphan mview log from previous upgrade.

Key tables to lookup for investigation are:
master_owner.mlog$_master_table (snaptiem$$)
sys.slog$ (snaptime and snapid)
dba_regestered_mviews(mview_id)
dba_rgroups, dba_refresh_children( for those using refresh group)

Q:When mivew log is purged?
A: Only when all regiested mviews are refreshed, i.e check that all sys.slog$.snaptime are equal or before
master_owner.mlog$_master_table.snaptime$$


From this practice, I also learned that if the refresh method is complete, no mview log is required.