DB2 Version 9.7 for Linux, UNIX, and Windows

Rolling upgrade in an automated High Availability Disaster Recovery (HADR) environment

When you use the integrated High Availability (HA) feature to automate HADR, additional steps are required to upgrade software (operating system or DB2® database system), hardware, or when you make changes to database configuration parameters. Use this procedure to perform a rolling upgrade in an automated HADR environment.

About this task

Restrictions

This procedure will not work to migrate from an earlier to a later version of a DB2 database system; for example, you cannot use this procedure to migrate from a version 8 to a version 9 database system. You can use this procedure to update your database system from one modification level to another only, for example by applying a fix pack.

This procedure will not work if you update the DB2 HADR configuration parameters. Updates to HADR configuration parameters should be made separately. Because HADR requires the parameters on the primary and standby to be the same, this might require both the primary and standby databases to be deactivated and updated at the same time.

Before you begin

You must have the following prerequisites ready to perform the steps described in the procedures section:
  • Two DB2 instances (in this example, named stevera on each node).
  • Two nodes (grom04 and grom03). The grom04 machine is initially hosting the HADR Primary.
  • The instances are originally running at DB2 V9.7 GA code.
  • The instances are configured with Integrated HA control of HADR failover. The Cluster Domain is named test.
Note: All DB2 database system fix packs and upgrades should be implemented in a test environment before being applied to your production system.

The HADR pair should be in peer state before starting the rolling upgrade.

Procedure

  1. 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.

  2. 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
  3. 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
  4. 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.7
    DBI1017I  installFixPack is updating the DB2 product(s) installed in
          location /opt/ibm/db2/V9.7.

    DB2 fix pack installation is being started.

  5. 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
  6. Verify that the fix pack is applied and HADR is in peer state again:
    stevera@grom03% db2level
    
    stevera@grom03% db2pd hadr db SVTDB
  7. 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
  8. 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.7
    DBI1017I  installFixPack is updating the DB2 product(s) installed in
          location /opt/ibm/db2/V9.7

    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
  9. 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
  10. 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
  11. Ensure that MixedVersions is no longer set to Yes for the Cluster component:
    root@grom04:# lsrpdomain
    Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
    -----  --------  ------------------  --------------  -------  -------
    test   Online    2.5.1.2             No              12347    12348
  12. 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
  13. Optional: Perform a takeover as the instance owner stevera on grom04 machine to get grom04 to be the HADR Primary (as per original).