Deactivating an event monitor

You can use event monitors to capture information related to many different kinds of events that take place on your system.

Enabling event monitoring in the monitoring profile of IBM Db2 Data Management Console creates the following event monitors and associated tables in the monitored database.
  • A locking event monitor named RTMON_EVMON_LOCKING
  • An activity event monitor named RTMON_EVMON_ACTIVITIES
  • An utility event monitor named RTMON_EVMON_UTILITY
  • A statistics event monitor named RTMON_EVMON_STATS
To verify the type of event monitor that is created in the monitored database and the current state of an event monitor (active or inactive), run the following command:
select evmonname,event_mon_state(evmonname) from syscat.eventmonitors

State "1" specifies the event monitor is active. State '0" specifies the event monitor is inactive.

IBM Db2 Data Management Console regularly copies data from the event monitor tables into its repository and removes the data from the monitored database. The console provides a "watchdog" feature that guarantees the event monitors that it is responsible to deactivate the event monitor if it loses contact with the monitored database. For example, if the console is shutdown for an extended period of time, or if it cannot reach the monitored database due to network problems.

The watchdog makes use of the Administrative Task Scheduler (ATS) to automatically disable the event monitors if the console goes down and requires ATS to be enabled in the monitored database. This feature is off by default.

To check if ATS is enabled in the monitored database, run the following command:
select NAME,PROCEDURE_SCHEMA,PROCEDURE_NAME from systools.admin_task_list
where PROCEDURE_NAME for the event monitors is provided below:
  • "Rtmon Evmon Utility Watchdog" for Utility event monitor
  • "Rtmon Evmon Activities Watchdog" for Activity event monitor
  • "Rtmon Evmon Locking Watchdog" for Locking event monitor
  • "Rtmon Evmon Statistics Watchdog" for statistics event monitor
Note: When the console goes down and if ATS is enabled in the console, the event monitors will be deactivated automatically in approx 20 minutes after the console is shut down.

When the console goes down and if ATS is not enabled, you may need to manually deactivate the event monitors because the event monitors will continue to be active on the monitored database and Db2 will continue to insert monitor data into the tables. In such cases, you may need to deactivate the monitoring profile where the database is assigned to, drop the existing event monitor, and remove the ATS procedure as shown in the following example:

To deactivate a statistics event monitor, run the following command:
set event monitor RTMON_EVMON_STATS state 0
To drop a statistics event monitor, run the following command:
drop event monitor RTMON_EVMON_STATS
To remove an ATS procedure for a statistics event monitor, run the following command:
drop procedure IBM_RTMON. RTMON_EVMON_STATISTICS_WATCHDOG
call sysproc.admin_task_remove('Rtmon Evmon Statistics Watchdog',null)