Specifies what APIs to trace using the CLI trace facility. If you do not set the TraceAPIList keyword, all APIs are traced.
db2 update cli cfg for section common using TRACEAPILIST API ID,API ID...
where API
ID is an integer that corresponds to the name of a CLI API.
You can find the mapping between API names and IDs in the /sqllib/include/sqlcli1.h file,
as shown in the following example:#define SQL_API_SQLALLOCHANDLE 1001
#define SQL_API_SQLFREEHANDLE 1006
#define SQL_API_SQLCLOSECURSOR 1003
#define SQL_API_SQLENDTRAN 1005
#define SQL_API_SQLCOLATTRIBUTE 6
#define SQL_API_SQLGETSTMTATTR 1014
#define SQL_API_SQLGETCONNECTATTR 1007
[ Process: 4453, Thread: 47717036514016 ]
[ Date & Time: 06/26/2009 03:14:51.158736 ]
[ Product: QDB2/LINUXX8664 DB2 v9.7.0.1 ]
[ Level Identifier: 08020107 ]
[ CLI Driver Version: 09.02.0000 ]
[ Informational Tokens: "DB2 v9.7.0.1","n090609","LINUXAMD6497","Fixpack 1" ]
[ Install Path:
/view/mayprasa_db2_v97fp1_linuxamd64_n090609_trc42/vbs/INST ]
[ db2cli.ini Location: /home/mayprasa/sqllib/cfg/db2cli.ini ]
[ CLI Driver Type: IBM DB2 Application Runtime Client ]
SQLAllocHandle( fHandleType=SQL_HANDLE_ENV, hInput=0:0,
phOutput=&00007fffb229a990 )
---> Time elapsed - 0 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +2.830000E-004 seconds
SQLSetEnvAttr( hEnv=0:1, fAttribute=SQL_ATTR_ODBC_VERSION, vParam=3,
cbParam=0 )
---> Time elapsed - +4.300000E-005 seconds
SQLSetEnvAttr( )
<--- SQL_SUCCESS Time elapsed - +1.800000E-005 seconds
SQLAllocHandle( fHandleType=SQL_HANDLE_DBC, hInput=0:1,
phOutput=&00007fffb229a8e4 )
---> Time elapsed - +3.600000E-005 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +4.480000E-004 seconds
SQLConnect( hDbc=0:1, szDSN="sample", cbDSN=-3, szUID="", cbUID=-3, szAuthStr="",
cbAuthStr=-3 )
---> Time elapsed - +2.000000E-005 seconds
( DBMS NAME="DB2/LINUXX8664", Version="09.07.0001", Fixpack="0x28020107" )
( Application Codepage=819, Database Codepage=1208,
Database XML Codepage=1208,
Char Send/Recv Codepage=819, Graphic Send/Recv Codepage=1200,
XML Send/Recv Codepage=1208 )
SQLConnect( )
<--- SQL_SUCCESS Time elapsed - +1.242704E+000 seconds
( DSN=""SAMPLE"" )
( UID=" " )
( PWD="" )
To trace only the SQLAllocHandle API,
issue the following command: db2 update cli cfg for section common using TRACEAPILIST 1001
where
1001 is the ID for the SQLAllocHandle API. The
CLI trace that is generated is similar to the following example:[ Process: 5977, Thread: 47628919556832 ]
[ Date & Time: 06/26/2009 03:17:25.066017 ]
[ Product: QDB2/LINUXX8664 DB2 v9.7.0.1 ]
[ Level Identifier: 08020107 ]
[ CLI Driver Version: 09.02.0000 ]
[ Informational Tokens: "DB2 v9.7.0.1","n090609","LINUXAMD6497","Fixpack 1" ]
[ Install Path:
/view/mayprasa_db2_v97fp1_linuxamd64_n090609_trc42/vbs/INST ]
[ db2cli.ini Location: /home/mayprasa/sqllib/cfg/db2cli.ini ]
[ CLI Driver Type: IBM DB2 Application Runtime Client ]
SQLAllocHandle( fHandleType=SQL_HANDLE_ENV, hInput=0:0,
phOutput=&00007fff3657bc70 )
---> Time elapsed - 0 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +2.720000E-004 seconds
SQLAllocHandle( fHandleType=SQL_HANDLE_DBC, hInput=0:1,
phOutput=&00007fff3657bbc4 )
---> Time elapsed - +8.000000E-005 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +4.250000E-004 seconds
SQLAllocHandle( fHandleType=SQL_HANDLE_DBC, hInput=0:1,
phOutput=&00007fff3657bbc4 )
---> Time elapsed - +1.303675E+000 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +1.920000E-004 seconds
SQLAllocHandle( fHandleType=SQL_HANDLE_DBC, hInput=0:1,
phOutput=&00007fff3657bbc0 )
---> Time elapsed - +1.154550E+000 seconds
SQLAllocHandle( phOutput=0:1 )
<--- SQL_SUCCESS Time elapsed - +1.320000E-004 seconds