Writing Db2 log buffers to IFI
For diagnostic purposes, you might want to look at the contents of the Db2 log buffers as they are written to the active log.
For example, you might want to capture log records from the log buffers during the time a job experiences repeatable failures. You might want to interactively capture a copy of the log buffers which are written to the active log, such that the copies of the log CIs can be transported or placed in a remote or local data set.
-START TRACE(P) CLASS(30) IFCID(126) DEST(OPX)
- P signifies to start a Db2 performance trace. Any of the Db2 trace types can be used (accounting, statistics, performance, audit, monitor, global).
- CLASS(30) is a user-defined trace class (31 and 32 are also user-defined classes).
- IFCID(126) activates Db2 log buffer recording.
- DEST(OPX) starts the trace to the next available internal Db2 online performance (OP) buffer. The size of this OP buffer can be explicitly controlled by the BUFSIZE keyword of START TRACE. Valid sizes range from 256 KB to 16M, and the size must be evenly divisible by 4.
When the START TRACE command takes effect, from that point forward, until Db2 terminates, Db2 recovery log manager (RLM) begins writing 4 KB log buffer VSAM control intervals (CIs) to the OP buffer as well as to the active log. As part of the IFI COMMAND invocation, the application specifies an ECB to be posted and a threshold to which the OP buffer is filled when the application is posted to obtain the contents of the buffer. The IFI READA request is issued to obtain OP buffer contents.
CALL DSNWLI(READS,ifca,return_area,ifcid_area,qual_area)
IFCID 129 or IFCID 306 must appear in the IFCID area.