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.
Exit point | Exit point format | Description |
---|---|---|
QIBM_QMRDB_PRECLONE | PREC0100 | Db2 Mirror ASP preclone |
QIBM_QMRDB_POSTCLONE | PSTC0100 | Db2 Mirror ASP post-clone |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
||
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
- A user must have all object (*ALLOBJ) and security administrator (*SECADM) special authorities to add or to remove from exit programs an exit point.
- 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.
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)
- Clone source
- INPUT; CHAR(6)
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.
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)
- Clone source
- INPUT; CHAR(6)
QIBM_QMRDB_ROLE_CHG exit point
When 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.
The exit program is called within the job performing the role swap with the authority of that user.
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)
- Previous replication role
- INPUT; CHAR(9)
![Start of change](./delta.gif)
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](./deltaend.gif)
![Start of change](./delta.gif)
- Current replication role
- INPUT; CHAR(9)
- Previous replication role
- INPUT; CHAR(9)
- Replication role change source
- INPUT; CHAR(6)
![End of change](./deltaend.gif)
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.
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)
- Clone source
- INPUT; CHAR(6)
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.
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)
- Current replication state
- INPUT; CHAR(12)
- Previous replication state
- INPUT; CHAR(12)
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)
- Current replication state
- INPUT; CHAR(12)
- Current replication detail
- INPUT; CHAR(13)
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.
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)
- Version group
- INPUT; CHAR(10)
- Version name supplied
- INPUT; CHAR(1)
- Version name
- INPUT; CHAR(30)