>>
SbhOracle

Latest Post

Query materialized view refresh timestamp

Unlike my lengthy posts, this is really a quick one.

Alright, so how do you get to know when your materialized view got refreshed? Well, no biggies. There are bunch of dictionary views who capture refresh date but none of them give you timestamp. For fast refresh, you can work with SCN or timestamp based MView logs but for complete refresh M-views, this can be tricky and here is a quick easy solution to retrieve timestamp information.

You can query ALL_MVIEW_ANALYSIS dictionary view that captures System change number (SCN) of the last refresh operation (i.e start refresh time). Use SCN_TO_TIMESTAMP function to translate SCN into timestamp. Here is the query –

SELECT owner,
mview_name,
last_refresh_scn,
SCN_TO_TIMESTAMP (last_refresh_scn) refresh_timestamp
FROM all_mview_analysis
WHERE mview_name = <>;

Try it yourself. I recommend this dictionary table as it also lets you know the time taken in fast or full refresh (FULLREFRESHTIM/INCREFRESHTIM). Don’t miss this nice article “How long did Oracle materialized view refresh run?” by Ittichai C.

Saurabh K. Gupta

Saurabh K. Gupta

Database Enthusiast, Author, Speaker and blogger

View Full Profile →

Twitter Profile

Advanced Oracle PL/SQL Developer’s Guide – Second Edition

Advanced Oracle PL/SQL Developer's Guide - Second Edition

Oracle Advanced PL/SQL Developer Professional Guide

Oracle Advanced PL/SQL Developer Professional Guide

Disclaimer

SBHOracle is an independent blog and all the posts are based on my self experience and hands on with the technologies. It shares no relations with any of my current projects or from those in the past.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 742 other followers

SbhOracle Blog stats

  • 67,343 hits
Aggregated by OraNA
%d bloggers like this: