Removing stabilized dynamic SQL statements from the Db2 catalog

When you stabilize dynamic SQL statements, you trade the potential access path improvements for stability and you use storage space in the Db2 catalog to store the run-time structure for the stabilized queries, so you might sometimes need to allow Db2 to generate a new access path, or reclaim the catalog space for unused queries.

Procedure

To enable a new access path to be considered for stabilized dynamic statements, or reclaim storage space used in the catalog:

Issue a FREE STABILIZED DYNAMIC QUERY command.

Examples

Free all stabilized dynamic queries for stabilization group APP01
FREE STABILIZED DYNAMIC QUERY STBLGRP(APP01)
Free stabilized dynamic query with statement identifier 1234
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234)
Free the invalid copy (COPYID=4) of the stabilized dynamic query with statement identifier 1234
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234) PLANMGMTSCOPE(INVALID)
Free all copies of the stabilized dynamic query with statement identifier 1234 that are invalid (VALID='N')
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234) INVALIDONLY(YES)