DB2: To bring down standby in preparation for patching

 

[tst3ins3@db2tst601  ~]

$ db2pd -db wctst10 -hadr

 

Database Member 0 -- Database WCTST10 -- Standby -- Up 9 days 18:43:52 -- Date 2024-04-04-10.50.50.493594

 

                            HADR_ROLE = STANDBY

                          REPLAY_TYPE = PHYSICAL

                        HADR_SYNCMODE = NEARSYNC

                           STANDBY_ID = 0

                        LOG_STREAM_ID = 0

                           HADR_STATE = PEER

                           HADR_FLAGS = TCP_PROTOCOL

                  PRIMARY_MEMBER_HOST = db2tst602

                     PRIMARY_INSTANCE = tst4ins4

                       PRIMARY_MEMBER = 0

                  STANDBY_MEMBER_HOST = db2tst601

                     STANDBY_INSTANCE = tst3ins3

                       STANDBY_MEMBER = 0

                  HADR_CONNECT_STATUS = CONNECTED

             HADR_CONNECT_STATUS_TIME = 03/25/2024 16:07:18.614475 (1711400838)

          HEARTBEAT_INTERVAL(seconds) = 5

                     HEARTBEAT_MISSED = 0

                   HEARTBEAT_EXPECTED = 169002

                HADR_TIMEOUT(seconds) = 30

        TIME_SINCE_LAST_RECV(seconds) = 1

             PEER_WAIT_LIMIT(seconds) = 0

           LOG_HADR_WAIT_CUR(seconds) = 0.000

    LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.005475

   LOG_HADR_WAIT_ACCUMULATED(seconds) = 1726.294

                  LOG_HADR_WAIT_COUNT = 2214990

SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 46080

SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 360960

            PRIMARY_LOG_FILE,PAGE,POS = S0039293.LOG, 22316, 8808844710663

            STANDBY_LOG_FILE,PAGE,POS = S0039293.LOG, 22316, 8808844710663

                  HADR_LOG_GAP(bytes) = 0

     STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0039293.LOG, 22316, 8808844710663

       STANDBY_RECV_REPLAY_GAP(bytes) = 27

                     PRIMARY_LOG_TIME = 04/04/2024 10:50:00.000000 (1712245800)

                     STANDBY_LOG_TIME = 04/04/2024 10:50:00.000000 (1712245800)

              STANDBY_REPLAY_LOG_TIME = 04/04/2024 10:50:00.000000 (1712245800)

         STANDBY_RECV_BUF_SIZE(pages) = 4302

             STANDBY_RECV_BUF_PERCENT = 0

           STANDBY_SPOOL_LIMIT(pages) = 12375000

                STANDBY_SPOOL_PERCENT = 0

                   STANDBY_ERROR_TIME = NULL

                 PEER_WINDOW(seconds) = 300

                      PEER_WINDOW_END = 04/04/2024 10:55:50.000000 (1712246150)

             READS_ON_STANDBY_ENABLED = N

              HADR_LAST_TAKEOVER_TIME = NULL

 

[tst3ins3@db2tst601  ~]

$ db2haicu disable

Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

 

Option 'disable' is not recognized.

>>-db2haicu-----+------------------------------------------+->

                +- -f--input file--------------------------+

                +- -o--output file-------------------------+

                +- -disable--------------------------------+

                '- -delete--+---------------------------+--'

                            |                   .-,---. |

                            |                   V     | |

                            +- -dbpartitionnum--number+-+

                            |           .-,-.           |

                            |           V   |           |

                            '- -hadrdb--name+-----------'

>-----------------------------------------------------------><

[tst3ins3@db2tst601  ~]

$ db2 deactivate db wctst10

DB20000I  The DEACTIVATE DATABASE command completed successfully.

[tst3ins3@db2tst601  ~]

$ db2 stop hadr on db wctst10

DB20000I  The STOP HADR ON DATABASE command completed successfully.

[tst3ins3@db2tst601  ~]

$ db2stop

04/04/2024 10:59:45     0   0   SQL1064N  DB2STOP processing was successful.

SQL1064N  DB2STOP processing was successful.

[tst3ins3@db2tst601  ~]

$ db2pd -db wctst10 -hadr

Unable to attach to database manager on member 0.

Please ensure the following are true:

   - db2start has been run for the member.

   - db2pd is being run on the same physical machine as the member.

   - DB2NODE environment variable setting is correct for the member

     or db2pd -mem setting is correct for the member.

Another possibility of this failure is the Virtual Address Space Randomization is currently enabled on this system.

[tst3ins3@db2tst601  ~]

$ lssam

Pending online IBM.ResourceGroup:db2_tst3ins3_db2tst601_0-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst3ins3_db2tst601_0-rs Control=StartInhibitedBecauseSuspended

                '- Offline IBM.Application:db2_tst3ins3_db2tst601_0-rs:db2tst601

Online IBM.ResourceGroup:db2_tst4ins4_db2tst602_0-rg Nominal=Online

        '- Online IBM.Application:db2_tst4ins4_db2tst602_0-rs

                '- Online IBM.Application:db2_tst4ins4_db2tst602_0-rs:db2tst602

Pending online IBM.ResourceGroup:db2_tst4ins4_tst3ins3_WCTST10-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst4ins4_tst3ins3_WCTST10-rs Control=StartInhibitedBecauseSuspended

                |- Offline IBM.Application:db2_tst4ins4_tst3ins3_WCTST10-rs:db2tst601

                '- Offline IBM.Application:db2_tst4ins4_tst3ins3_WCTST10-rs:db2tst602

Online IBM.Equivalency:db2_public_network_0

        |- Online IBM.NetworkInterface:eth0:db2tst601

        '- Online IBM.NetworkInterface:eth0:db2tst602

Online IBM.Equivalency:db2_tst3ins3_db2tst601_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst601:db2tst601

Online IBM.Equivalency:db2_tst4ins4_db2tst602_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst602:db2tst602

Online IBM.Equivalency:db2_tst4ins4_tst3ins3_WCTST10-rg_group-equ

        |- Online IBM.PeerNode:db2tst601:db2tst601

        '- Online IBM.PeerNode:db2tst602:db2tst602

[tst3ins3@db2tst601  ~]

 


 

Marc’s notes:

Bring down the standby

Disable TSA

$ db2haicu -disable

Verify TSA

$ lssam

Stop HADR

$ db2 deactivate db wctst10

$ db2 stop hadr on db wctst10

Verify HADR

$ db2pd -db wctst10 -hadr

Stop Db2

$ db2stop

Maintenance performed

 

Bring up the standby

Start Db2

$ db2start

Start HADR

$ db2 start hadr on db <dbName> as standby

Verify HADR

$ db2pd -db <dbName> -hadr

Enable TSA

$ db2haicu

Verify TSA

$ lssam

Comments

Popular posts from this blog

Oracle: To clean up WRI$_ADV_OBJECTS