Creating an activity event monitor
To create an event monitor that captures activity events, use the CREATE EVENT MONITOR FOR ACTIVITIES statement.
You must have either DBADM or SQLADM authority to create an activity event monitor.
Before you begin
To create an activities event monitor:
- 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
- Run the statement. This example creates an activities event monitor called
myactevmonwith 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.
- 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
Configure the event monitor to collect the data that you want.