SWAP_MIRROR_ROLES procedure

The SWAP_MIRROR_ROLES procedure switches the roles of the nodes in the Db2® Mirror environment. The primary node becomes the secondary node and the secondary node becomes the primary node. Additionally, an IASP with a replication state of BLOCKED can be forced to begin tracking.

Authorization: For the authority needed to use this procedure, see Authorization.

Read syntax diagramSkip visual syntax diagram SWAP_MIRROR_ROLES ( IASP_NAME => iasp-name,ACTION => action )

The schema is QSYS2.

iasp-name
A character or graphic string that contains the device description name of the independent auxiliary storage pool (IASP) that is to be changed. For an IASP group, specify the device description name of the primary IASP. Can contain the following special value:
*SYSBAS
The change applies to SYSBAS. SYSBAS includes the system ASP (ASP 1) and the basic user ASPs (ASPs 2-32).
If this parameter is omitted, *SYSBAS is used.
action
A character or graphic string that specifies the action to perform.
FORCE
Force SYSBAS or the specified IASP to have a replication state of TRACKING. Using the FORCE option can potentially lose transactions that were recorded in the Object Tracking List (OTL) for changes made to replicated objects on the node that was previously tracking.
When iasp-name is *SYSBAS, the procedure can be run on either the primary node or the secondary node when the replication state is BLOCKED. When run on the secondary node, the secondary node will become the primary node.
When iasp-name is not *SYSBAS, the procedure must be run on the node where the IASP is varied on and the replication state of the IASP is BLOCKED.
See Force to TRACKING state for more details and restrictions.
NORMAL
The secondary node is changed to become the primary node. Both nodes remain active. This option is only allowed when the replication state of SYSBAS is ACTIVE. The procedure can be run on either node. This is the default.
When this option is used, iasp-name must be *SYSBAS.
See Swapping primary and secondary roles for more details and restrictions.

Example

  • In preparation to perform maintenance on the primary node, reverse the roles of the nodes used for replication. After calling the procedure, the current secondary node will be the primary node and the current primary node will be the secondary node.
    CALL QSYS2.SWAP_MIRROR_ROLES();
  • Force the secondary node to become the primary node when the secondary node is in blocked state. Any entries in the OTL on the primary node will be discarded.
    CALL QSYS2.SWAP_MIRROR_ROLES(ACTION => 'FORCE');