Avatar of Jim Youmans
Jim YoumansFlag for United States of America

asked on 

DB2 10.5 HADR question

DB2 10.5 on Windows Server
I am using HADR to do a server migration.  Old server is primary and new server is stand by.  At migration time, I plan to shut down the primary and then make the standby primary.  I am looking for some way to be sure that I don't lose any data when I do this.  
Can I quiesce the primary before hand and do some type of flush log to make sure all the data has beem copied over to the standby?  Or should I do a takeover by force on the standby and will that ensure no data loss?
Thank you!

Avatar of undefined
Last Comment
Tomas Helgi Johannsson
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jim Youmans
Jim Youmans
Flag of United States of America image


Sorry I am so dense.  And thank you so much for taking the time to explain (again) what I need to do.  

My main concern is I don't have the ability to stop the applications.  And the developers can't due to some reason I am sure is legit.  If I kill an application process, it will respawn before I can count to to.  

So I need to make sure I can do the failover without losing data.  

If I use
db2 set write suspend for database

Open in new window

would that affect the standby server?  If I can issue that and wait till primary and standby are synched then that would be perfect.  With Quiesce I am afraid that as soon as I UnQuiesce it, the connections will renew before I can do anything else.  

Thank you!
Set write suspend would not work in this scenario.
You can either use
db2 force application (all)
QUIESCE db command
to gracefully force applications off the database and then shut them down.
Since you are upgrading the database between major versions (10.5 - 11.x), then a scheduled downtime where the applications are shut down prior to the upgrade is unavoidable.

Fixpack upgrades (in the same major version) are easier, using HADR rolling upgrade where applications can connect to the primary while the fixpack is applied to the standby. Then a switchover is done, and the previous primary is finally upgraded to the fixpack. Unfortunately, HADR rolling upgrade can not be done between major versions.

   Tomas Helgi
QUIESCE instance ... restricted access command might work to stop applications from connecting to the database while you ensure that the LOGS are in sync.
However, I have to admit that I have not used that command when upgrading a database in my process as I have described earlier. And I have not checked what affect it has on the HADR sync process.
You always have to end up with, in the process, to change the db2 client to point to the new server. However, this might give you some space to work on the database without any connections interrupting or adding data to the database while you ensure that the logs on the primary and standby are in sync.

    Tomas Helgi
Avatar of waynezhu

The preferred menthod is shutdown the Primary, which leaves the Primary intact, and  "takeover by force"  the Standby. For concern of data loss, you can always check what is the last log being archived on the Primary and what is the last log being applied on the Standby.
Hi Jim,

Do you need more help with this?

    Tomas Helgi

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo