There are other traces you can perform to diagnose problems. This section discusses:
Occasionally, DB2 Customer Service may request that you take an administration tools trace. This trace is intended for DB2's graphical administrative tools (such as the Control Center, the Alert Center, and the Command Center), and provides additional information when these tools encounter a problem accessing or using a database. (If you suspect the user interface itself to be the problem, take an ICLUI trace instead; see "Taking a Graphical Interface Trace".)
This trace is only recommended for problems that can be re-created. It provides detailed information on requests, connections, attachments to instances, CLI calls, DAS requests, API calls, and other activities that were happening when the problem occurs.
The format of the trace file is similar to the log file (see "Using the Administrative Tools Log"), except that more information is recorded.
Depending on how much information is written to it, the trace file can grow to the maximum file size imposed by the operating system. The file is overwritten the next time you perform an administration tools trace.
To invoke the administration tools trace facility:
set DBTTRACE=Y
set DBTTRACE_FILE=location
For example, the following command will send trace output to the file d:\aetrace:
set DBTTRACE_FILE=d:\aetrace
If you have problems with graphical interfaces on the Windows 95, Windows NT, or OS/2 operating systems, you can enable an ICLUI trace. This trace helps you diagnose problems with the user interface (for example, with windows or dialog boxes not appearing or not refreshing).
To invoke an ICLUI trace for the Control Center:
set ICLUI_TRACE=ON set ICLUI_TRACETO=STDERR
db2cc 2 > db2cc.out
In this example, the ICLUI trace will be stored in a file called db2cc.out. (The "2" is a filepointer to standard log (STDLOG), which is being redirected to db2cc.out.)
The CLI trace can be used for any CLI, ODBC, or JDBC application that connects to DB2 using the CLI Driver.
To turn on this trace facility, set the db2cli.ini keyword option TRACE on (1). CLI trace records are appended to the file specified by the TRACEFILENAME keyword, or placed in the directory specified by the TRACEPATHNAME keyword.
For example, to set up a CLI trace file that is written to disk after each trace entry, include the following lines in the common section of the initialization file (DB2CLI.INI).
[COMMON] TRACE=1 TRACEFILENAME=E:\TRACES\CLI\MONDAY.CLI TRACEFLUSH=1
In the above example:
Alternatively, you can use the keyword TRACEPATHNAME to store files in a particular subdirectory. For information, see the Installing and Configuring DB2 Clients online book.
You can configure the DB2 CLI/ODBC driver further by using the DB2 Client Configuration Assistant tool:
For more information on taking CLI traces, see the online help for ODBC data sources in the Client Configuration tool. For information on determining when to take the traces, see the CLI Guide and Reference.
The DB2 Connect trace (ddcstrc) is useful for diagnosing problems with the DB2 Connect product. For information, see the DB2 Connect User's Guide.
Use the DRDA trace (db2drdat command) to capture the DRDA data stream exchanged between a DRDA Application Requestor (AR) and the DRDA Application Server (AS). This tool is most often used for problem determination, but you can also use it for performance tuning in a client/server environment by determining how many sends and receives are required to execute an application. You need one of SYSADM, SYSCTRL, or SYSMAINT authority to use it.
The syntax for the db2drdat command is shown in the following diagram. Explanations of the parameters follow.
+-------+ +-on-+ V | >>-db2drdat--+-+----+---+--r-++--+-----------+-+--------------->< | +--s-+ +--l=length-+ | | +--c-+ | +-off--+--------------+-+--------++ +--t=tracefile-+ +--p=pid-+
Parameters
Logged CPI-C error information includes:
Note: Find out which process identifiers to trace from the agent field returned by the LIST APPLICATIONS command. For details, see the Command Reference.
Note: If tracefile is not specified, messages are directed to the db2drdat.dmp file in the current directory.
Notes:
DB2 generates alerts to notify database administrators or network administrators of a serious database error or database server error. It uses two standards of alerts: SNMP (see "SNMP Alerts"), and SNA (for communication with MVS/ESA, VM, VSE, or AS/400 systems).
When an SNA alert is generated, it includes different kinds of information about the problem that occurred. You can use this information to help correct whatever is causing a problem with SNA and APPC communications.
For information on taking an SNA trace, use the keywords "SNA trace" at the DB2 Product and Service Technical Library at: http://www.software.ibm.com/data/db2/library/