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.
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).
- 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.
- 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.
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');