Saving access path information for static SQL statements

You can use package copies to automatically save pertinent catalog table and directory records for static SQL statements when you bind a package or rebind an existing package.

About this task

Begin program-specific programming interface information.When a performance regression occurs after you rebind a package, you can use the saved historical information to switch back to the older copy of the package and regain the old access paths. You can also use the historical information in conjunction with the APREUSE bind option to specify that Db2 tries to reuse the existing active access paths for static SQL statements when you rebind packages.

Procedure

To save access path information for static SQL statements:

Specify the PLANMGMT bind option when you issue REBIND PACKAGE or REBIND TRIGGER PACKAGE command.
You can specify the following values:
EXTENDED

Db2 saves the active copy, and two older copies, which are known as the previous and original copies. Db2 replaces the previous copy with the former active copy and saves the newest copy as the active copy. Db2 saves the original copy at the first rebind that EXTENDED is specified and retains the original copy unchanged at subsequent rebinds.

Multiple phased-out copies can also be saved for phase-in of package rebinds. For more information, see Phase-in of package rebinds.

EXTENDED is the default value.

BASIC
Db2 saves the active copy and one older copy, which is known as the previous copy. Db2 replaces the previous copy path with the former active copy and saves the newest copy the active copy.
OFF
No copies are saved.

When you rebind a package with the PLANMGMT (EXTENDED) or (BASIC) options, the following options must remain the same for package copies to remain usable:

  • OWNER
  • QUALIFIER
  • ENABLE
  • DISABLE
  • PATH
  • PATHDEFAULT
  • IMMEDWRITE
End program-specific programming interface information.