IBM Support

Tech Tip: DB2 HADR Simulator

Technical Blog Post


Abstract

Tech Tip: DB2 HADR Simulator

Body

IBM DB2 Support has put out the following developerworks page:

IBM DB2 High Availability Disaster Recovery (HADR) Simulator

This simulator will help you to better tune DB2 HADR and the network settings with out impacting current performance on the system. It is recommended you run the simulator when the systems are most active. 

In addition you can use the db2flushsize.pl (perl script)  against the largest log files you have to find the largest flush size. Once you have the number you will need to * 4096, then use the number to increase the DB2_HADR_SOSNDBUF and DB2_HADR_SORCVBUF accordingly.

For example lets say if the largest flush size is 55 pages then DB2_HADR_SOSNDBUF and  DB2_HADR_SORCVBUF needs to be 55 * 4096 bytes or bigger.

run "db2flushsize <logFile1> <logFile2> ... <logFileN>|tee db2flushsize.out"

Click here is to download the db2flushsize.pl

You can also use the number for the -flushSize option in simhadr.

You need to first pick the simhader for you OS:

 

File name OS  OS version   Bit size   Architecture 
simhadr_aix AIX 6.1 64 powerpc
simhadr_aix53 AIX 5.3 64 powerpc
simhadr_hpia HP-UX 11.31 64 IA64
simhadr_linux Linux 2.6 64 x86_64
simhadr_linux32 Linux 2.6 32 x86
simhadr_linux_z Linux 2.6 64 s390x
simhadr_sun SunOS 5.10 64 sparc
simhadr_sunx86 SunOS 5.10 64 x86
simhadr_win.exe Windows (N/A) 32 x86
simhadr_win64.exe Windows (N/A) 64 x86
 

If you need the simulator on other platforms, email db2hadr@wwpdl.vnet.ibm.com

Once you have done that you need to run it on both the primary and standby. An example of this would be:

On the PRIMARY do:

simhadr -role p -syncmode HADR_SYNCMODE -t 30 -flushSize <value from db2flusgsize> -lhost HADR_LOCAL_HOST -lport HADR_LOCAL_SVC -rhost HADR_REMOTE_HOST -rport HADR_REMOTE_SVC -sockSndBuf DB2_HADR_SOSNDBUF -sockRcvBuf DB2_HADR_SORCVBUF

On the STANDBY:

simhadr -role s -lhost HADR_LOCAL_HOST-lport HADR_LOCAL_SVC -rhost HADR_REMOTE_HOST -rport HADR_REMOTE_SVC

The above commands are just examples you may need to add more or less flags, in addition you will need to fill in the values according to the db2 db cfg settings you have for each machine. For more information on the command options for simhadr see the following link:

HADR Simulator Command Line Options

In addition here are some other links that may help in tuning HADR better: 

Best Practices DB2 High Availability Disaster Recovery 

HADR Configuration and Tuning

High availability disaster recovery (HADR) performance

For additional tuning of HADR see the following two tools: 

DB2 Log Scanner 

HADR Calculator

Click here for step by step guide on using those tools.

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

UID

ibm11141060