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

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
the Primary Package1 went down, and the respective Standby Package1 is now running as primary
HADR. In this case, the package attempts to come up as standby. However, if it fails to come up
as standby, 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 the 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 package (which
is now standby), continues to run as standby.
When primary and standby packages perform failover
Figure 16 Primary and standby packages in the same cluster to perform failover
In this configuration, primary and standby packages are configured in the same cluster to provide
high availability and role management at the instance level. Here, if any one of the databases or
the instance fails on the node hosting the primary databases, all the packages configured for that
instance are halted on that node, and the packages fail over to the alternate node. Also, all the
corresponding standby packages perform role takeover.
In Figure 16, DB2 primary databases are configured in a volume group shared between Node1
and Node2. The standby databases are configured in a volume group shared between Node3
and Node4. HADR is configured between primary and standby databases. The instance and
HADR are packaged with ECMT DB2 toolkit and DB2 HADR toolkit, respectively.
Six packages, three each for primary and standby database are created. Primary packages are
configured to run either on Node1 or on Node2, and is currently running on Node2. If the primary
package fails on Node2, it fails over to Node1. In such a situation, all the packages running on
Node1 fail over to their respective standby packages and these standby packages perform role
takeover. Similarly, the standby packages are configured to run either on Node3 or Node4 and
are currently running on Node3. If the standby package fails on Node3, it fails over to Node4.
In such a situation, all the packages configured for the same instance fail over to the alternate
node. ECMT DB2 Package1 is configured to run either on Node1 or on Node2, and is currently
42 Serviceguard toolkit for DB2 High Availability Disaster Recovery