PROCESS_PENDING_MIRROR_VERSION procedure

The PROCESS_PENDING_MIRROR_VERSION procedure handles a set of pending version entries in the Mirror Version List (MVL) by either permanently removing the pending entries or promoting the entries to become active.

When action has a value of APPLY, all pending version entries that match version-group and version-name are promoted to an applied state. These entries are then eligible to be activated at the time indicated by the ACTIVATION_TIME column in the MVL. If the activation time is IMMEDIATE, the pending entry is evaluated to determine if the active version or the node's version in the MVL should be updated. If the activation time is RESUME, the STATE for that entry is changed to APPLIED ADD or APPLIED REMOVE and any changes to the active version or the node's version in the MVL will occur the next time replication is resumed.

When action has a value of REMOVE, all the version entries with a STATE value of PENDING ADD or PENDING REMOVE that match version-group and version-name are removed from the MVL.

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

Read syntax diagramSkip visual syntax diagram PROCESS_PENDING_MIRROR_VERSION ( ACTION =>  action ,VERSION_GROUP =>  version-group ,VERSION_NAME => version-name,NODE => node )

The schema is QSYS2.

action
A character or graphic string expression that identifies the action to perform for the group of pending version entries.
APPLY
Each version entry in the MVL in a pending state that matches the specified version-group and version-name is promoted to an applied state. The ACTIVATION_TIME value for an entry determines whether the entry is immediately activated to the active state.
REMOVE
Each version entry in the MVL in a pending state that matches the specified version-group and version-name is permanently removed.
version-group
A character or graphic string expression that identifies the group name for a set of pending version entries.
version-name
A character or graphic string expression that identifies the version name for a set of pending version entries that are part of version-group.

If version-name is omitted, all pending entries that match version-group are processed.

node
A character or graphic string expression that identifies which Db2® Mirror nodes will process the action against the pending version entries that match the specified version-group and version-name.

If the procedure call includes performing the action on the target node and the version information entries cannot be processed, perhaps because the source node cannot communicate with the target node, the procedure returns an error SQLSTATE of '560DE'. If the procedure is able to process the action on the target node, but no version entries match the version-group and version-name, the procedure returns a warning SQLSTATE of '01532' from the target node.

BOTH
The action is performed on both the source node and the target node.
SOURCE
The action is performed only on the source node. This is the default.
TARGET
The action is only performed on the target node.

Examples

  • Add multiple pending entries for group name SOFTVEND02 with different version names on the source node.
    CALL QSYS2.ADD_MIRROR_VERSION(VERSION_GROUP      => 'SOFTVEND02', 
                                  VERSION_NAME       => 'APPLICATION_LIBRARY_01', 
                                  VERSION_IDENTIFIER => '6.2.25', 
                                  STATE              => 'PENDING',
                                  ACTIVATION_TIME    => 'IMMEDIATE'); 
    
    CALL QSYS2.ADD_MIRROR_VERSION(VERSION_GROUP      => 'SOFTVEND02', 
                                  VERSION_NAME       => 'APPLICATION_LIBRARY_02', 
                                  VERSION_IDENTIFIER => '2.123.1', 
                                  STATE              => 'PENDING',
                                  ACTIVATION_TIME    => 'IMMEDIATE');

    Attempt to promote all pending entries that match group name SOFTVEND02 on the source node to an applied state. Since the ACTIVATION_TIME for these entries is IMMEDIATE, Db2 Mirror evaluates the entries to determine if the active version or the node's version in the MVL needs to be changed.

    CALL QSYS2.PROCESS_PENDING_MIRROR_VERSION(ACTION        => 'APPLY',
                                              VERSION_GROUP => 'SOFTVEND02',
                                              NODE          => 'SOURCE');
  • Add multiple pending entries for group name SOFTVEND02 with the same version name APPLICATION_LIBRARY_03 but with different activation times on the source node. This first entry can only be applied and promoted to the active version when Db2 Mirror is resuming replication.
    CALL QSYS2.ADD_MIRROR_VERSION(VERSION_GROUP      => 'SOFTVEND03', 
                                  VERSION_NAME       => 'APPLICATION_LIBRARY_03', 
                                  VERSION_IDENTIFIER => '3.28.52', 
                                  STATE              => 'PENDING',
                                  ACTIVATION_TIME    => 'RESUME'); 

    This second entry for the same group name and version name can be applied and promoted to the active version immediately. The version 3.28.64 for this entry is also larger than the previous pending version of 3.28.52.

    CALL QSYS2.ADD_MIRROR_VERSION(VERSION_GROUP      => 'SOFTVEND03', 
                                  VERSION_NAME       => 'APPLICATION_LIBRARY_03', 
                                  VERSION_IDENTIFIER => '3.28.64', 
                                  STATE              => 'PENDING',
                                  ACTIVATION_TIME    => 'IMMEDIATE');

    Attempt to promote all pending entries that match group name SOFTVEND03 with version name APPLICATION_LIBRARY_03 on the source node to an applied state. Since the activation time for these pending entries differs, the activation time will be changed to RESUME for all the entries being promoted. This is done so Db2 Mirror can evaluate all the version entries together to determine if the active version or the node's version in the MVL needs to be changed.

    CALL QSYS2.PROCESS_PENDING_MIRROR_VERSION(ACTION        => 'APPLY',
                                              VERSION_GROUP => 'SOFTVEND03',
                                              VERSION_NAME  => 'APPLICATION_LIBRARY_03',
                                              NODE          => 'SOURCE');
  • Remove the set of pending entries for group name SOFTVEND02 with version name APPLICATION_LIBRARY_03 that exist on either node of the mirrored pair. If no matching pending entries are found on the target node, the procedure returns a warning SQLSTATE from the target node.
    CALL QSYS2.PROCESS_PENDING_MIRROR_VERSION(ACTION        => 'REMOVE', 
                                              VERSION_GROUP => 'SOFTVEND02', 
                                              VERSION_NAME  => 'APPLICATION_LIBRARY_03', 
                                              NODE          => 'BOTH');