DB2 HA Cluster Takeover Steps Popular 2024

By kssaplearning

Published on:

Follow Us
SAP HA CLUSTER TAKEOVER STEPS

DB2 HA Cluster Takeover Steps:

SAP DB2 HA Cluster Takeover Steps:
HA Cluster fail backup scenario:

In this blog, we have explained the Cluster fail backup scenario from primary to secondary and secondary to the Primary steps process(db2 HA Cluster Takeover steps)
If you assume the database server details, primary and secondary server details.
Server details:

Primary server : vmdb01 server
In this server, 2 active databases note has created. Both are primary nodes.
Primary nodes:
1. HA1 –Primary node
2. HA2 –Primary node
Secondary server : vmdb02 server
In this server, 2 active databases note has created. Both are secondary nodes.
Secondary nodes:
1. HA1 –Secondary node
2. HA2 –Secondary node

• As per above details, primary server in 2 primary nodes and secondary server in 2 secondary nodes.

DB2 HA Cluster Takeover Steps
Fail Back scenario:
• If primary server primary node1 has down then the secondary server second node 1 becomes a primary node.
• If primary server primary node2 has down then the secondary server second node2 become a primary node.
Fail Back scenario Commands:
Secondary server becomes a primary server:

• Login to the secondary server
• Su – db2sid
• Execute the takeover command in the secondary server:
Commands:
#db2 takeover hard on database HA1
#db2 takeover hard on database HA2

After executing the above command, primary server becomes a secondary and secondary becomes a primary nodes.
• Once above commands have executed the HADR Status on primary server and secondary server.
• Commands for db2:
Db2pd –d SID hard
• We have checked the HA Cluster fail back tests.
DB2 Cluster Takeover for Maintenance Activity:
Without downtime, we can performed the Takeover commands for Maintenance Activity

• How to stop secondary server
• How to change the standby server to Primary server
• How to stop the Primary server
• How to change revert back original servers to primary server as primary node and secondary server as secondary node.

Due to Maintenance Activity, we can performed the database stop and start without downtime.

Primary server : vmdb01 server
Primary nodes:
1. HA1 –Primary node SID
2. HA2 –Primary node SID

Secondary server : vmdb02 server
Secondary nodes:
1. HA1 –Secondary node SID
2. HA2 –Secondary node SID

Stopping process DB2 Standby server:

• Login to the standby server
• Su – db2sid
• 1st deactivate the db and stop the database
• Deactivate the databases
#db2 deactivate db HA1
#db2 deactivate db HA2
• Once deactivated then stop the database
#db2stop

Starting process DB2 Standby server:

• Login to the standby server
• Su – db2sid
• 1st start the db and activate the db
• Start the database.
#dbstart
• activate the databases
#db2 activate db HA1
#db2 activate db HA2
• check HADR status.
#db2pd –d SID –hadr

Once stand by server has restarted then we can perform the Takeover command.

SAP HA CLUSTER TAKEOVER STEPS
Taking over primary as secondary:

• Login to the standby server
• Su – db2sid
• Execute the below command in secondary server.
#db2 takeover hard on database HA1
#db2 takeover hard on database HA2
• After executed the above commands, server primary and secondary nodes has changed.
Primary server - secondary server
Secondary server  primary server
• We can follow the stopping process on current stand by server.

Taking over secondary as primary:

• Login to the original primary server
• Su – db2sid
• Execute the below command in original primary server.
#db2 takeover hard on database HA1
#db2 takeover hard on database HA2
• After executed the above commands, server primary and secondary nodes have changed.
Secondary server - Primary server
Primary server  Secondary server

We have successfully performed the take over and fail backup scenario on DB2 HA Cluster nodes(DB2 HA Cluster Takeover Steps)
Conclusions:
We have executed the DB2 HA Cluster Takeover Steps on production environment system and system is working fine.

SAP DB2 HA Cluster Takeover Steps
1. How to check the HADR Status?

Using the below command, we will check the HADR Status.
Command:
• Su – db2sid
• Db2pd –d SID –hadr
• Check hard status and log gap status.
• Check replication status also.

2. How to stop the db2 database?

Using the below command, we can stop and start the database.
Command:
• Su – db2sid
• Db2stop

3. How to start the db2 database?

Using the below command, we can stop and start the database.
Command:
• Su – db2sid
• Db2start

Other Blogs:

SAP Hana Log volume FullHana log volume full

SAP HANA Backup Configuration

Hana backup configuration

FAQ for DB2 HA Cluster Takeover Steps:

How to deactivate the db in cluster system?

db2 deactivate db SID

How to activate the db in HA system?

db2 activate db SID

How to check primary and secondary node details?

Execute the below command on cluster system, identify the HADR status for primary and secondary
Command: db2pd –d SID -hadr

1 thought on “DB2 HA Cluster Takeover Steps Popular 2024”

Leave a Comment