Automatic rebinds

Automatic rebinds occur when an authorized user runs a package or plan and the runtime structures in the plan or package cannot be used. This situation usually results from changes to the attributes of the data on which the package or plan depends, or changes to the environment in which the package or plan runs.

In most cases, DB2® marks a package that must be automatically rebound as invalid by setting VALID='N' in the SYSIBM.SYSPLAN and SYSIBM.SYSPACKAGE catalog tables. For a list of actions that results in DB2 marking a package invalid, see Changes that invalidate packages.

If an automatic rebind fails, DB2 marks a package as inoperative in the OPERATIVE column of SYSIBM.SYSPLAN and SYSIBM.SYSPACKAGE catalog tables.

Controls for automatic binds

DB2 uses automatic binds only when the ABIND subsystem parameter is set to YES or COEXIST. If ABIND is set to NO when an invalid package runs, DB2 returns an error. Use COEXIST in most cases. For details, see AUTO BIND field (ABIND subsystem parameter).

You can also use resource limit tables to control automatic binds. For details, see Restricting bind operations.

Bind options for automatic binds

Start of changeIn general, DB2 uses the same bind options from the most recent bind process for automatic binds. The exceptions are:End of change

Start of change
  • If an option is no longer supported, the automatic rebind option process substitutes a supported option.
  • The automatic rebind value for APCOMPARE and APREUSE is NONE.
End of change

Automatic binds with package copies

If a package has previous or original copies as a result of rebinding with the PLANMGMT(BASIC) or PLANMGMT(EXTENDED) options or having the PLANMGMT subsystem parameter set to BASIC or EXTENDED, those copies are not affected by automatic rebind. Automatic rebind replaces only the current copy.

When automatic binds fail

If EXPLAIN(YES) was specified for the previous rebind operation, the ABEXP subsystem parameter controls whether DB2 captures EXPLAIN information during automatic rebinds. For details, see EXPLAIN PROCESSING field (ABEXP subsystem parameter). Automatic rebinds fail for most EXPLAIN errors.

Start of changeIf an automatic bind occurs while running in ACCESS(MAINT) mode the automatic bind is run under the authorization id of SYSOPR. If SYSOPR is not defined as an installation SYSOPR the automatic bind fails. End of change