Changing the preferred replay member

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 that if a database is already active and in the desired role, the START HADR command will be a nop (no operation performed) that returns an error, and the preferred replay member is not updated. Use the following procedure to designate or redesignate the preferred replay 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, it still 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.

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.