Running a custom script during the database upgrade (Db2®)

Applies to: On premises

If you want to run a custom script during the database upgrade process, edit the sql-wrapper.sql file to specify the script to run.

About this task

You can use the custom_data_upgrade_script parameter to configure a custom script.

The script that you specify is run during the database upgrade step. The custom script is called by the op-database-product-upgrade.sh/bat script after the other upgrade steps, such as DDL changes, PL/SQL code changes, and database level data changes are complete.

Procedure

  1. Open the sql-wrapper.sql file.
  2. Verify that the sqllib_dir path is correct. If you are running the custom script from a computer other than the database server, update the path.
  3. Edit the following parameters:
    define custom_data_upgrade_script=no-op.sql

    Replace no-op.sql with the script that you want to run.

  4. Place your custom script in the same directory as the sql-wrapper.sql file.