System Monitor Guide and Reference
The SET EVENT MONITOR STATE statement activates or deactivates an event
monitor. The current state of an event monitor (active or inactive) is
determined by using the EVENT_MON_STATE built-in function. The SET
EVENT MONITOR STATE statement is not under transaction control.
Scope
This statement can be embedded in an application program or issued through
the use of dynamic SQL statements. It is an executable statement that
can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement
cannot be dynamically prepared (SQLSTATE 42509).
Authorization
The authorization ID of the statement most hold either SYSADM or DBADM
authority (SQLSTATE 42815).
Command Syntax
>>-SET--EVENT--MONITOR--event-monitor-name--STATE--------------->
.-=-.
>----+---+--+-0-------------+----------------------------------><
+-1-------------+
'-host-variable-'
Command Parameters
- event-monitor-name
- Identifies the event monitor to activate or deactivate. The name
must identify an event monitor that exists in the catalog (SQLSTATE
42704).
- new-state
- new-state can be specified either as an integer constant or as
the name of a host variable that will contain the appropriate value at run
time. The following may be specified:
- 0
- Indicates that the specified event monitor should be deactivated.
- 1
- Indicates that the specified event monitor should be activated. The
event monitor should not already be active; otherwise a warning (SQLSTATE
01598) is issued.
- host-variable
- The data type is INTEGER. The value specified must be 0 or 1
(SQLSTATE 42815). If host-variable has an associated indicator
variable, the value of that indicator variable must not indicate a null value
(SQLSTATE 42815).
Sample Programs
- Although an unlimited number of event monitors may be defined, there is a
limit of 32 event monitors that can be simultaneously active (SQLSTATE
54030).
- In order to activate an event monitor, the transaction in which the event
monitor was created must have been committed (SQLSTATE 55033). This
rule prevents (in one unit of work) creating an event monitor, activating the
monitor, then rolling back the transaction.
- If the number or size of the event monitor files exceeds the values
specified for MAXFILES or MAXFILESIZE on the CREATE EVENT MONITOR statement,
an error (SQLSTATE 54031) is raised.
- If the target path of the event monitor (that was specified on the CREATE
EVENT MONITOR statement) is already in use by another event monitor, an error
(SQLSTATE 51026) is raised.
Usage Notes
- Activating an event monitor performs a reset of any counters associated
with it.
The following example activates an event monitor called SMITHPAY.
SET EVENT MONITOR SMITHPAY STATE = 1
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]