This document describes how to enable Oracle JDBC driver trace when using a datasource in WebSphere Application Server
When debugging WAS + Oracle connection problems, it sometimes becomes necessary to enable Oracle JDBC driver tracing.
Resolving the problem
Set the following as a Generic JVM Argument on the application server (Servers > Server Types > WebSphere application servers > server_name. Then, in the Server Infrastructure section, click Java and process management > Process definition > Java virtual machine)
-Doracle.jdbc.Trace=true -Djava.util.logging.configureByLoggingPropertiesFile=true -Djava.util.logging.config.file=C:\WAS70\AppServer\profiles\AppSrvXML\logs\server1\OracleTrace\OracleTracing.properties
Replace the existing Oracle driver with the _g version of the driver (for example, ojdbc6_g.jar) in both the file system and in the Classpath field of the Oracle JDBC Provider configuration. The _g driver is a debug version of the driver and can be obtained from Oracle.
The Oracle document 30 Diagnosability in JDBC provides additional information on generating JDBC trace (see the section entitled Configuring Logging). The document refers to an OracleLog.properties file instead of OracleTracing.properties.