DB2 Version 9.7 for Linux, UNIX, and Windows

Trace CLI/ODBC configuration keyword

Turns on the CLI/ODBC trace facility.

db2cli.ini keyword syntax:
Trace = 0 | 1 | db2trc
Default setting:
No trace information is captured.
Equivalent environment attribute:
SQL_ATTR_TRACE
Usage notes:
 
Note: Starting in version 9.7 FP3, the CLI trace mechanism is also supported with instance-less clients, (IBM data server drivers).

When this option is set to value (1), CLI/ODBC trace records are appended to the file indicated by the TraceFileName configuration parameter or to files in the subdirectory indicated by the TracePathName configuration parameter. Trace CLI/ODBC configuration keyword will have no effect if neither TraceFileName or TracePathname is set.

The following example shows how to setup a CLI/ODBC trace file that is written directly to disk:
     [COMMON]
     Trace=1
     TraceFileName=E:\TRACES\CLI\MONDAY.CLI
     TraceFlush=1

When this option is set to value (db2trc), the trace facility of the DB2 instance or the DB2 Administration Server (DAS) will be started. The trace facility is controlled by the db2trc command and records information about operations and formats this information into readable form. Enabling the trace facility (OFF by default) might impact your system's performance. As a result, only use the trace facility when directed by a DB2 technical support representative; otherwise, turn off the trace once enough information has been recorded.

Setting the Trace CLI/ODBC configuration keyword to (db2trc) will automatically run db2trc on command with -cli option. To stop tracing, command db2trc off must be run by the user.

To create a CLI/ODBC trace file from the trace records recorded by the trace facility, the trace records must be dumped and formatted from the internal trace buffer. For example, after finishing tracing an application, the following steps should be followed to dump and format the CLI/ODBC trace:
  1. db2trc dump <dump_filename>
  2. db2trc off
  3. db2trc fmt -cli <dump_filename> <ODBC-CLI_trace_filename>
Setting the Trace CLI/ODBC configuration keyword to value (db2trc) provides better performance than value (1). Also, the dumped CLI Trace file is smaller than the CLI Trace file generated with Trace value (1). Using the Trace CLI/ODBC configuration keyword value (db2trc) starts the db2trc trace command with a default in memory trace buffer size. With larger CLI applications, the default trace buffer size may be insufficient to prevent trace records from wrapping. To avoid this limitation, run the command db2trc on with the -f parameter to trace to a file. Here is an example command for tracing CLI to a file named clitrc.dmp:
db2trc on -f clitrc.dmp -m *.*.CLITRC.*.*
After tracing to a file, the trace records do not need to be dumped, but do still require formatting to obtain a final CLI Trace file.

For more information about using the db2trc command, see db2trc Trace Command.

(This option is contained in the Common section of the initialization file and therefore applies to all connections to DB2® databases.)