Controlling the DB2 trace

DB2® provides commands for controlling the collection of trace data.

Before you begin

Begin general-use programming interface information.
To use the trace commands, you must have one of the following types of authority:

  • SYSADM or SYSOPR authority
  • Authorization to issue start and stop trace commands (the TRACE privilege)
  • Authorization to issue the display trace command (the DISPLAY privilege)

Procedure

To issue trace commands:

Select the appropriate command for the action that you want to take. The trace commands include:
START TRACE
Invokes one or more different types of trace.
DISPLAY TRACE
Displays the trace options that are in effect.
STOP TRACE
Stops any trace that was started by either the START TRACE command or as a result of the parameters that were specified during installation or migration.
MODIFY TRACE
Changes the trace events (IFCIDs) that are being traced for a specified active trace.

You can specify several parameters to further qualify the scope of a trace. You can trace specific events within a trace type as well as events within specific DB2 plans, authorization IDs, resource manager IDs, and locations. You can also control where trace data is sent.

When you install DB2, you can request that any trace type and class start automatically when DB2 starts.

End general-use programming interface information.