Changing the preferred replay member

In Db2 12.1.2 and earlier, the member topology must be the same in the two clusters. In Db2 12.1.3 and later, each of the clusters can have different member topologies, with the primary cluster having the same, more, or fewer members than the standby cluster. If the preferred member is dropped from the primary or standby cluster, it is recommended to designate a new preferred member.

About this task

The preferred replay member is the member that is preferred for replaying logs on an HADR standby database in a Db2® pureScale® environment. On a standby cluster, the preferred replay member might not be the member doing the actual replay. On the primary, it is the first member that the standby replay service attempts to start on if that primary becomes the standby. The preferred replay member designation is persistent and can only be changed by starting and stopping HADR.

You designate a preferred replay member by issuing the START HADR command on that member. If you want to change that designation, you have to reissue the command.
Note: If a database is already active and in the desired role, running the START HADR command results in a nop (no operation performed) that returns an error, and the preferred replay member is not updated.
The following procedure can be used to designate or redesignate the preferred replay member.

Procedure

To designate a preferred replay member


  • On the standby:
    1. Issue the DEACTIVATE DATABASE command from any member in the standby cluster.
    2. Issue the START HADR command with the AS STANDBY option on the member that you want to designate as the preferred replay member.
  • On the primary:
    1. Issue the STOP HADR command from any member in the primary cluster.
      Note: The primary remains active during this procedure.
    2. Issue the START HADR command with the AS PRIMARY option on the member that you want to designate as the preferred replay member.
      Note: This designation only takes effect if the primary database switches to the standby role.

Results

If the START HADR command completes successfully, the preferred replay member is updated. If the START HADR command fails, the preferred member might or might not have been updated, depending on how far the command execution went. To ensure that the designation applies to the correct member, rerun the procedure described in this task.