Net8 Tracing

If you use the OCI driver, you can configure Net8 to trace your database communications. You can enable Net8 tracing on both the client and the server. Keep in mind, however, that enabling Net8 tracing translates into a substantial performance hit.

Client-Side Tracing

To enable client tracing, you add four parameters to your sqlnet.ora file, which is located in your $ORACLE_HOME\network\admin directory. The first of the four parameters is TRACE_LEVEL_CLIENT, and you can set it to one of the following four values:

0 or OFF
4 or USER
10 or ADMIN
16 or SUPPORT

For example, to turn tracing on and get the most amount of information, specify the following:

TRACE_LEVEL_CLIENT = SUPPORT

To turn tracing off, which you definitely want to do after your debugging session is complete, use 0 or OFF:

TRACE_LEVEL_CLIENT = OFF

The second parameter, TRACE_DIRECTORY_CLIENT, is used to specify the directory for the client-side trace files. Typically, this parameter is set as:

TRACE_DIRECTORY_CLIENT = $ORACLE_HOME/network/trace

You can, however, select any directory you wish as the destination directory for trace files.

Warning

On Windows machines, do not set TRACE_DIRECTORY_CLIENT to the root directory of a drive (e.g., c:\). If you do so, you won’t get any trace files even with tracing turned on.

The third parameter is TRACE_UNIQUE_CLIENT. This parameter can be set to ON or OFF. If you set it to OFF, then each session will use and overwrite the trace file. If it is set to ON, then the driver will append ...

Get Java Programming with Oracle JDBC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.