Trace output file analysis
The db2trc output file displays information about operations within the database and is used to troubleshoot the database.
- The process ID (PID) of the client application
- The RDB_NAME cataloged in the database connection services (DCS) directory
- The Db2 Connect CCSID(s)
- The IBM mainframe database server CCSID(s)
- The IBM mainframe database server management system with which the Db2 Connect system is communicating.
The first buffer contains the Exchange Server Attributes (EXCSAT)
and Access RDB (ACCRDB) commands sent to the IBM mainframe database server management
system. It sends these commands as a result of a CONNECT TO
database
command. The next buffer contains the reply that Db2 Connect received
from the IBM mainframe
database server management system. It contains an Exchange Server
Attributes Reply Data (EXCSATRD) and an Access RDB Reply Message (ACCRDBRM).
- EXCSAT
- The EXCSAT command contains the workstation
name of the client specified by the Server Name (SRVNAM) object, which
is code point X'116D', according to DDM specification. The EXCSAT command
is found in the first buffer. Within the EXCSAT command,
the values X'9481A292' (coded in CCSID 500) are translated
to mask once the X'116D' is removed.
The EXCSAT command also contains the EXTNAM (External Name) object, which is often placed in diagnostic information about the IBM mainframe database management system. It consists of a 20-byte application ID followed by an 8-byte process ID (or 4-byte process ID and 4-byte thread ID). It is represented by code point X'115E', and in this example its value is
db2bp
padded with blanks followed by000C50CC
. On a Linux® or UNIX IBM® data server client, this value can be correlated with the ps command, which returns process status information about active processes to standard output. - ACCRDB
- The ACCRDB command contains the RDB_NAME in
the RDBNAM object, which is code point X'2110'. The ACCRDB command
follows the EXCSAT command in the first buffer.
Within the ACCRDB command, the values X'E2E3D3C5C3F1' are
translated to STLEC1 once the X'2110' is removed. This corresponds
to the target database name field in the DCS directory.
The accounting string has code point X'2104'.
The code set configured for the Db2 Connect workstation is shown by locating the CCSID object CCSIDSBC (CCSID for single-byte characters) with code point X'119C' in the ACCRDB command. In this example, the CCSIDSBC is X'0333', which is 819.
The additional objects CCSIDDBC (CCSID for double-byte characters) with code points X'119D' and CCSIDMBC (CCSID for mixed-byte characters) with code point X'119E', are also present in the ACCRDB command. In this example, the CCSIDDBC is X'04B0', which is 1200, and the CCSIDMBC is X'0333', which is 819.
- EXCSATRD and ACCRDBRM
- CCSID values are also returned from the IBM mainframe database server in the Access RDB Reply Message (ACCRDBRM) within the second
buffer. This buffer contains the EXCSATRD followed by the ACCRDBRM. The example output file contains
two CCSID values for the IBM mainframe
database server system. The values are 1208 (for both single-byte and mixed byte characters) and
1200 (for double-byte characters).
If Db2 Connect does not recognize the code page coming back from the IBM mainframe database server, SQLCODE -332 will be returned to the user with the source and target code pages. If the IBM mainframe database server doesn't recognize the code set sent from Db2 Connect, it will return VALNSPRM (Parameter Value Not Supported, with DDM code point X'1252'), which gets translated into SQLCODE -332 for the user.
The ACCRDBRM also contains the parameter PRDID (Product-specific Identifier, with code point X'112E'). The value is X'C4E2D5F0F8F0F1F5' which is DSN08015 in EBCDIC. According to standards, DSN is Db2® for z/OS®. The version number is also indicated. ARI is Db2 Server for VSE & VM, SQL is Db2 database or Db2 Connect, and QSQ is IBM Db2 for IBM i.