Monitoring by using exit points

If you need to programmatically monitor for important changes within Db2® Mirror, exit points are available. An exit program entry can be added for any of the following exit points by using the Add Exit Program (ADDEXITPGM) command or by finding the correct exit point within the Work with Registration information (WRKREGINF) and working with exit programs.

Table 1. Db2 Mirror exit points
Exit point Exit point format Description
QIBM_QMRDB_PRECLONE PREC0100 Db2 Mirror ASP preclone
QIBM_QMRDB_POSTCLONE PSTC0100 Db2 Mirror ASP post-clone
Start of changeQIBM_QMRDB_ROLE_CHGEnd of change Start of changeRCHG0100End of change Start of changeDb2 Mirror replication role changeEnd of change
Start of changeRCHG0200End of change
QIBM_QMRDB_SOFTCLONE SFTC0100 Db2 Mirror ASP post software reclone
QIBM_QMRDB_STATE_CHG SCHG0100 Db2 Mirror replication state change
SCHG0200
QIBM_QMRDB_VERSION VERI0100 Db2 Mirror generic versioning

Include: QSYSINC/H/MRDBEP

Authorities:
  • A user must have all object (*ALLOBJ) and security administrator (*SECADM) special authorities to add or to remove from exit programs an exit point.
Usage notes:
  • These exit points support more than one exit program.
  • The exit point ignores any return codes or error messages that are sent from the exit program.
  • The exit program must exist in a library in the system ASP or in a basic user ASP. The program will not be found if it exists in a library in an independent ASP.
  • Exit programs are local to the node where they are added. If you need to be notified of events on both nodes in the Db2 Mirror environment, you need to add an exit program on both nodes.

For more information about adding an exit program to an exit point, view Registration Facility.

QIBM_QMRDB_PRECLONE exit point

When an exit program is added to the QIBM_QMRDB_PRECLONE exit point, the exit program is called before the clone process.

When cloning SYSBAS, the exit program is called during the validation step before the clone. This step is done by the Db2 Mirror setup wizard, described in Validation and cloning. If not using the GUI, this step is completed by using the db2mtool command with the precheck action, described in the db2mtool command reference action=precheck. The exit program is called on the setup source node if it is registered there. If the setup copy node is accessible and the exit program is registered there, the exit program is also called on the setup copy node.

When cloning IASPs, the exit program is called before the IASP clone. The exit program is called on the setup source node if it is registered there and on the setup copy node if it is registered there. This step is done by the Db2 Mirror GUI when adding database IASPs. If not using the GUI, the exit program is called at the beginning of the db2mtool command with the iaspcopy action, described in the db2mtool command reference action=iaspcopy. For non-IBM® storage cloning, the exit program is called when running the db2mtool command with the preiaspcopy action, described in the db2mtool command reference action=preiaspcopy.

The exit program runs in a QZRCSRVS job that uses the authority of the user that is performing the clone.

Table 2. PREC0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 ASP group name Input CHAR(10)
2 Clone source Input CHAR(6)
ASP group name
INPUT; CHAR(10)
Identifies the name of the independent auxiliary storage pool (IASP) group. Can contain the following value:
  • *SYSBAS
Clone source
INPUT; CHAR(6)
Identifies the clone role of this node. Valid values are:
SOURCE
The setup source node
TARGET
The setup copy node

QIBM_QMRDB_POSTCLONE exit point

When an exit program is added to the QIBM_QMRDB_POSTCLONE exit point, the exit program will be called after the clone process.

When cloning SYSBAS, the exit program will be called during the validation step after the clone. The exit program is always called on both the setup source node and the setup copy node because the registration from the source node is cloned to the setup copy node. This step is done by the Db2 Mirror GUI setup wizard, described in Validation and cloning. If not using the GUI, this step is performed that uses the db2mtool command with the checksysbas action, described in the db2mtool command reference action=checksysbas.

When cloning IASPs, the exit program will be called after the IASP clone. The exit program is called on the setup source node if it is registered there and on the setup copy node if it is registered there. This step is done by the Db2 Mirror GUI when adding database IASPs. If not using the GUI, the exit program is called at the end of the db2mtool command with the iaspcopy action, described in the db2mtool command reference action=iaspcopy. For non-IBM storage cloning, the exit program is called when running the db2mtool command with the postiaspcopy action, described in the db2mtool command reference action=postiaspcopy.

The exit program runs in a QZRCSRVS job that uses the authority of the user that is performing the clone.

Table 3. PSTC0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 ASP group name Input CHAR(10)
2 Clone source Input CHAR(6)
ASP group name
INPUT; CHAR(10)
Identifies the name of the independent auxiliary storage pool (IASP) group. Can contain the following value:
  • *SYSBAS
Clone source
INPUT; CHAR(6)
Identifies the clone role of this node. Valid values are:
SOURCE
The setup source node
TARGET
The setup copy node

QIBM_QMRDB_ROLE_CHG exit point

Start of changeWhen an exit program is added to the QIBM_QMRDB_ROLE_CHG exit point under either the RCHG0100 or RCHG0200 format, the exit program is called each time the role of the Db2 Mirror node is changed. The exit program is called when the role is changed from the Db2 Mirror GUI, the QSYS2.SWAP_MIRROR_ROLES procedure, or when automatic takeover is enabled. The role change exit program is not called when the Db2 Mirror GUI is used to force a node to TRACKING state or the FORCE parameter is specified on the QSYS2.SWAP_MIRROR_ROLES procedure.End of change

The exit program is called within the job performing the role swap with the authority of that user.

Table 4. RCHG0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 Current replication role Input CHAR(9)
2 Previous replication role Input CHAR(9)
Current replication role
INPUT; CHAR(9)
Identifies the new (current) role for SYSBAS on this node. Valid values are:
  • PRIMARY
  • SECONDARY
