Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Materialized View Needing to be Refreshed
All,
All of these replies were perfect! I got what I wanted from you all and fashioned a report to run to help us understand what MV's need refreshing.
Thanks again
Tom
From: Jared Still [mailto:jkstill_at_gmail.com]
Sent: Friday, January 19, 2007 1:06 PM
To: Mercadante, Thomas F (LABOR)
Subject: Re: Materialized View Needing to be Refreshed
On 1/19/07, Mercadante, Thomas F (LABOR) <Thomas.Mercadante_at_labor.state.ny.us> wrote:
I have a table with MV logs in a source database. Two other databases have created MV's based on this table. Is there some way to determine which database needs to refresh their MV so that all of the MV logs will be cleared?
Hi Tom,
The keys to determining which snapshots need refreshed are found in the DBA_SNAPSHOT_LOGS view on the destination site, and the sys.snap$ table on the source sites.
The DBA_SNAPSHOT_LOGS view contains the SNAPSHOT_ID column, which you won't find anywhere else.
On the destination site:
select
log_owner
,master
,log_table
,snapshot_id
,to_char(current_snapshots,'mm/dd/yyyy hh24:mi:ss') current_snapshots
from dba_snapshot_logs
order by 1
On the source sites, this will get the snap_id the MV's:
select sowner,vname,tname, snapid
from sys.snap$
/
This is easiest to test by creating a table and 2 MV's on a single database, and running these queries.
Attached are some notes I made last year while playing with MV's.
HTH,
-- Jared Still Certifiable Oracle DBA and Part Time Perl Evangelist -- http://www.freelists.org/webpage/oracle-lReceived on Fri Jan 19 2007 - 13:59:24 CST
![]() |
![]() |