Monitoring events

You can use IBM® Db2® Data Management Console to automate the monitoring of specific event types that occur on a connected Db2 database.

IBM Db2 Data Management Console uses event monitoring to track the following events as they occur on your Db2 database:
  • statistics events
  • activity events
  • locking events
  • utility events
Note: Event monitoring requires a repository database.

You can learn more about how Db2 monitors events here.

Event monitoring within IBM Db2 Data Management Console

Enabling event monitoring in your IBM Db2 Data Management Console monitoring profile automates the following tasks:
  • creating and enabling the event monitors and associated tables in the monitored database
  • setting necessary event monitor parameters (for the locking event monitor only)
  • transferring data from the event monitor tables to the IBM Db2 Data Management Console repository database
  • clearing data out of the event monitor tables after capture
  • setting up watchdog stored procedures and Administrative Task Scheduler (ATS) tasks in the monitored Db2 database to disable event monitoring, when needed.
Note: IBM Db2 Data Management Console retrieves event monitor data from the monitored database and stores it in its repository. To avoid performance issues, the console sets a limit on the maximum number of event monitor records retrieved from the monitored database for each data collection cycle.

For an activity event monitor, this limitation is set to 1000 rows as the default value. In a heavy workload environment, if more than 1000 event records are generated during one data collection cycle, the console will collect only the first 1000 rows and transfer to the repository tables by default.

For locking, utility, and statistics even monitors, this limitation is set to 5000 rows as the default value.

The default limitation on maximum number of rows can be modified through API. For example:

curl -X PUT https://ruili1.fyre.ibm.com:11081/dbapi/v4/monitorprofile/eventmonitor/activity 
  -H 'accept: application/json' 
  -H 'authorization: Bearer eyJraWQiOiJXVEkxNTkxMTUxMTgxNTE3b1BPaXJ0QkFVRGFTeHlXTmc3em0tTldVZnVHcHdUSVJnLXZTNHl4c3phdnFUcUhRcUxadzJreGV6bktGT3RxTzNQRDg3RFg2WnlxUkFueXhkUWhDRHlsV005V2JoUW1kUmY4a01sVk9MYzQ5Y2VSTmtWN0lOd053ckR5S0krWGt4S2FaemNkaWVlNHk1blg2MmliQTZKSlZLdnhFMVBMdFc5Z1dRZHRRbExCTEw5Z0tJZypuWWpHLXJWTnFwTkowbE9zQzkzYXBJeC1CUVYxbENXTkRCS1VyM244cmVyOVRLWWk4VXVIMUFsWDFMMVNQIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2xvY2FsaG9zdDoxMTA4MSIsImdlbmVyYXRlVGltZXN0YW1wIjoiMTU5MTc1NTYyMDMxNSIsImV4cCI6MTU5MTc4NDQyMCwiZXhwaXJlZFRpbWUiOiIxNTkxNzg0NDIwMzE1IiwidXNlcm5hbWUiOiJhZG1pbiJ9.ha2vXisHaaf_YzUrTVYFtjPbQvp0MVOr54EtcPH4KTujyUHrkm4znaijK-dws3VF4WqQ8jhWGm6_ar1rnNXZtgoJ9dvotlzCvFuirxt2w_C70sIq5nY1zB8LxYo3UuH8Eh4BlgD1XbUnpjhxBmes0t9SSCkDO3ToyOqL4W-P84X6k8KuxyVmGr5wCIVMV5ltZKtse52geNMsgn83o6-ypIUtwcPMjvA9eD0O9oQN3DXIRtQejFC-jqaMnNQZQBv6GFWOXHhvEZQ0UCfXS4M0O0a67RWm38mPdM_-RHq4EKCfybOeFNlJiXNIW-iHM0IVQ4QL9gRdxcdPK-49yfxDVw' 
  -H 'cache-control: no-cache' 
  -H 'content-type: application/json' 
  -H 'ucuserid: admin' 
  -H 'x-db-profile: rui0320' 
where the value of collect_data_number specifies the MAX_ROWS retrieved from the database. You must also add x-db-profile in the header to assign the database that is configured.

The details of all the objects created are given in the following sections. These objects are all automatically removed when the user disables the corresponding event monitoring features and when IBM Db2 Data Management Console is removed.

Locking event monitoring objects created by IBM Db2 Data Management Console

If the locking event monitoring is enabled, the IBM Db2 Data Management Console will create the following items in the monitored database:
  • A locking event monitor named RTMON_EVMON_LOCKING
  • The following event tables:
    • IBM_RTMON.LOCK_EVENT
    • IBM_RTMON.LOCK_PARTICIPANTS
    • IBM_RTMON.LOCK_PARTICIPANT_ACTIVITIES
  • A stored procedure IBM_RTMON.RTMON_EVMON_LOCKING_WATCHDOG
  • A Db2 ATS task named “Rtmon Evmon Locking Watchdog”
Note: IBM Db2 Data Management Console will also disable the legacy Data Server Manager locking event monitor named DB2DETAILDEADLOCK, if it is present. This prevents locking events from being monitored in two locations, and it avoids needing to periodically clean out the contents of the legacy event monitor to prevent the table space from filling up.

Activity event monitoring objects created by IBM Db2 Data Management Console

If the activity event monitoring is enabled, the IBM Db2 Data Management Console will create the following items in the monitored database:
  • An activity event monitor named RTMON_EVMON_ACTIVITIES
  • The following event tables:
    • IBM_RTMON.ACTIVITY_<timestamp>
    • IBM_RTMON.ACTIVITY_STMT_<timestamp>
    • IBM_RTMON.ACTIVITY_METRICS_<timestamp>
  • An activity event monitor named RTMON_EVMON_ACTIVITIES
  • A stored procedure IBM_RTMON.RTMON_EVMON_ACTIVITIES_WATCHDOG
  • A Db2 ATS task named “Rtmon Evmon Activities Watchdog”

Utility event monitoring objects created by IBM Db2 Data Management Console

If the utility event monitoring is enabled, the IBM Db2 Data Management Console will create the following items in the monitored database:
  • An utility event monitor named RTMON_EVMON_UTILITY
  • The following event tables:
    • IBM_RTMON.UTIL_COMMON
    • IBM_RTMON.UTIL_START
    • IBM_RTMON.UTIL_STOP
    • IBM_RTMON.UTIL_LOCATION
  • A stored procedure IBM_RTMON.RTMON_EVMON_UTILITY_WATCHDOG
  • A Db2 ATS task named “Rtmon Evmon Utility Watchdog”

Statistics event monitoring objects created by IBM Db2 Data Management Console

If the statistics event monitoring is enabled, the IBM Db2 Data Management Console will create the following items in the monitored database:
  • A statistics event monitor named RTMON_EVMON_STATS
  • The following event tables:
    • IBM_RTMON.HISTOGRAMBIN
    • IBM_RTMON.WLSTATS
    • IBM_RTMON.OSMETRICS // only for Db2 11.5 and above
    • IBM_RTMON.QSTATS // only for Db2 11.5 and above
    • IBM_RTMON.SCMETRICS // only for Db2 11.5 and above
    • IBM_RTMON.SCSTATS // only for Db2 11.5 and above
    • IBM_RTMON.SUPERCLASSMETRICS // only for Db2 11.5 and above
    • IBM_RTMON.SUPERCLASSSTATS // only for Db2 11.5 and above
    • IBM_RTMON.WLMETRICS // only for Db2 11.5 and above
  • A stored procedure IBM_RTMON.RTMON_EVMON_STATISTICS_WATCHDOG
  • A Db2 ATS task named “Rtmon Evmon Statistics Watchdog”