Upgrading by re-initializing HADR deployments

You can disable HADR to upgrade the Db2 or Db2 Warehouse primary and standby database instances and re-enabling it.

Before you begin

You must stop and disable HADR on your primary and standby database instances:
  • On the primary and standby database instances, Run the manage_hadr -stop command from the Db2 engine pod to stop HADR.
  • On the primary database instances, Exec into the Db2 engine pod and remove the /mnt/blumeta0/home/db2inst1/governor/db2.yml to ensure that automation does not detect it as an HADR instance.
  • If you have configured HADR using a Db2uHADR custom resource (CR), then run the oc delete db2uhadr <db2uhadr instance name> command to delete the CR.
Transition standby database instances to Active state:
  • On the standby database instances, Exec into the Db2 engine pod and run the su - db2inst1 -c "db2 rollforward db <DBNAME> complete" command.
  • On the standby database instances, Exec into the Db2 engine pod and run the su - db2inst1 -c "db2 connect to <DBNAME> command to ensure you can connect to your database.

Procedure

  1. Follow Step 1, Step 2, Step 3, and Step 4 in the Upgrading the Db2uCluster or Db2uinstance resource procedure.
    Note: This executes the db2ckupgrade command in a Kubernetes job to check if your current instance has the required upgrade compatibility. If the db2ckupgrade command in the Kubernetes job is successful, it will initiate the upgrade on your primary instance. When the upgrade is completed, the your custom resource changes to a Ready state and displays version 12.1.0.0 in the status. For more information, see Step 5 in the Upgrading the Db2uCluster or Db2uinstance resource procedure.
  2. Exec into the Db2 engine pod as the db2inst1 user and run the db2_update_upgrade --databases command to update the databases and run the db2_update_upgrade --post-upgrade command to run post upgrade operations on your primary instance.
    Your primary instance is now successfully upgraded to version s12.1.0.0. and is ready for use.
  3. Follow Step 1, Step 2, Step 3, and Step 4 in the Upgrading the Db2uCluster or Db2uinstance resource procedure.
  4. Exec into the Db2 engine pod as the db2inst1 user and run the db2_update_upgrade --databases command to update the databases and run the db2_update_upgrade --post-upgrade command to run post upgrade on your standby database instance.
    Your standby instance is now successfully upgraded to version s12.1.0.0. and is ready for use.
  5. Re-initialize HADR:
    1. Perform all the steps in Configuring and starting HADR.
    2. Monitor the upgrade progress to ensure primary and standby instances in your HADR deployment are in PEER state. Exec into the Db2 engine pod on your primary instance and run the manage_hadr -status command.