IBM Support

Collecting JDBC Driver Tracing in WebSphere Application Server

Question & Answer


Question

How can you enable JDBC driver tracing for various databases in IBM WebSphere Application Server?

Cause

Enabling JDBC driver level tracing in WebSphere Application Server provides the JDBC driver vendor with additional information for resolving JDBC driver or database-related issues.
Disclaimer
The main objective of this document is to help collect the specific JDBC driver tracing, IBM® Support might not have knowledge to review or provide any recommendation from the trace.

Answer

DB2® JDBC Driver Tracing Configuration:
  • DB2® Universal JDBC driver:
  • The DB2® JDBC driver allows trace configuration through the following data source custom properties:
    • traceLevel – Set to “-1” by default to capture all JDBC driver trace data. If instructed by DB2® support, it can be set to another value (see table) to collect a subset of the JDBC driver tracing.
      TRACE_ALL = -1 TRACE_PARAMETER_META_DATA = 256
      TRACE_NONE = 0 TRACE_DIAGNOSTICS = 512
      TRACE_CONNECTION_CALLS = 1 TRACE_SQLJ = 1024
      TRACE_STATEMENT_CALLS = 2 TRACE_XA_CALLS = 2048
      TRACE_RESULT_SET_CALLS = 4 TRACE_META_CALLS = 8192
      TRACE_DRIVER_CONFIGURATION = 16 TRACE_DATASOURCE_CALLS = 16384
      TRACE_CONNECTS = 32 TRACE_LARGE_OBJECT_CALLS = 32768
      TRACE_DRDA_FLOWS = 64 TRACE_SYSTEM_MONITOR = 131072
      TRACE_RESULT_SET_META_DATA = 128 TRACE_TRACEPOINTS = 262144
    • traceFile – Can be set to a specific file or if left blank (by default), the JDBC driver trace can be written to the WebSphere Application Server trace file
      • If the value is null and the WAS.database=all or com.ibm.ws.db2.logwriter=all is included in the WebSphere Application Server trace specification, then the trace is integrated with the WebSphere Application Server trace
    • Append the following to a WebSphere Application Server connection pool trace:
      • WAS.database=all OR com.ibm.ws.db2.logwriter=all
      • The “WAS.database=all” trace property allows an integrated trace to enabled and disabled at run time.
      • If the value is null and the WAS.database=all and com.ibm.ws.db2.logwriter=all trace specifications are not set, then driver tracing is not logged
      • If a value is defined such as “C:\DB2\jcctrace.log”, then the driver trace is written to the specified log file
    • traceFileAppend – If the traceFile property is set to a specific file, it causes new tracing to append to, or overwrite, that file. If the value is true, new trace data is appended to the current file. If the value is false, the current file is overwritten.
 
  • Oracle JDBC Driver Tracing Configuration:
    • Reconfigure the Oracle JDBC Provider to use a debug JAR file
      • Oracle ships several files for each version of the JDBC drivers. Therefore, the optimized JAR file does not contain any logging code and do not generate any log output when used. To get log output, you must use the debug JAR file, which is indicated with a "_g" in the file name, such as ojdbc7_g.jar.
      • On the JDBC Provider classpath, remove the ojdbc7.jar and replace it with ojdbc7_g.jar.
      • If you are using more than one Oracle JDBC Provider in your WebSphere Application Server environment (for example ojdbc6.jar and ojdbc6_g.jar), it is possible that the Oracle JDBC-Driver traces are still missing. In order to avoid this problem, make sure that all Oracle JDBC Providers use the option "Isolate classloader".
    • Append the following to a WebSphere Application Server connection pool trace:
      • oracle.*=all for Oracle version 11 and newer
      • com.ibm.ws.oracle.logwriter=all or WAS.database=all for Oracle version 10 and older
      • Logs all the details. This level is the most detailed logging.
    • Activate the Debug Library by setting the following JVM argument on the application server:
      • -Doracle.jdbc.Trace=true
         
    The application server JVM must be restarted after the changes were made to use the debug JAR file.
    If you need help with analyzing the JDBC driver tracing, contact your JDBC driver vendor.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB Connections\/Connection Pooling","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.5;8.0;7.0","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 September 2020

UID

swg21654565