For a DB2 on z/OS Materialized Query Table, how can you retrieve the last refresh time?
The documentation states that one of the actions that DB2 takes during a REFRESH is to populate the catalog with a refresh timestamp.
- Updates the DB2 catalog with a refresh timestamp and the cardinality of the materialized query table
What catalog table and column holds this information?
I was looking for this in order to compare the time stamp with another resource to see if it has changed since the last refresh. If the other resource has changed since the last refresh, the MQT must be refreshed.
You can find the last refresh timestamp in the REFRESH_TIME column on the table SYSIBM.SYSVIEWS
You could use the following SQL to retrieve the last refresh timestamp for a specific table:
SELECT REFRESH_TIME
FROM SYSIBM.SYSVIEWS
WHERE NAME = ?
AND CREATOR = ?
AND TYPE = 'M'
See the IBM documentation for the SYSIBM.SYSVIEWS table for more information.
来源:https://stackoverflow.com/questions/26122543/how-to-get-db2-mqt-last-refresh-time