Upgrading Db2 servers in a TSA automated HADR environment

You can upgrade a TSA automated HADR environment from a previous Db2® version.

Before you begin

  • Ensure that you have root access on Linux® and UNIX operating systems or Local Administrator authority on Windows.
  • Ensure that you have SYSADM authority.
  • Complete pre-upgrade tasks for Db2 servers

About this task

Two upgrade options are available for automated HADR environments:
  • Upgrading the HADR primary and standby databases without reinitializing the HADR pair, while maintaining the HADR role.
  • Upgrading the HADR primary and standby database through reinitialization of the HADR pair.

Procedure

Use one of the following methods to upgrade your TSA automated HADR environment:
Method 1: Upgrading the HADR primary and standby databases without reinitializing the HADR pair, while maintaining the HADR role
  1. Export the current TSAMP resource configuration via db2haicu -o command on primary and standby hosts. Delete the domain by using the db2haicu -delete command. Deleting the cluster domain is an irreversible step. The resource model can be re-created after the upgrade is complete using the db2haicu -f command to import the configuration. The XML file generated above can be used as the input file. If the export is run on a single host (either primary or standby) and the same XML file is used to recreate the resource model after the upgrade, then the localHost and remoteHost parameters of HADRDB element will need to be modified depending on the host where the import is being performed.
  2. Follow the procedure for Upgrading Db2 servers in HADR single standby environments without standby reinitialization.
Method 2: Upgrading the HADR primary and standby database through re-initialization of the HADR pair.
  1. Stop HADR by running db2 stop hadr command on the database dbname.
  2. Delete the resources for the current instance by using the db2haicu -delete command. Deleting the cluster resources is an irreversible step. Before you do this, ensure that a snapshot of the resource model for the instance is captured by using the lssam command. The resource model needs to be re-created after the upgrade is complete.
  3. Deactivate the databases on both the primary and standby servers.
  4. Stop the Db2 instance by using db2stop command.
  5. Install Db2 version 12.1 in a new directory path.
  6. Upgrade the Db2 instance by using the db2iupgrade command.
  7. Start the Db2 instance by using the db2start command.
  8. If you are completing an upgrade on a primary server, upgrade the database by using the db2 upgrade dbname command.

What to do next