Previous replication role
INPUT; CHAR(9)
Identifies the previous role for SYSBAS on this node. Valid values are:
  • PRIMARY
  • SECONDARY
Start of change
Table 5. RCHG0200 Exit Point Format
Parameter Description Input or Output Type and Length
1 Current replication role Input CHAR(9)
2 Previous replication role Input CHAR(9)
3 Replication role change source Input CHAR(6)
End of change
Start of change
Current replication role
INPUT; CHAR(9)
Identifies the new (current) role for SYSBAS on this node. Valid values are:
  • PRIMARY
  • SECONDARY
Previous replication role
INPUT; CHAR(9)
Identifies the previous role for SYSBAS on this node. Valid values are:
  • PRIMARY
  • SECONDARY
Replication role change source
INPUT; CHAR(6)
Identifies the source of the replication role change for SYSBAS on this node. Valid values are:
SYSTEM
The role change was initiated by the system when either automatic takeover for unplanned outages or automatic role swap for planned outages is enabled.
USER
The role change was initiated by the user by using either the Db2 Mirror GUI or the QSYS2.SWAP_MIRROR_ROLES procedure.
End of change

QIBM_QMRDB_SOFTCLONE exit point

When an exit program is added to the QIBM_QMRDB_SOFTCLONE exit point under format SFTC0100, the exit program is called when synchronization is complete for a Db2 Mirror software reclone for SYSBAS or any database independent auxiliary storage pool (IASP). The exit program is called on the software reclone source node if it is registered there and on the software reclone copy node if it is registered there.

The exit program runs within the QMRDBEEXIT job, which is submitted to run in the QSYSWRK subsystem that uses the QUSER user profile.

Table 6. SFTC0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 ASP group name Input CHAR(10)
2 Clone source Input CHAR(6)
ASP group name
INPUT; CHAR(10)
Identifies the name of the independent auxiliary storage pool (IASP) group. Can contain the following value:
  • *SYSBAS
Clone source
INPUT; CHAR(6)
Identifies the clone role of this node. Valid values are:
SOURCE
The source node
TARGET
The copy node

QIBM_QMRDB_STATE_CHG exit point

When an exit program is added to the QIBM_QMRDB_STATE_CHG exit point under format SCHG0100, the exit program is called each time the replication state changes for SYSBAS or any database independent auxiliary storage pool (IASP).

When an exit program is added to the QIBM_QMRDB_STATE_CHG exit point under format SCHG0200, the exit program is called each time the replication state or replication detail changes for SYSBAS or any database independent auxiliary storage pool (IASP).

The exit program might be called multiple times if a change to replication state or replication detail occurs for SYSBAS and multiple database IASPs.

The exit program runs within the QMRDBEEXIT job, which is submitted to run in the QSYSWRK subsystem that uses the QUSER user profile.

Table 7. SCHG0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 ASP group name Input CHAR(10)
2 Current replication state Input CHAR(12)
3 Previous replication state Input CHAR(12)
ASP group name
INPUT; CHAR(10)
Identifies the name of the independent auxiliary storage pool (IASP) group. Can contain the following value:
  • *SYSBAS
Current replication state
INPUT; CHAR(12)
Identifies the new (current) state for the IASP group or SYSBAS. Valid values are:
  • ACTIVE
  • BLOCKED
  • TRACKING
  • NOT MIRRORED
Previous replication state
INPUT; CHAR(12)
Identifies the previous state for the IASP group or SYSBAS. Valid values are:
  • ACTIVE
  • BLOCKED
  • TRACKING
  • NOT MIRRORED
Table 8. SCHG0200 Exit Point Format
Parameter Description Input or Output Type and Length
1 ASP group name Input CHAR(10)
2 Current replication state Input CHAR(12)
3 Current replication detail Input CHAR(13)
ASP group name
INPUT; CHAR(10)
Identifies the name of the independent auxiliary storage pool (IASP) group. Can contain the following value:
  • *SYSBAS
Current replication state
INPUT; CHAR(12)
Identifies the current replication state for the IASP group or SYSBAS. Valid values are:
  • ACTIVE
  • BLOCKED
  • TRACKING
  • NOT MIRRORED
Current replication detail
INPUT; CHAR(13)
Identifies the current replication detail for the IASP group or SYSBAS. Valid values are:
  • NONE
  • REPLICATING
  • SUSPENDED
  • SYNCHRONIZING

QIBM_QMRDB_VERSION exit point

When an exit program is added to the QIBM_QMRDB_VERSION exit point under format VERI0100, the exit program is called when a user supplied active version within the Mirror Version List (MVL) is changed. In addition, the exit program is called each time replication is resumed. The exit program allows for the node's version to be refreshed while determining the most recent active versions.

The exit program is called on the source node if it is registered there and on the target node if it is registered there.

The exit program is called within the job performing the change of the user supplied active version with the authority of that user.

Table 9. VERI0100 Exit Point Format
Parameter Description Input or Output Type and Length
1 Version group supplied Input CHAR(1)
2 Version group Input CHAR(10)
3 Version name supplied Input CHAR(1)
4 Version name Input CHAR(30)
Version group supplied
INPUT; CHAR(1)
Indicates whether version-group identifies a group name to filter upon. Valid values are:
Y
version-group parameter contains a group name
N
No group name is provided
Version group
INPUT; CHAR(10)
Identifies the version group search filter when version-group-supplied contains Y.
Version name supplied
INPUT; CHAR(1)
Indicates whether version-name identifies a version name to filter upon. Valid values are:
Y
version-name parameter contains a version name
N
No version name is provided
Version name
INPUT; CHAR(30)
Identifies the version name search filter when version-name-supplied contains Y.