CHANGE_MIRROR procedure

The CHANGE_MIRROR procedure is used to manage Db2® Mirror.

Some options, including changing the replication state or the user-initiated Power Down System (PWRDWNSYS) option, affect both nodes. Other options only change the value on the current node. The individual option descriptions explain the scope of the change.

Start of change

Authorization: To change the parallel degree value or the spooled file resync interval, the privileges held by the authorization ID of the statement must include *JOBCTL special authority or QIBM_DB_SQLADM function usage authority.

To change the encrypted RDMA setting, the privileges held by the authorization ID of the statement must include *SECADM special authority.

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

End of change
Read syntax diagramSkip visual syntax diagram CHANGE_MIRROR ( IASP_NAME => iasp-name,REPLICATION_STATE => replication-state,AUTO_RESUME => auto-resume,PARALLEL_DEGREE => parallel-degree,SPLF_RESYNC_INTERVAL => splf-resync-interval,SWAP_ON_PWRDWNSYS => swap-on-pwrdwnsys,REPLICATE_USER_INDEX => replicate-user-index,REPLICATE_USER_SPACE => replicate-user-space,REPLICATE_DATA_QUEUE_ENTRIES => replicate-data-queue-entries,ENCRYPTED_RDMA => encrypted-rdma,AUTO_TAKEOVER => auto-takeover,RESUME_TYPE => resume-type )

The schema is QSYS2.

iasp-name

A character or graphic string that contains the device description name of the independent auxiliary storage pool (IASP) where the changes are to occur. For an IASP group, specify the device description name of the primary IASP. Can contain the following special value:

*SYSBAS
Changes apply 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.

replication-state

A character or graphic string that indicates how the replication state of the Db2 Mirror environment should be changed for SYSBAS or for the specified IASP. If this parameter is omitted, the replication state is not changed.

MAINTENANCE

Change the replication state of the primary node to TRACKING and the replication state of the secondary node to BLOCKED. All NRGs are ended and all the Db2 Mirror system jobs are ended on the node where the request for maintenance is run.

A suspend for maintenance is only allowed when iasp-name is *SYSBAS. SYSBAS and any active IASPs will be suspended.

When MAINTENANCE is in use, NRG links can be removed and Db2 Mirror PTFs can be applied. Some Db2 Mirror PTFs may require suspending for maintenance for the PTF to be activated.

RESUME

Initiate the process to resume replication on both nodes. Progress of this operation can be viewed through the REPLICATION_DETAIL column in the MIRROR_INFO view. Once completed, the replication state of both nodes will be changed to ACTIVE.

If iasp-name is *SYSBAS, the resume applies to SYSBAS and any suspended IASPs. If iasp-name refers to a specific IASP, the resume only applies to that IASP.

SUSPEND

Change the replication state of the primary node to TRACKING and the replication state of the secondary node to BLOCKED.

Suspend is only allowed when iasp-name is *SYSBAS. SYSBAS and any active IASPs will be suspended.

When suspended, some Db2 Mirror operations are allowed to run and communicate between the nodes. This includes changes to the Replication Criteria List (RCL) that deal with EXCLUDE rules and the Db2 Mirror compare tools.

The Db2 Mirror environment will automatically be put into a suspended state when the nodes cannot communicate with each other. If auto-resume is YES, resumption of replication will be attempted when communication between the nodes has been restored.

auto-resume

A character or graphic string that indicates if replication should automatically resume after being suspended. The initial configuration default is YES. If this parameter is omitted, the auto resume attribute is not changed. The attribute value can be set individually for SYSBAS and each IASP and applies to both nodes.

NO
Do not automatically resume replication.
YES
Automatically resume replication, when possible.

Replication will never automatically resume if replication was suspended due to an explicit user request or for a system crash where main store memory was not preserved.

parallel-degree

A character or graphic string that specifies the maximum degree of parallelism that can be used for Db2 Mirror resynchronization processing. The initial configuration default is NONE. If this parameter is omitted, the parallel degree attribute is not changed. Changing this value will not affect resynchronization that is currently active. The attribute value can be set individually for SYSBAS and each IASP on the current node.

If the Db2 Symmetric Multiprocessing (SMP) feature is not installed, SMP parallelism is not used.

2-256
The maximum degree of parallelism to be used.
NONE
No parallelism will be used.
splf-resync-interval

An integer value that specifies the amount of time, in seconds, that Db2 Mirror resynchronization processing should wait before looking for spooled files that need to be replicated. The value cannot be less than 2 seconds and cannot exceed 3600 seconds (60 minutes). The initial configuration default is 10 seconds. If this parameter is omitted, the spooled file resynchronization interval is not changed. A change to this value will take effect when the current interval wait time is reached. The attribute value can be set individually for SYSBAS and each IASP on the current node.

swap-on-pwrdwnsys

A character or graphic string that specifies the swap behavior when a user initiates a Power Down System (PWRDWNSYS) or End System (ENDSYS), or goes into restricted state with End Subsystem (ENDSBS) with SBS(*ALL) on the primary node. The swap behavior is performed for both OPTION(*CNTRLD) and OPTION(*IMMED). The initial configuration default is NO. If this parameter is omitted, the swap on PWRDWNSYS attribute is not changed. The iasp-name parameter does not apply to swap-on-pwrdwnsys and is ignored. The attribute value applies to both nodes.

