16.8. Event Monitors

While Snapshot Monitors let you “take a picture” of your system at a given time, Event Monitors allow you to collect information based on an event. A typical example is the case of deadlocks. Since it is very difficult to determine when a deadlock is going to happen, taking a snapshot at the right time is almost impossible. Instead, you can use an Event Monitor, which will automatically collect the deadlock information when it occurs. Event Monitors can also be used to collect static and dynamic SQL statements.

The following example shows a sequence of statements that illustrate how to collect Event Monitor information using commands.

(1) create event monitor mymon1 for database, statements write to file 'e:\temp'(2) set ...

Get Understanding DB2®: Learning Visually with Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.