How to Trace the JDBC Driver (Doc ID 338433.1)
- Get link
- X
- Other Apps
In this Document
Applies to:JDBC - Version 11.2.0.1.0 to 23.5 [Release 11.2 to 23]Information in this document applies to any platform. GoalThe purpose of this document is to illustrate the JDBC tracing feature. This is also referred as JDBC logging. JDBC logging is now documented in the JDBC Developer's guide: Oracle Database JDBC Developer's Guide, 11g Release 2 (11.2) Part Number E16548-02 31 Diagnosability in JDBC Logging Oracle® Database JDBC Developer's Guide 12c Release 1 (12.1) E49300-05 32 Diagnosability in JDBC Logging JDBC Developer's Guide Release 19 34 Diagnosability in JDBC 34.1 About Logging Feature of Oracle JDBC Drivers JDBC Developer's Guide and Reference Release 21 36 Diagnosability in JDBC 36.1 About Logging Feature of Oracle JDBC Drivers
SolutionIn this 6 minute video, you will learn about JDBC logging and tracing A Quick Video on How to Enable Oracle JDBC Logging & Packet Tracing(Doc ID 2975841.1) Direct Link
The JDBC driver tracing facility utilizes the package java.util.logging. There are two ways to initiate JDBC tracing:
This document introduces the tracing loggers and levels then describes two approaches to implement tracing.
Tracing Loggers The user has fine grained control over the tracing by setting specific loggers. The tracing loggers are:
Tracing Levels For every logger there are different levels one can set. Depending on the information required one can specify general level with less output or very detailed output. The tracing levels can have the following values:
Tracing JDBC Using System Properties To enable the logging by using System properties you will need a so called properties file. The JDBC directory has a complete sample logging properties file called OracleLog.properties. This file is located in $ORACLE_HOME/jdbc/demo provided you have installed the demonstrations using the Database Companion CD. This file controls the tracing levels, tracing loggers, and output formatting. This approach offers the advantages of being able to set tracing without having to recompile the application. Use either the properties file provided in the demo directory or build your own based on the sample provided in this note. To use this way of tracing do following steps:
Tracing JDBC Using java.util.logging API You can programmatically enable or disable logging by using the Diagnosability MBean. Starting from Oracle Database 12c Release 2 (12.2.0.1), JDBC provides support for enabling and disabling feature-specific logging for selected features during runtime. See details in the documentation: https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/JDBC-diagnosability.html#GUID-37D49DEF-5A0C-4045-85EA-77DF3B6E4642
The following Technical Brief on the Oracle Technology Network (OTN) may also be helpful:
|
Join the Java Development MOS Community forum for general discussions, questions, best practices, and other valuable information on: Oracle JDeveloper and ADF, Oracle WebLogic - JEE Programming (EJB, JMS etc), Oracle JDBC, Oracle Web Services (incl. DBWS Callout Utility), Oracle Web Services Manager (OWSM), Oracle Service Registry (OSR), Oracle Toplink (EclipseLink), Sun NetBeans IDE / Java Studio Creator & Java Studio Enterprise, OC4J, KODO. |
References
NOTE:944655.1 - How to Limit JDBC Logging Output
NOTE:1050942.1 - How to Trace the Network Packets Exchanged Between JDBC and the RDBMS
|
- Get link
- X
- Other Apps




Comments
Post a Comment