Rebinding an application

You need to rebind an application if you want to change any bind options. You also need to rebind an application when you make changes that affect the plan or package, such as creating an index, but you have not changed the SQL statements.

About this task

In some cases, DB2® automatically rebinds the plan or package for you, depending on the value of the ABIND subsystem parameter. For details, see Automatic rebinds.

The following actions might require that you rebind a package:

  • Changing the host language or SQL statements in the application. You must replace the package. Precompile, compile, and link the application program. Then issue a BIND command with the ACTION(REPLACE) option.
  • Changing your data attributes in ways that invalidate the package. For details, see Changes that invalidate packages.
  • Improving access paths selection after reorganizing data with the REORG utility or collecting database statistics with RUNSTATS or other utilities. For more information, see Maintaining data organization and statistics.
  • Enabling DB2 to select an access path that uses a newly created index for access to a table.
  • Changing the bind options for a package. If an option that you want to change is not available for the REBIND command, issue the BIND command with ACTION(REPLACE) instead.
  • Preparing for migration to a new DB2 release. For more information, see .