12/19/95 How To Perform a DB2 Trace on AIX, OS/2, & Windows SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT This document explains how to use the DB2 Independent Trace Facility. The DB2 Trace is used to gather diagnostic infor- mation for solving problems. This document explains how to use DB2 Trace on these platforms: o AIX (3.2.5 and 4.1) o OS/2 o DOS Windows These instructions should be applicable to Versions 1 and 2 of the DB2 for AIX, OS/2, and Windows products. For more information see the DB2 Problem Determination Guide for your platform. TAKING A DB2 TRACE IN AIX 1. Login as the instance owner. Turn on the trace, speci- fying 5 system errors and 2 million lines to be cap- tured. $ db2trc on -e 5 -l 2000000 2. Start running your application as normal. Once you encounter the error which initiated your need for the trace, dump the trace output. $ db2trc dump 3. Now turn the trace off. $ db2trc off 4. Ensure that the trace is formatable. $ db2trc fmt If the format completes successfully and did not 'wrap' then proceed to the steps for SHIPPING YOUR TRACE. Oth- erwise repeat steps 1 - 4, increasing the number of How To Perform a DB2 Trace on AIX, OS/2, 1 Windows 1 12/19/95 lines (-l flag) by 1 million. Repeat until the format does not 'wrap' If the trace wraps you'll see a line saying "trace wrapped" when you execute the "db2trc fmt..." command. TAKING A DB2 TRACE IN OS/2 1. db2trc on -e 5 -l 2000000 2. Start running your application as normal. Once you encounter the error which initiated your need for the trace, continue with the following: db2trc dump db2trc off 3. Format the trace db2trc fmt 4. See step 4 in the previous section for tips on format- ting and determining if the trace is 'wrapped'. TAKING A DB2 TRACE IN DOS WINDOWS 1. Turn the trace on by setting DB2TRACE=Y. From the DOS Command Line type: SET DB2TRACE=Y 2. Specify a file (other than db2win.trc) for trace output. Set DB2TRACENAME=. It is a good idea to specify the full path to the trace output file. SET DB2TRACENAME= 3. Set DB2TRCSYSERR=5. This will capture up to 5 system errors before shutting off the trace. SET DB2TRCSYSERR=5 Start running your application as normal. Once you encounter the error which initiated your need for the trace continue to the next step. 4. Set DB2TRACE=N. This turns the trace off. SET DB2TRACE=N Format the trace file. o Click on the File menu in Program Manager o Select the Run menu item. o When the Run window opens type: db2trcqw How To Perform a DB2 Trace on AIX, OS/2, 2 Windows 2 12/19/95 SHIPPING YOUR TRACE Via Internet Assuming you have FTP access to the Internet: ftp testcase.boulder.ibm.com Login as "anonymous". Passwd "userid@internet.address". ftp> cd /ps/toibm/db2 ftp> bin ftp> put ItemNumber.trc ftp> put ItemNumber.XXXX.trace An item number might look like AF1234 or BD1234. Make sure that your files show up and then quit out of FTP. ftp> ls ftp> quit Please update the support center from which you recieved your item number that the trace is in place. Via U.S. Mail or Shipping Company: First put the files on tape or diskette. Use the tar command and list all flags which you use. For OS/2 copy the files to disks. If you use any compression please make sure it is publicly available and list the name of the program. DO NOT encrypt these files as we may not have an algorithm to decrypt them. For tape: tar -xvf /dev/rmt0 ./tmp/trace.script ./ For diskette: tar -xvf /dev/fd0 ./tmp/trace.script ./ Mailing your Backups Mail backups to: AIX System Support DATAB 40-E3-02 1 East Kirkwood Blvd. Ronoake, TX 76299 Please include: 1. Item Number 2. Contact Name 3. Contact Phone Number How To Perform a DB2 Trace on AIX, OS/2, 3 Windows 3 12/19/95 4. Exact command used to backup the files (Not required if you used the commands listed in this document.) FURTHER CONSIDERATIONS If at any time you find a command not working, call your support center for further assistance. Once the trace is in place the Technical specialist working with your item will attempt to determine the cause of the system problems. For additional information refer to the DB2 Problem Determi- nation Guide for your platform. For Windows refer to the Installing and Using DB2 Clients for Windows Manual. These items can be requested by calling (U.S.) 1-800-879-2755. How To Perform a DB2 Trace on AIX, OS/2, 4 Windows 4 12/19/95 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: ______________________________________________________________________ END OF DOCUMENT (db2trc.unix.os2.dbs) How To Perform a DB2 Trace on AIX, OS/2, 5 Windows 5