DB2 Version 9.7 for Linux, UNIX, and Windows

db2evtbl - Generate event monitor target table definitions command

Generates sample CREATE EVENT MONITOR SQL statements that can be used when defining event monitors that write to SQL tables.

Authorization

None

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2evtbl--+-----------------------+--+---------------+------->
             '- -schema--schema-name-'  '- -partitioned-'   

                              .-,----------.   
                              V            |   
>-- -evm--event-monitor-name----event type-+-------------------><

Command parameters

-schema schema-name
Schema name. If not specified, the table names are unqualified.
-partitioned
If specified, elements that are only applicable for a partitioned database environment are also generated.
-evm event-monitor-name
The name of the event monitor.
event type
Any of the event types available on the CREATE EVENT MONITOR statement, for example, DATABASE, TABLES, UNIT OF WORK.

Examples

db2evtbl -schema smith -evm foo database, tables, tablespaces, bufferpools

Usage notes

Output is written to standard output.

Defining WRITE TO TABLE event monitors is more straightforward when using the db2evtbl tool. For example, the following steps can be followed to define and activate an event monitor.
  1. Use db2evtbl to generate the CREATE EVENT MONITOR statement.
  2. Edit the SQL statement, removing any unwanted columns.
  3. Use the CLP to process the SQL statement. (When the CREATE EVENT MONITOR statement is executing, target tables are created.)
  4. Issue SET EVENT MONITOR STATE to activate the new event monitor.

Since all events other than deadlock event monitors can be flushed, creating more than one record per event, users who do not use the FLUSH EVENT MONITOR statement can leave the element evmon_flushes out of any target tables.