NO
Do not swap roles.
YES
Automatically swap roles.
Start of changereplicate-user-indexEnd of change
Start of change

A character or graphic string that indicates whether user index objects (*USRIDX) are enabled for replication by Db2 Mirror for SYSBAS and for all configured IASPs. The initial configuration default is DISABLE. If this parameter is omitted, the replication of user indexes is not changed. The iasp-name parameter does not apply to replicate-user-index and is ignored. The attribute value applies to both nodes.

DISABLE
Disable replication of user indexes.
ENABLE
Enable replication of user indexes.

Enabling replication of user index objects requires a suspend and resume of replication. Disabling replication of user index objects occurs immediately when communications between the mirrored nodes is available, such as when replication is active. When replication is suspended, the request to disable user index objects replication may remain DISABLED PENDING until the next resume of replication.

End of change
Start of changereplicate-user-spaceEnd of change
Start of change

A character or graphic string that indicates whether user space objects (*USRSPC) are enabled for replication by Db2 Mirror for SYSBAS and for all configured IASPs. The initial configuration default is DISABLE. If this parameter is omitted, the replication of user spaces is not changed. The iasp-name parameter does not apply to replicate-user-space and is ignored. The attribute value applies to both nodes.

DISABLE
Disable replication of user spaces.
ENABLE
Enable replication of user spaces.

Enabling replication of user space objects requires a suspend and resume of replication. Disabling replication of user space objects occurs immediately when communications between the mirrored nodes is available, such as when replication is active. When replication is suspended, the request to disable user space objects replication may remain DISABLED PENDING until the next resume of replication.

End of change
Start of changereplicate-data-queue-entriesEnd of change
Start of change

A character or graphic string that indicates whether entries in a data queue (*DTAQ) are enabled for replication by Db2 Mirror for SYSBAS and for all configured IASPs. The initial configuration default is DISABLE. If this parameter is omitted, the replication of data queue entries is not changed. The iasp-name parameter does not apply to replicate-data-queue-entries and is ignored. The attribute value applies to both nodes.

DISABLE
Disable replication of data queue entries.
ENABLE
Enable replication of data queue entries.

Enabling replication of data queue entries requires a suspend and resume of replication. Disabling replication of data queue entries occurs immediately when communications between the mirrored nodes is available, such as when replication is active. When replication is suspended, the request to disable data queue entry replication may remain DISABLED PENDING until the next resume of replication.

End of change
Start of changeencrypted-rdmaEnd of change
Start of change

A character or graphic string that indicates whether encrypted RDMA is required. The initial configuration default for this setting is REQUIRED. If this parameter is omitted, the encrypted RDMA attribute is not changed.

A change to this setting will remain pending until the next time replication is ended and resumed.

NOT REQUIRED
Non-encrypted RDMA protocols may be used.
REQUIRED
RDMA protocols must be used.
End of change
Start of changeauto-takeoverEnd of change
Start of change

A character or graphic string that specifies if Db2 Mirror automatic takeover for an unplanned outage of the primary node is enabled. An unplanned outage takes place when a node detects that communication is not available with the other node. When enabled, Db2 Mirror attempts to transition to the secondary node during an unplanned outage of the primary node. The remaining active secondary node becomes the primary node with a replication state of TRACKING.

The initial configuration default is ENABLED.

If this parameter is omitted, the automatic takeover attribute is not changed. The iasp-name parameter does not apply to auto-takeover and is ignored. The attribute value applies to both nodes.

DISABLE
Disable automatic takeover for unplanned outages.
ENABLE
Enable automatic takeover for unplanned outages.
End of change
Start of changeresume-typeEnd of change
Start of change

A character or graphic string that specifies the type of resume requested. This parameter only applies when replication-state is RESUME.

If this parameter is omitted, the resume-type used by the process to resume replication is NORMAL.

ABNORMAL
The process to resume replication will proceed without completing all checks to determine if replication can be resumed safely. Replication will be allowed to resume even if a node has jobs with Db2 Mirror database connections that have not fully processed a previous suspend request.
NORMAL
The process to resume replication proceeds normally. All checks are performed to determine whether replication can be resumed safely on both nodes.
Note: An IBM® service representative must be contacted before attempting to resume replication with a resume-type of ABNORMAL. Resuming replication before all jobs have processed a previous suspend request could potentially cause replicated objects to become out-of-sync.
End of change

Examples

  • Configure Db2 Mirror to automatically resume after being suspended. This change only applies to SYSBAS.
    CALL QSYS2.CHANGE_MIRROR(AUTO_RESUME => 'YES');
  • Change the parallel degree on both nodes to 10. This value must be explicitly changed on each node.
    CALL QSYS2.CHANGE_MIRROR(PARALLEL_DEGREE => 10);
    CALL RMTNODE.QSYS2.CHANGE_MIRROR(PARALLEL_DEGREE => 10);