Creating an activity event monitor

To create an event monitor that captures activity events, use the CREATE EVENT MONITOR FOR ACTIVITIES statement.

Before you begin

You must have either DBADM or SQLADM authority to create an activity event monitor.

Procedure

To create an activities event monitor:

  1. Formulate a CREATE EVENT MONITOR FOR ACTIVITIES statement.
    For example, to create an event monitor called myactevmon, you might use a statement such as the one that follows:
    CREATE EVENT MONITOR myactevmon FOR ACTIVITIES 
        WRITE TO TABLE
        
  2. Run the statement.
    This example creates an activities event monitor called myactevmon with the following characteristics:
    • Monitor elements for all logical data groups that are applicable to activity event monitors are collected.
    • Output is written to relational tables. Default table names are assigned to each table.
    • The event monitor is configured to start automatically when the database is first activated.
    These results are due to using the default settings for activity event monitors. You can override the defaults if necessary.
  3. Activate the event monitor.
    Although the event monitor is configured to start automatically, it will not do so until the first database activation subsequent to the creation of the event monitor. To force the event monitor to start collecting data immediately, use the SET EVENT MONITOR STATE statement, as shown in the following example:
    SET EVENT MONITOR myactevmon STATE 1

What to do next

Configure the event monitor to collect the data that you want.