DB2 LUW: Primary server maintenance in HADR scenario

Scenario: I am using HADR on 2 boxes in primary and standby scenario.

Current Primary: box1

Current Standby: box2

We have some maintenance activity on box1. Please advise on what to do?


At high level ,you need to make current standby as primary, take box1 out of HADR pari, perform your maintenace activity on box1, and then make box1 as primary.

Below are detailed steps you need to follow:

Step1: Make box2 as primary

(a) Login to box2 server
(b) db2 takeover hadr on database <dbname>
(c) You can confirm HADR status using: db2pd -db <Dbname> -hadr
Step2: Login to box1 and perform below steps to take it out of HADR pair

(a) Confirm hadr on box1 is STANDY: db2pd -db <Dbname> -hadr
(b) deactivate the database using: db2 deactivate database <DBNNAME>
(c) db2 stop hadr on database <dbname>
(d) db2pd -db <dbname -hadr

Step3: Once your maintenance activity on box1 is complete, you need to bring it as standby and then takeover

db2 start hadr on database <dbname> as standby
db2pd -db <dbname> -hadr
db2 takeover hadr on database <dbname>
db2pd -db <dbname> -hadr

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: