Thursday, June 30, 2011

Creating DB2 trace on Windows and i5/OS

While trying to connect to DB2 running on Windows machine from i5/OS it may occur that you're facing some DRDA related or any other connection problems. Here's what you can do to turn on the trace to get you some info as to what is going wrong.

On DB2 running on Windows:

db2trc on
/* Run recreate */
db2trc dmp dmpfile.txt
db2trc flw dmpfile.txt flwfile.txt
db2trc fmt dmpfile.txt fmtfile.txt
db2trc fmt dmpfile.txt fmtfiledrda.txt -c
db2trc off

The file fmtfiledrda.txt will have all the drda traces for the connection you've made from i5/OS. In case you see that this file is empty, it is possible that the DRDA connection failed at the source itself. In such situation you'll need to turn on the trace on the i5/OS machine itself.

Here's how you do it:

TRCTCPAPP *DDM

/* Run the recreate */

TRCTCPAPP *DDM *OFF


The above commands will cause the trace to get spooled over to QCNTRC. The trace file can be copied onto local machine from i5/OS like this:

CRTPF FILE(CHIGZ/QCNTRC) RCDLEN(512) MBR(*NONE) MAXMBRS(*NOMAX)
SIZE(*NOMAX)

CPYSPLF FILE(QCNTRC) TOFILE(CHIGZ/QCNTRC) SPLNBR(*LAST)

ftp xxxx

cd CHIGZ

get qcntrc.qcntrc

Labels: , , ,