Updating an IBM Db2 Warehouse SMP deployment on Linux® with HADR

Use the following procedure to update a working Db2® Warehouse SMP deployment that uses HADR. The update process is usually significantly faster than the initial deployment process. All of your data and settings will automatically be preserved after the update.

Note: Use this task to update an SMP deployment only if it is uses HADR. If your SMP deployment does not use HADR, follow the instructions in Updating an IBM Db2 Warehouse SMP deployment on Linux without HADR.

Before you begin

  • Clear your browser cache.
  • Stop all applications that are connected to the Db2 Warehouse database.
  • Close the web console.
  • Ensure that you meet the prerequisites described in Getting container images.

Procedure

  1. Confirm that the nodes are in PEER state by issuing the following command on either node:
    docker exec -it Db2wh manage_hadr -status
  2. Log in to Docker by using your API key:
    echo <apikey> | docker login -u iamapikey --password-stdin icr.io
    where <apikey> is the API key that you created as a prerequisite in Getting container images.
  3. On the standby node, perform the update process in Updating an IBM Db2 Warehouse SMP deployment on Linux without HADR. When you issue the docker run command in that process, specify the -e HADR_ENABLED='YES' parameter for that command;
    • For POWER® LE hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-ppcle
    • For z Systems® hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-s390x
    • For a Db2 Warehouse Enterprise Edition container on x86 hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-linux
  4. Confirm that the nodes are in PEER state by issuing the following command on either node:
    docker exec -it Db2wh manage_hadr -status
  5. Instruct the standby node to take over as the primary node by issuing the following command:
    docker exec -it Db2wh manage_hadr -takeover 
  6. On the new standby node (what used to be the primary node), carry out the steps described in Updating an IBM Db2 Warehouse SMP deployment on Linux without HADR. When you issue the docker run command in that process, specify the -e HADR_ENABLED='YES' parameter for that command.
    • For POWER LE hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-ppcle
    • For z Systems hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-s390x
    • For a Db2 Warehouse Enterprise Edition container on x86 hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -e HADR_ENABLED='YES' -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-linux
  7. Confirm that the nodes are in PEER state by issuing the following command on either node:
    docker exec -it Db2wh manage_hadr -status
  8. Instruct the old primary node (what is now the standby node) to take over as the primary node by issuing the following command on the old primary node:
    docker exec -it Db2wh manage_hadr -takeover
  9. Confirm that the nodes are in PEER state by issuing the following command on either node:
    docker exec -it Db2wh manage_hadr -status
  10. Update the database objects by issuing the following command on the primary node:
    docker exec -it Db2wh manage_hadr -update_db

Troubleshooting

If the update attempt fails with SQL code SQL5005C, carry out the troubleshooting procedure. To check the deployment log for SQL code SQL5005C, issue the following command:
dashDB bash -c 'cat $PRODUCT_LOGFILE | grep "SQL5005C"'
Troubleshooting procedure:
  1. Issue the following command to stop the container services for the failed container:
    docker exec -it Db2wh stop
  2. Issue the following command to stop the container on all nodes:
    docker stop Db2wh
  3. Issue the following command to remove the failed container:
    docker rm Db2wh
  4. Restart the update by issuing one of the following docker run commands concurrently on all node hosts. Do not wait until the command finishes running on one node host before issuing it on another.
    • For POWER LE hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-ppcle
    • For z Systems hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-s390x
    • For x86 hardware:
      docker run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-linux

What to do next

After you verify that the update was successful, delete the old image and container.