Technical Blog Post
Abstract
How to enable DB2 JDBC JCC trace on Tomcat and Weblogic
Body
In case of collecting DB2 JCC trace on client side, we can find the detail from the following link for standalone java and IBM WebSphere.
Collecting Data: Tracing with the IBM Data Server Driver for JDBC and SQLJ
Then, how can we do the same thing on other WAS products.
All WAS(Web application server) products are basically java processes.
Therefore no matter what product you are using, enabling DB2 JCC trace is not other than the following 3 steps from Java perspective.
1. Creating directory for dumping JCC trace files
2. Creating 'jcc.properties' file.
3. set the parameter '-Ddb2.jcc.propertiesFile' on Java runtime option.
Here are examples for Tomcat.
( I assume you are already using client application using DB2.
If you need to know how to set up DB2 client application environment on Tomcat, refer the following link as well.
50 DB2 Nuggets #40: Tech Tip - Configuring pureScale Client Affinity with Tomcat
)
<Tomcat>
Step 1. Create directory for dumping JCC trace files.
For example, I created 'bcc' directory under $TOMCAT_HOME/logs.
( NOTE : The path can be any directory where tomcat running user has write permission. )
$ mkdir jcc
Step 2. Create 'jcc.properties' on a directory.
For example, I created it under $TOMCAT_HOME/conf
$ pwd /home/tomcat/tomcat8026/conf $ cat jcc.properties db2.jcc.traceDirectory=/home/tomcat/tomcat8026/logs/jcc db2.jcc.traceFile=trace db2.jcc.traceFileAppend=false db2.jcc.traceLevel=-1 |
( NOTE : The path 'db2.jcc.traceDirectory' can be any directory.
But be sure that you set existing path. Otherwise, all applications will get into problem with java.io.FileNotFoundException error. )
Step 3. set the parameter on java option. ( $TOMCAT_HOME/conf/catalina.sh )
....<snippet>.... ### junsulee : DB2 jcc trace : put your full path for jcc.properties |
Then restart tomcat and run a DB2 client application on Tomcat.
Then you can see the JCC trace files on the directory.
$ ls /home/tomcat/tomcat8026/logs/jcc trace_global_1 trace_global_2 trace_global_3 trace_global_4 |
<Weblogic>
Basically the steps are same with step 1 and 2 on tomcat case above.
For the next, set the java option on the Weblogic start shell script.
Here I copied original lines and added the java option. Then, commented the original line.
.....<snippet>.... echo "starting weblogic with Java version:" ${JAVA_HOME}/bin/java ${JAVA_VM} -version if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
...<snippet>.... |
UID
ibm11140004