When to regenerate Db2 database objects and routines
Generally, the REGENERATE keyword is used only for specific situations, such as when implicit regeneration fails for routines or objects, or Db2 maintenance requires objects or routines to be regenerated.
For example, the following situations might require you to issue ALTER statements with the RENGERATE keyword:
- When implicit regeneration fails when Db2 tries to update internal code blocks for the following types of routines or objects:
- Expression-based indexes
- Native SQL procedures
- Views that reference Db2 catalog columns that are updated by the CATMAINT utility for a new release or function level.
- When the closing text or ++HOLD data for an APAR indicates that you must explicitly regenerate certain routines or objects to fix corrupted control blocks.
When Db2 uses implicit regeneration
Db2 typically uses implicit
regeneration when it accesses migrated objects or routines in a different release, such as
during release coexistence, after migration, or after fallback. For example, Db2 uses implicit regeneration in the following scenarios:
- An earlier Db2 release uses an expression-based index last used on the later release.
- A later Db2 release uses an expression-based index that was last used in an earlier release that is more than two releases down-level.
- An earlier Db2 release uses a native SQL procedure that was created or regenerated on a later release.
- A later Db2 release uses a native SQL procedure that was last bound (or section 1 of the procedure was last compiled) on an earlier release that is more than two releases down-level.