Starting and stopping traces

You can trigger Db2 traces to start by time, periodic exception, exception event, or immediately. After you specified the trace criteria, a window is displayed where you complete the start criteria and define the stop criteria.

About this task

Which window is displayed depends on what you specified in the Trigger by field on the Trace Configuration window. Use these windows to specify the criteria that must be met before the collect task is automatically started or stopped. These windows are the same in appearance except for the start trigger specification section.

Because of the possibility of output buffer overruns, you must specify one of the stop conditions: Elapsed time or Number of records collected. Records can get lost if a buffer overrun occurs.

The Trigger by Time window (Figure 1) is displayed if you specified that the trace is triggered by time. Use this window to specify a particular output data set name, and to set the start and stop trigger criteria for the collect task. You can set the Db2 traces to start at a specified time, and to stop after a specified number of minutes have passed, a specified number of records or IFCIDs have been collected, or a thread matching the trace qualification criteria has terminated.

Figure 1. Trigger by Time window

  ┌-------------------------------------------------------------------------┐
  | DGOMAP40                    Trigger by Time                             |
  |                                                                         |
  | Task description . . . . . . : Collect data for acct/stats/audit        |
  |                                                                         |
  | Output Data Set for Db2 trace data to be written to                     |
  |   Name  . . . . . . . . . . . . DATASET1_______________________________ |
  |   Disposition . . . . . . . . . 1   1=Append                            |
  |                                     2=Overwrite                         |
  |                                     3=New                               |
  |                                                                         |
  | Start the Db2 traces at the following time                              |
  | 0   :  0   :  0   (hh:mm:ss)                                            |
  |                                                                         |
  | Stop the Db2 traces when any of the following conditions occur          |
  | _  Elapsed time  . . . . . . . . . . . . . . . 0      (seconds)         |
  | _  Number of records collected . . . . . . . . 0                        |
  |                                                                         |
  | Additional stop conditions                                              |
  | _  Thread termination                                                   |
  | _  Number of IFCIDs collected  . . . . . . . . 0                        |
  |    For IFCID . . . . . . . . . . . . . . . . . 55   +                   |
  |        Event: Set current SQLID                                         |
  |                                                                         |
  | Command ===> __________________________________________________________ |
  |  F1=Help    F2=Split   F3=Exit    F4=Prompt  F7=Up      F8=Down         |
  |  F9=Swap   F12=Cancel F16=Look                                          |
  └-------------------------------------------------------------------------┘

All trace data collected by the collect task is written to the data set specified in this window. If you specify a disposition of 3 (New), the data set is dynamically allocated with the following attributes:

RECFM:
VBS
LRECL:
32756
BLKSIZE:
6233

If you want to create the data set manually, it should have a variable record format and a record length (LRECL) of at least 4092.

Specify the time you want the Db2 traces to start for this task.

Select one or more of the trace stop triggers shown in this window and enter the required criteria for those triggers. The trace is stopped when any stop criteria is satisfied.

After you specified the required criteria in this window, press Enter to process the new values. Press Enter again or F3 (Exit) to return to the Collect Report Data panel.

The other trigger windows are the same as this window except for the start trigger section.
  • In the Trigger by Periodic Exception window, you can set the DB2 traces to start when a specified periodic exception has occurred.
  • In the Trigger by Exception Event window, you can set the DB2 traces to start when a specified exception event has occurred.
  • In the Trigger Immediately window, there are no start criteria because the Db2 traces are started immediately when the respective collect task is started in the Collect Report Data panel.

You can obtain a list of IFCIDs or exception field names by positioning the cursor under any field with a trailing plus sign (+) and pressing F4 (Prompt).