db2 rolling upgrade in HADR

Procedure

Display Initial System State:
root@grom03:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
-----  --------  ------------------  -------------   -------  -------
test   Online    2.4.7.1             No              12347    12348

root@grom03:# lssam
Online IBM.ResourceGroup:db2_stevera_grom03_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom03_0-rs
                '- Online IBM.Application:db2_stevera_grom03_0-rs:grom03
Online IBM.ResourceGroup:db2_stevera_grom04_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom04_0-rs
                '- Online IBM.Application:db2_stevera_grom04_0-rs:grom04
Online IBM.ResourceGroup:db2_stevera_stevera_SVTDB-rg Nominal=Online
        |- Online IBM.Application:db2_stevera_stevera_SVTDB-rs
                |- Offline IBM.Application:db2_stevera_stevera_SVTDB-rs:grom03
                '- Online IBM.Application:db2_stevera_stevera_SVTDB-rs:grom04
        '- Online IBM.ServiceIP:db2ip_9_26_124_22-rs
                |- Offline IBM.ServiceIP:db2ip_9_26_124_22-rs:grom03
                '- Online IBM.ServiceIP:db2ip_9_26_124_22-rs:grom04

root@grom03:# lsrpnode
Name     OpState   RSCTVersion
-----    -------   ------------
grom03   Online    2.4.7.1
grom04   Online    2.4.7.1
From the above example, you see that you need to upgrade the Standby instance on grom03. To do that, stop all resource groups hosted on grom03.

Stop all Resource Groups on Standby Node and confirm change:
root@grom03:# chrg -o Offline db2_stevera_grom03_0-rg

root@grom03:# lssam –g db2_stevera_grom03_0-rg
Offline IBM.ResourceGroup:db2_stevera_grom03_0-rg Nominal=Offline
        '- Offline IBM.Application:db2_stevera_grom03_0-rs
                '- Offline IBM.Application:db2_stevera_grom03_0-rs:grom03
Stop Cluster Node (the Standby Node) and confirm change:
root@grom03:# stoprpnode grom03

root@grom03:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
----   -------   -----------------   -------------   ------   ------
test   Offline   2.4.7.1             No              12347    12348
Install DB2 fix pack on Standby Node:
Optional: On AIX?, you might need to install RSCT prerequisites for the fix pack in question.

root@grom03:# ./installFixPack -b /opt/ibm/db2/V9.5
DBI1017I  installFixPack is updating the DB2 product(s) installed in
      location /opt/ibm/db2/V9.5.
DB2 fix pack installation is being started.

Start the node and online the resource group:
When the installation is completed successfully.

root@grom03:# startrpdomain test

root@grom03:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
-----  --------  ------------------  --------------  -------  -------
test   Online    2.4.7.1             Yes             12347    12348

root@grom03:# chrg -o Online db2_stevera_grom03_0-rg
Verify that the fix pack is applied and HADR is in peer state again:
stevera@grom03% db2level

stevera@grom03% db2pd –hadr –db SVTDB
Perform TAKEOVER:
To upgrade the other node (in this case, that is grom04), perform TAKEOVER so that the node grom03 is hosting the HADR Primary.

root@grom03:# su - stevera

stevera@grom03% db2 takeover hadr on db SVTDB
DB20000I  The TAKEOVER HADR ON DATABASE command completed successfully.

root@grom03:# lssam
Online IBM.ResourceGroup:db2_stevera_grom03_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom03_0-rs
                '- Online IBM.Application:db2_stevera_grom03_0-rs:grom03
Online IBM.ResourceGroup:db2_stevera_grom04_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom04_0-rs
                '- Online IBM.Application:db2_stevera_grom04_0-rs:grom04
Online IBM.ResourceGroup:db2_stevera_stevera_SVTDB-rg Nominal=Online
        |- Online IBM.Application:db2_stevera_stevera_SVTDB-rs
                |- Online IBM.Application:db2_stevera_stevera_SVTDB-rs:grom03
                '- Offline IBM.Application:db2_stevera_stevera_SVTDB-rs:grom04
        '- Online IBM.ServiceIP:db2ip_9_26_124_22-rs
                |- Online IBM.ServiceIP:db2ip_9_26_124_22-rs:grom03
                '- Offline IBM.ServiceIP:db2ip_9_26_124_22-rs:grom04
Perform upgrade at node grom04:
root@grom03:# ssh root@grom04

root@grom04:# chrg -o Offline db2_stevera_grom04_0-rg

