DB2:- HADR Takeover / switchover scenario and steps of implementation


1. GRACEFULLY  TAKEOVER

Run takeover command on standby to make it primary gracefully. The Original Primary will become standby automatically. Not specific start is needed.

To bring back primary to original state, run the takeover command on primary back.

2. TAKOEVER BY FORCE ON STANDBY ---WITHOUT SHUTTING DOWN THE PRIMARY.

Run takeover by force on standby to make it primary. This would stop the HADR on primary, so we need to EXPLICITLY start hadr as standby to make the HADR flow right.

To return, run the takeover by force on original primary back and start hadr on standby as usual to make the HADR run as usual.

3. STOP THE PRIMARY INSTANCE

Stop the instance in primary by force ( db2stop force)

Run the takeover on standby as force on standby to make it primary

The original primary would remain in stop condition

To return back, once the db2 instance is up on primary, run following on it

Run the start HADR as standby ( to make the HADR flow correct)

After testing, run the graceful take over back to make the original primary as PRIMARY again

In between all these steps

try to test the application connections, data inserts , updates , HADR log gap , state and role to check if everything is running as expected


commands

1. Graceful Takeover

-- On Standby

db2 takeover hadr on database manoj

-- To switch back (on new standby, i.e., original primary)

db2 takeover hadr on database manoj

2. Takeover by Force (without shutting primary)

-- On Standby

db2 takeover hadr on database manoj by force

-- On Original Primary (explicitly start as standby)

db2 start hadr on database manoj as standby

-- To switch back

db2 takeover hadr on database manoj by force

db2 start hadr on database manoj as standby

3. Primary Instance Down

-- On Primary

db2stop force

-- On Standby

db2 takeover hadr on database manoj by force

-- After bringing Primary back up

db2start

db2 start hadr on database manoj as standby

-- To switch back

db2 takeover hadr on database manoj

=====VALIDATION====

db2 get db cfg for bludb | grep -i status

db2pd -db manoj -hadr | grep -i role

db2pd -db manoj -hadr | grep -i gap

db2pd -db manoj -hadr


Comments

Popular Posts