DB2 Version 9.7 for Linux, UNIX, and Windows

Rebinding packages in upgraded databases

During database upgrade, all packages for user applications and routines are marked as invalid. You must rebind invalidated packages to take advantage of changes in the DB2® server and new statistics.

About this task

Packages will be implicitly rebound the first time an application uses them after upgrading your database. To eliminate this overhead, you can rebind invalid packages by running the REBIND command or the db2rbind command after the upgrade process is complete. You must explicitly rebind inoperative packages.

Restrictions

This procedure only applies to Embedded SQL database applications programmed in C, C++, COBOL, FORTRAN, and REXX.

Before you begin

Ensure that you have DBADM authority.

Procedure

To rebind packages in upgraded databases:

  1. Log on as a user with DBADM authority.
  2. Rebind all invalid packages in each database:
    • From the CLP, run the db2rbind command, as follows:
         db2rbind database-name -l logfile all -u userid -p password
      The all clause rebinds valid and invalid packages. Review the log file specified by logfile, and address any issues.
    • From IBM® Data Studio, open the task assistant to rebind packages.
  3. Verify that your DB2 server upgrade was successful. Test your applications and tools to ensure the server is working as expected.

Results

After you have rebound all your database packages, you will automatically be able to take advantage of optimizer improvements. Refer to Upgrade essentials for database applications for details on the optimizer improvements available in this release.