By Dawson Williams and Paul McWilliams.
Starting in function level 507 of Db2 13 for z/OS (available with the PTF for APAR PH64907), Db2 for z/OS database administrators (DBAs) can rely on the LASTUSED column in the SYSIBM.SYSPLAN catalog table to determine when application plans were last used. This enhancement enables DBAs to efficiently identify application plans to rebind before a Db2 version migration, to avoid contention from post-migration autobinds, and to identify long-unused older application plans that are candidates to be freed.
When you activate function level 507 or higher in Db2 13, Db2 starts populating the SYSPLAN.LASTUSED column when a plan is created or after it is used. The LASTUSED value is set to '0001-01-01' when an application plan is created, and the value is updated within 24 hours after the plan is used when real-time statistics (RTS) are enabled in the Db2 subsystem, which means that the DISABLE_EDMRTS subsystem parameter is set to its default value NO.
The DISABLE_EDMRTS value controls externalization of RTS from the environmental descriptor manager, and it already controls population of the LASTUSED columns in the SYSIBM.SYSPACKAGE and SYSIBM.SYSDYNQUERY catalog tables. Collection of the EDM RTS is enabled when the DISABLE_EDMRTS is set to NO. The externalization interval for EDM RTS in general, and thus also for the LASTUSED column values, is controlled by the value of the STATSINT subsystem parameter.
Db2 preserves the existing SYSPLAN.LASTUSED value for the following situations:
- BIND PLAN commands with the REPLACE option
- All REBIND PLAN commands
- Automatic rebinds
This is a small external change to Db2, but an extremely useful one that helps DBAs with their administration tasks for managing application plans in their Db2 for z/OS environments.
#Db2forz/OS