Creating event monitors

You create different types of event monitors by using variations on the CREATE EVENT MONITOR statement. You can use the options for that statement to specify the type of data that event monitors collect and how the event monitors produce their output. The sections that follow describe the different output options and how to create event monitors that produce these types of output.

Before you begin

Before creating an event monitor, it is important to understand the different options for the output that event monitors can produce. Most event monitors can produce output in at least two formats; some let you choose from up to four formats.

Procedure

To create an event monitor:

  1. Determine what kind of event monitor you need.
  2. Decide what type of output you want from the event monitor. Do you want data to be written to a regular table, an unformatted event table, a file, or a pipe?
  3. Issue a CREATE EVENT MONITOR statement.
  4. Optional: If the type of event monitor that you created requires activation, activate it by issuing the SET EVENT MONITOR STATE statement.
    By default, some event monitors activate automatically upon database activation; others require that you activate them manually. However, an event monitor created with the AUTOSTART option will not automatically be activated until the next database activation. Use the SET EVENT MONITOR STATE statement to force a recently-created event monitor into the active state. To determine whether an event monitor starts automatically, refer to the reference information for the relevant CREATE EVENT MONITOR statement.