HP Serviceguard Toolkits for Database Replication Solutions User Guide, March 2012

Consider that ROLE_MANAGEMENT attribute is set to yes. If Node2 crashes when it is in the online
state, all the packages configured on Node2 fails over to the alternate node, Node1. The standby
HADR package uses the by force option to perform a role takeover, and thus becomes the new
primary database. All database clients reconnect to this database using the Automatic Client
Reroute feature of DB2 HADR. The standby package logs the result of success or failure of the role
takeover process in the package log, and then sends an email. When the primary package fails
over to Node1, it checks for the availability of primary database. Since the standby package has
performed role takeover, primary package starts the database as standby.
If the ROLE_MANAGEMENT attribute is set to no, behavior is the same as explained in Event2.
Event 5: Primary package is manually halted
If Primary Package1 is halted using the cmhaltpkg command, the corresponding Standby
Package1 does not perform a role takeover. It continues to run and logs a message in the package
log stating that the primary package is manually halted. There is no impact on the Primary Package2,
standby packages, and ECMT DB2 packages when the Primary Package1 is halted manually.
Event 6: The failed primary package restarts on the primary node
This scenario is a continuation of the events 2, 3, and 4. After the initial role takeover, Primary
Package1, which was originally configured as the primary package, attempts to start as the primary
package. It fails to come up as the primary package because a role takeover was performed when
it went down, and the respective Standby Package1 is now running as primary HADR. In such a
situation, the original primary package attempts to come up as standby. However, if it fails to
come up as the standby package, it halts the package, but if it is successful, it performs the following
tasks:
1. Syncs up with the new primary HADR and retrieves all the pending DB2 database archive
logs. This is a HADR feature and toolkit does not perform this task.
2. After the logs are in sync, the HADR on both nodes move to the Peer state.
3. If the RESTORE_ROLE package attribute is set to yes, the original primary package performs
a role switch to resume its role as the primary database. This automatically enables the original
standby database to resume as the standby database.
4. If the RESTORE_ROLE package attribute is set to no, the original primary (which is now
standby), continues to run as standby.
Creating packages
To create the primary and standby package:
1. Create a directory in /etc/cmcluster,
for example, /etc/cmcluster/hadr_primary.
2. cd the /etc/cmcluster/hadr_primary directory.
3. Create the DB2 HADR package configuration file:
NOTE: DB2 package must be created before creating the HADR package.
Combined Package: To create a combined package, run the following command:
cmmakepkg m ecmt/db2/db2 m tkit/db2hadr/db2hadr pkg.conf
Separate Package: To create a separate package, run the following command:
cmmakepkg -m tkit/db2hadr/hadr pkg.conf
where:
cmmakepkg is the Serviceguard command that is used to create the package.
ecmt/db2/db2 is the name of the ECMT DB2 toolkit module.
44 Serviceguard toolkit for DB2 High Availability Disaster Recovery