Monitor trace
The monitor trace enables attached monitor programs to access Db2 trace data through calls to the instrumentation facility interface (IFI). Monitor programs can access the trace data asynchronously through an OPx buffer by issuing READA requests, or synchronously in the monitor return area by issuing READS requests.
Monitor trace has the following predefined trace classes that are used explicitly for monitoring. The following table shows the IFCIDs activated for each monitor trace class.
IFCID numbers are often presented in Db2 and its documentation with three or four digits and leading zeros. For example, you might find: "IFCID 1," "IFCID 001," or "IFCID 0001." However, you can assume that these references each have the same meaning.
| Class | Description of class | Activated IFCIDs |
|---|---|---|
| 1 | Standard accounting data. Class 1 is also activated when you omit the CLASS keyword from the START TRACE command when you start the monitor trace. |
200 |
| 2 | Entry or exit from Db2 event signaling. The information can be obtained by issuing a READS request for IFCID 147 or 148. In addition, monitor trace class 2 information is available in IFCID 3 in the accounting record. Monitor class 2 is equivalent to accounting class 2 and results in equivalent overhead. Monitor class 2 times appear in IFCIDs 147, 148, and 3 if either monitor trace class 2 or accounting class 2 is active. |
232 |
| 3 | Db2 wait time for I/O, locks; resource usage information. The information can be obtained by issuing a READS request for IFCID 147 or 148. In addition, monitor trace class 3 information is available in the accounting record, IFCID 3. As with monitor class 2, monitor class 3 overhead is equivalent to accounting class 3 overhead. When monitor trace class 3 is active, Db2 can calculate the duration of a class 3 event, such as when an agent is suspended due to an unavailable lock. Monitor class 3 times appear in IFCIDs 147, 148, and 3, if either monitor class 3 or accounting class 3 is active. |
6, 7, 8, 9, 32, 33, 44, 45, 117, 118, 127, 128, 170, 171, 174, 175, 213, 214, 215, 216, 226, 227, 242, 243, 321, 322, 378, 379, 382, 383, 413, 414 |
| 4 | Installation-defined monitor record. | 155 |
| 5 | Time spent processing IFI requests. | 187 |
| 6 | Changes to tables created with DATA CAPTURE CHANGES. | 185 |
| 7 | Entry or exit from Db2 event signaling for package accounting. The data traces the amount of time an agent spent in Db2 to process each package. If monitor trace class 2 is active, activating class 7 has minimal performance impact. Class 7 enables the IFCID 239 to be externalized. |
200, 232, 240 |
| 8 | Wait time for a package. If monitor trace class 3 is active, activating class 8 has minimal performance impact. Class 8 enables the IFCID 239 to be externalized. |
6, 7, 8. 9, 32, 33, 44, 45, 51, 52, 56, 57, 117, 118, 127, 128, 170,171, 174, 175, 213, 214, 215, 216, 226, 227, 239, 241, 242, 243, 321, 322, 378, 379, 382, 383, 413, 414 |
| 9 | Enables statement level accounting. Provides information about statement details in IFCID 148. |
124 |
| 10 | Package detail for buffer manager, lock manager and SQL statistics. It contains the same information as accounting class 10. Monitor records do not include class 10, but it shows up in IFCID 3 in the accounting record. Information from class 10 is written in additional sections of IFCID 239. However, monitor class 7 or 8 must be activated for IFCID 239 to be written. One of the following traces must also be activated before the IFCID 239 records are written:
|
239 |
| 11 | Plan-level accounting information. Class 11 is activated when you omit the CLASS keyword from the START TRACE command when you start the monitor trace. |
3, 200 |
| 12-28 | Reserved. | |
| 29 | Controls the
subsystem-wide collection of statistics for SQL statements. When monitor class 29 is activated, trace records are written for the following events:
|
316 , 318, 400, 401 |
| 30–32 | Available for local use. |

Monitor trace field (IFCID) descriptions
You can find descriptions of trace records in the IFCID flat file (DSNWMSGS). The most current version of DSNWMSGS is available only for clients who have Db2 13 for z/OS® licenses. The information is in a PDF file. To locate this information, see Db2 13 for z/OS IFCID flat file (DSNWMSGS).
