DB2 Version 10.1 for Linux, UNIX, and Windows

Performing rolling updates in an automated high availability disaster recovery (HADR) environment

Use this procedure to perform a rolling update in an automated HADR environment because additional steps are required to update the DB2® database software, upgrade operating system software, upgrade hardware, or change database configuration parameters.

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 DB2 servers (grom04 and grom03). The grom04 computer is initially hosting the HADR primary database.
  • The instances are originally running at Version 10.1 GA code.
  • The instances are configured with IBM® Tivoli® System Automation for Multiplatforms (SA MP) controlling HADR failover. The cluster domain is named test.
Note: All DB2 fix pack updates, hardware upgrades, and software 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 update.

Restrictions

Use this procedure to perform a rolling update on your DB2 database system and update the DB2 database product software from one modification level to another in an automated HADR environment . For example, applying a fix pack to a DB2 database product software.

A rolling update cannot be used to upgrade a DB2 database system from an earlier version to a later version. For example, you cannot use this procedure to upgrade from Version 9.7 to Version 10.1.

You cannot use this procedure to 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.

Procedure

  1. display initial system state on the standby server:
    root@grom03:# lsrpdomain
    Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
    -----  --------  ------------------  -------------   -------  -------
    test   Online    2.5.3.5             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.5.3.5
    grom04   Online    2.5.3.5

    From this example, you see that you must update the standby instance on grom03. To do that, stop all resource groups hosted on grom03.

  2. Stop all resource groups on the standby server and confirm the 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 the cluster node (the standby server) and confirm the change:
    root@grom03:# stoprpnode grom03
    
    root@grom03:# lsrpdomain
    Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
    ----   -------   -----------------   -------------   ------   ------
    test   Offline   2.5.3.5             No              12347    12348
  4. Install DB2 fix pack on Standby server:

    Optional: On AIX®, you might need to install RSCT prerequisites for the DB2 fix pack in question.

    root@grom03:# ./installFixPack -b /opt/ibm/db2/v10.1
    DBI1017I  installFixPack is updating the DB2 product(s) installed in
          location /opt/ibm/db2/v10.1.

    DB2 fix pack installation is being started.

  5. Start the server and bring the resource group back online:

    When the installation is completed successfully.

    root@grom03:# startrpdomain test
    
    root@grom03:# lsrpdomain
    Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
    -----  --------  ------------------  --------------  -------  -------
    test   Online    2.5.3.5             Yes             12347    12348
    
    root@grom03:# chrg -o Online db2_stevera_grom03_0-rg
  6. Verify that the DB2 fix pack is applied and HADR is in peer state again:
    stevera@grom03% db2level
    
    stevera@grom03% db2pd -hadr db SVTDB
  7. Perform a takeover so that grom03 is hosting the HADR primary database and you can perform a rolling update on the other server (grom04).
    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. Upgrade the resource groups at 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/V10.1
    DBI1017I  installFixPack is updating the DB2 product(s) installed in
          location /opt/ibm/db2/V10.1

    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.5.3.5             Yes             12347    12348
    
    root@grom04:# startrpdomain test
    
    root@grom04:# lsrpdomain
    Name   OpState   RSCTActiveVersion   MixedVersions   TSPort   GSPort
    -----  --------  ------------------  --------------  -------  -------
    test   Online    2.5.3.5             Yes             12347    12348
    
    root@grom04:# chrg -o Online db2_stevera_grom04_0-rg
  9. Verify that the 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 Member 0 -- Database SVTDB -- Active -- Up 0 days 00:00:05 -- Date 06/08/2011 13:57:23
    
                                  HADR_ROLE = STANDBY
                                REPLAY_TYPE = PHYSICAL
                              HADR_SYNCMODE = SYNC
                                 STANDBY_ID = 1
                              LOG_STREAM_ID = 0
                                 HADR_STATE = PEER
                        PRIMARY_MEMBER_HOST = grom03
                           PRIMARY_INSTANCE = stevera
                             PRIMARY_MEMBER = 0
                        STANDBY_MEMBER_HOST = grom04
                           STANDBY_INSTANCE = stevera
                             STANDBY_MEMBER = 0
                        HADR_CONNECT_STATUS = CONNECTED
                   HADR_CONNECT_STATUS_TIME = 06/08/2011 13:52:23
                HEARTBEAT_INTERVAL(seconds) = 25
                      HADR_TIMEOUT(seconds) = 120
              TIME_SINCE_LAST_RECV(seconds) = 3
                   PEER_WAIT_LIMIT(seconds) = 0
                 LOG_HADR_WAIT_CUR(seconds) = 0.000
          LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000
         LOG_HADR_WAIT_ACCUMULATED(seconds) = 0.000
                        LOG_HADR_WAIT_COUNT = 0
      SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 50772
      SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 87616
                  PRIMARY_LOG_FILE,PAGE,POS = S0000001.LOG, 1, 49262315
                  STANDBY_LOG_FILE,PAGE,POS = S0000001.LOG, 1, 49262315
                        HADR_LOG_GAP(bytes) = 0
           STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0000009.LOG, 1, 49262315
             STANDBY_RECV_REPLAY_GAP(bytes) = 0
                           PRIMARY_LOG_TIME = 06/08/2011 13:49:19.000000 (1307566159)
                           STANDBY_LOG_TIME = 06/08/2011 13:49:19.000000 (1307566159)
                    STANDBY_REPLAY_LOG_TIME = 06/08/2011 13:49:19.000000 (1307566159)
               STANDBY_RECV_BUF_SIZE(pages) = 16
                   STANDBY_RECV_BUF_PERCENT = 0
                 STANDBY_SPOOL_LIMIT(pages) = 0
                       PEER_WINDOW(seconds) = 300
                            PEER_WINDOW_END = 06/08/2011 14:02:23
                   READS_ON_STANDBY_ENABLED = N
          
    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 the 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.3.5             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 return to the original configuration with grom04 as the HADR primary database.