IBM Support

Simple steps to reboot the primary host in a DB2 HADR/TSA setup

Technical Blog Post


Abstract

Simple steps to reboot the primary host in a DB2 HADR/TSA setup

Body

DB2 is running  with HADR enabled  and the automation of the role switch is controlled by TSA.

 

Now, I need to  reboot my primary host for any reason.  Or,  may be  just recycle the db2 instance  in the primary of HADR.

Intention is to maintain the HADR roles exactly the same way  and just  recycle the primary side of the HADR.

 

First of all it’s  important to understand that if the DB2 has an issue and stuck in the middle of something then  try to interrupt the primary database might  affect the hadr setup resulting  fresh  creation of the HADR pair.  So,  it might be  appropriate for a  more graceful situation as far as DB2 is concerned.

Also,  for any system or cluster maintenance need the additional cluster  commands  will be needed  which is described in other documents.

 

Usually the users  get confused whether they need to specifically  disable TSA or not as otherwise  it might trigger a failover.  Just  to clarify  on that,  the db2stop is a  cluster aware command.   So,  if a db2stop is used  it will  inform TSA  not to trigger.

 

So,  following steps could be  considered,

 

Deactivate the database in the primary

 

In primary, make sure application could be forced off.  Possibly, take a maintenance window.

db2 force application all

db2 deactivate db <db-name>

 

Deactivate the database in the standby

 

In standby, if Reads On Standby (ROS) is enabled  then,

db2 force application all

Then,

db2 deactivate db <db-name>

 

Issue db2stop  in the primary

 

db2stop will take care of the TSA’s intervention and avoid the automatic failover as long as the dbm config  CLUSTER_MGR  is set to TSA.

In primary,

db2stop force

Reboot the host if that is what planned for.

Otherwise,

db2_kill (just to cleanup resources)

Make sure the left over db2 process’ and IPCs are cleaned up.

Check with“ps -aef |grep db2”and issue kill -15 or -9 to cleanup any left over process’ showing up against the specific instance name.

Also,use “ipcs -a” to check any IPC resources against DB2 instance name and  ipcrm  the resource.

 

db2start in the primary

 

             In  primary,Once the host is rebooted or cleaned up is done just issue

db2start

 

Activate the db in standby

 

             In standby,

db2 activate db  <db-name>

 

Activate the db in primary

 

In primary,

            db2 activate db  <db-name>

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm11140526