Collecting report data with the Db2 START TRACE command

You can use the Db2 START TRACE command to obtain all types of Db2 trace data.

You need TRACE privilege or SYSOPR, SYSCTRL, or SYSADM authority to issue the command.

You can enter the command from an OS/390® console, the DSN command processor, the DB2I commands panel, an IMS or CICS® terminal, or the OMEGAMON® for Db2 PE Online Monitor.

The following diagram shows the command syntax.
Figure 1. Db2 START TRACE command syntax
Read syntax diagramSkip visual syntax diagramSTART TRACE( PASAUG )DEST( GTFSMFOPnOPX )CLASS( *,integer )IFCID( *,integer )AUTHID( *,authid )PLAN( *,plan-name )TDATA( CORCPUDIST )LOCATION( *,location name )

The START TRACE command accepts the following parameters and options:

Specifies the type of data to be traced.
Performance data
Accounting data
Statistics data
Audit data
Global data
Specifies the destination to which the traced data is directed. The destination can be the SMF (System Management Facility), the GTF (Generalized Trace Facility), or an OP buffer.

SMF and GTF are service programs that provide a means of recording performance data. SMF is usually used for continuous monitoring and is the default destination for Statistics, Accounting, and Audit traces. GTF is usually used for monitoring a specific problem when the amount of data is large.

If you want to direct a large volume of data to SMF, check the SMF buffer sizes to see whether they must be increased.

If you specify SMF as destination:
  1. Ensure that SMF is active before you start the trace. For more information, see z/OS® MVS™ System Management Facilities (SMF).
  2. Ensure that SMF collects the following records:
    • DB2 Accounting records (SMF type 101 records)
    • DB2 Audit records (SMF type 102 records)
    • DB2 Statistics records (SMF type 100 records)
    • DB2 Performance records (SMF type 102 records)
  3. Ensure that the SMF data sets and buffers are large enough to hold the data being collected. If the SMF buffers run out of space, SMF rejects any records while the shortage of space exists. Lost data cannot be recaptured. However, a long Statistics report or trace shows the number of records that have been lost in the DB2 IFC Destination block of the report.
Specifies one or more trace classes within the trace type.
Specifies one or more IFCIDs to be traced in addition to those contained in the specified trace classes.

If you want to exclusively trace the IFCIDs specified in the IFCID option, use trace classes 30-32. These trace classes have no predefined IFCIDs. Use this option with care, many reports have dependencies on several IFCID combinations. When the proper records are missing, OMEGAMON for Db2 Performance Expert cannot make the proper record relationships to produce a meaningful report.

Note: Use this option to start IFCID 381, IFCID 497, or IFCID 498. You cannot start these IFCIDs using a DB2 performance class.
Specifies authorization IDs and plan names to be traced.

Consider how you want to use the traced data. If you want to examine a specific problem, choose the authorization IDs and plan names based upon the application and users of the application to be monitored. If you are doing daily monitoring, select all AUTHIDs and PLANs to get an overview of the activity on your system.

Specifies the product section headers to be placed into the product section of each trace record. The product section of a trace record can contain multiple headers.

If you do not specify TDATA, the type of trace determines the type of product section header. By default, correlation headers and distributed headers (if present) are included. However, specifying CPU overrides the default so that only CPU headers are included. If you want CPU, correlation, and distributed headers, specify all.

All IFC records have a standard IFC header. The correlation header is added for Accounting, Performance, Audit, and Monitor records. The trace header is added for serviceability records. The headers relevant to OMEGAMON for DB2 PE are:
Table 1. Product section headers relevant to OMEGAMON for Db2 Performance Expert
Report set COR CPU DIST
Accounting Required Not used Required if distributed data is present
Audit Required Not used Required if distributed data is present
I/O Activity Required Not used Required if distributed data is present
Locking Required Not used Required if distributed data is present
Record Trace Used if present Used if present Required if distributed data is present
SQL Activity Highly recommended Recommended Required if distributed data is present
Statistics Not used Not used Required if distributed data is present
Utility Activity Required Recommended Required if distributed data is present
Specifies locations with distributed relationship to be traced. If specified, allied threads are excluded from the trace. Only allied-distributed threads and DBATs associated with the specified locations are traced. If you omit the LOCATION option, all threads (including allied threads) from all locations are traced.

You can specify up to eight locations. A separate trace is started for each location.

If you specify more than one PLANNAME or AUTHID, you can specify only one location.

You can specify the LUNAME of non-Db2 systems, in the form <luname>, in place of a location name.

LOCATION has no effect when Accounting class 2 is started.