Materialized Views - Identifying the last refresh Materialized Views - Identifying the last refresh oracle oracle

Materialized Views - Identifying the last refresh


It looks like doc_180 already answered this in the comments, I'm not sure why it didn't get added as the answer

SELECT owner, mview_name, last_refresh_date  FROM all_mviews WHERE owner = <<user that owns the materialized view>>   AND mview_name = <<name of the materialized view>>

If you have access to the DBA tables, you could substitute DBA_MVIEWS for ALL_MVIEWS. That would allow you to get access to information about when every materialized view was refreshed rather than just the subset of materialized views that you have access to. Of course, that's probably not a difference that is particularly important in this case.


Unfortunately oracles default date format is YYYY-MM-DD. If you need the timejust use something like this:

SELECT owner, mview_name, to_char(LAST_REFRESH_DATE, 'yyyy-mm-dd hh24:mi:ss') last_refresh_dateFROM all_mviewsWHERE owner = 'FOO'AND mview_name = 'MV_BAR';


Personally i use the all_snapshots, and this information is complementary to the information of the DBA_MVIEWS or ALL_MVIEWS

select owner, name, last_refresh, error, status, refresh_mode  from  all_snapshots where owner = 'owner';