root@grom04:# lssam –g db2_stevera_grom04_0-rg
Offline IBM.ResourceGroup:db2_stevera_grom04_0-rg Nominal=Offline
        '- Offline IBM.Application:db2_stevera_grom04_0-rs
                '- Offline IBM.Application:db2_stevera_grom04_0-rs:grom04

root@grom04:# stoprpnode grom04
Optional: On AIX, you might need to install RSCT prerequisites for the fix pack in question.

root@grom04:# ./installFixPack -b /opt/ibm/db2/V9.5
DBI1017I  installFixPack is updating the DB2 product(s) installed in
      location /opt/ibm/db2/V9.5
DB2 fix pack installation is being started.

When the installation is completed successfully.

root@grom04:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
-----  --------  ------------------  --------------  -------  -------
test   Offline   2.4.7.1             Yes             12347    12348

root@grom04:# startrpdomain test

root@grom04:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
-----  --------  ------------------  --------------  -------  -------
test   Online    2.4.7.1             Yes             12347    12348

root@grom04:# chrg -o Online db2_stevera_grom04_0-rg
Verify that fix pack has been applied (by running db2level) and HADR is in Peer State (by running db2pd –hadr –db svtdb):
root@grom04:# su - stevera

stevera@grom04% db2pd -hadr -db svtdb

Database Partition 0 -- Database SVTDB -- Active -- Up 0 days 00:00:05

HADR Information:
Role     State    SyncMode    HeartBeatsMissed    LogGapRunAvg (bytes)
-----    ------   ---------   -----------------   --------------------
Standby  Peer     Sync        0                   0

ConnectStatus   ConnectTime                           Timeout
--------------  ------------                          --------
Connected       Tue May 5 13:20:58 2009 (1241544058)  120

PeerWindowEnd                          PeerWindow
--------------                         -----------
Tue May  5 13:25:58 2009 (1241544358)  300

LocalHost                              LocalService
----------                             -------------
grom04                                 55555

RemoteHost                             RemoteService      RemoteInstance
-----------                            --------------     ---------------
grom03                                 55555              stevera

PrimaryFile    PrimaryPg    PrimaryLSN
------------   ----------   -----------
S0000001.LOG   1            0x0000000003389487

StandByFile    StandByPg    StandByLSN          StandByRcvBufUsed
------------   ----------   -----------         ------------------
S0000001.LOG   1            0x0000000003389487  0%

root@grom04:# lssam
Online IBM.ResourceGroup:db2_stevera_grom03_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom03_0-rs
                '- Online IBM.Application:db2_stevera_grom03_0-rs:grom03
Online IBM.ResourceGroup:db2_stevera_grom04_0-rg Nominal=Online
        '- Online IBM.Application:db2_stevera_grom04_0-rs
                '- Online IBM.Application:db2_stevera_grom04_0-rs:grom04
Online IBM.ResourceGroup:db2_stevera_stevera_SVTDB-rg Nominal=Online
        |- Online IBM.Application:db2_stevera_stevera_SVTDB-rs
                |- Online IBM.Application:db2_stevera_stevera_SVTDB-rs:grom03
                '- Offline IBM.Application:db2_stevera_stevera_SVTDB-rs:grom04
        '- Online IBM.ServiceIP:db2ip_9_26_124_22-rs
                |- Online IBM.ServiceIP:db2ip_9_26_124_22-rs:grom03
                '- Offline IBM.ServiceIP:db2ip_9_26_124_22-rs:grom04
Migrate TSA Domain:
root@grom04:# export CT_MANAGEMENT_SCOPE=2

root@grom04:# runact -c IBM.PeerDomain CompleteMigration Options=0
Resource Class Action Response for CompleteMigration

root@grom04:# samctrl -m

Ready to Migrate! Are you Sure? [Y|N]:.

Y
Ensure that MixedVersions is no longer ‘Yes' for the Cluster component:
root@grom04:# lsrpdomain
Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
-----  --------  ------------------  --------------  -------  -------
test   Online    2.5.1.2             No              12347    12348
Ensure that the Active Version Number (AVN) matches the Installed Version Number (IVN) for the HA Manager:
root@grom04:# lssrc –ls IBM.RecoveryRM |grep VN
   Our IVN         : 2.2.0.7
   Our AVN         : 2.2.0.7
Optional: Perform a takeover as the instance owner 'stevera' on grom04 machine to get grom04 to be the HADR Primary (as per original).
请使用浏览器的分享功能分享到微信等