DB2 Guide to Upgrade TSAMP Managed DB2 HADR

The steps needed to upgrade DB2 that is managed by TSAMP to a new level (e.g. installing a fix pack)
It is crucial to stop DB2 and TSAMP/RSCT properly before the upgrade to prevent any corruption to the applications that will cause unnecessary downtime.

Important: We assume that the DB2 upgrade does not include any upgrade for TSAMP/RSCT. If there is, please refer to the following dwAnswers post for steps to complete the upgrade(migration) for TSAMP and RSCT
https://developer.ibm.com/answers/questions/204193/what-are-the-basic-steps-needed-to-upgrade-a-tsamp.html

1. Determine the Current Status
The first thing to do is to determine the current state of the applications.
Please make sure all the managed resources are ONLINE on the proper node.
You can achieve that using the "lssam" command.
2. Set CritRsrcProtMethod=5 to Avoid Unnecessary Reboot.
To avoid any unnecessary reboot due to stopping of critical resources, you (as "root" user) can set CritRsrcProtMethod to 5:
chrsrc -c IBM.PeerNode CritRsrcProtMethod=5

To verify, you can use the following command:
lsrsrc -c IBM.PeerNode CritRsrcProtMethod

test2144:/tmp# lsrsrc -c IBM.PeerNode CritRsrcProtMethod
Resource Class Persistent Attributes for IBM.PeerNode
resource 1:
        CritRsrcProtMethod = 5
test2144:/tmp#

3. Stop All Managed Resources Through TSAMP
Now, you can proceed to stop all the managed resources through TSAMP.
To achieve that, you can execute the command:
chrg -o offline -s 1=1

4. Verify That all Managed Resources Are Stopped
Before proceeding further, please make sure all managed resources are stopped with the "lssam" command.

Note: It is ok to see that the "equivalencies" are still online.
They should be because the nodes and network interfaces are still
active. The "chrg" command will only offline resource groups.

5. Verify That DB2 Is Stopped.
The output of "lssam" has already shown that all DB2 resources are offline or stopped.
However, you can execute command like "ps -ef | grep db2sys" to make sure DB2 is really stopped on ALL nodes.

6. Stop the Domain
Once all the resources are stopped, you can proceed to stop the domain:
stoprpdomain

To make sure domain is stopped, execute command:
lsrpdomain

7. Upgrade DB2
Once the domain is offlined, you can proceed to upgrade DB2.

8. Post DB2 Upgrade
After DB2 is upgraded successfully, you can proceed to restart the domain:
startrpdomain

lsrpdomain
lssam

After the domain is started, you can start the resources with the command:
chrg -o online -s 1=1

lssam

9. Reset CritRsrcProtMethod
Once you have verified that all resources are started properly, you can proceed to reset CritRsrcProtMethod:
chrsc -c IBM.PeerNode CritRsrcProtMethod=3
To ensure that the change is successful, please execute command:
lsrsrc -c IBM.PeerNode CritRsrcProtMethod


Summary
In Summary, to upgrade a TSAMP managed DB2 HADR domain:
1. chrsrc -c IBM.PeerNode CritRsrcProtMethod=5
2. chrg -o offline -s 1=1
3. stoprpdomain
4. Upgrade DB2
5. startrpdomain
6. chrg -o online -s 1=1
7. chrsrc -c IBM.PeerNode CritRsrcProtMethod=3
请使用浏览器的分享功能分享到微信等