0% found this document useful (0 votes)
2 views8 pages

Oracle DB SQL-Net Trace Procedure

The document outlines methods for enabling SQL*Net tracing in Oracle databases, including static and dynamic approaches. It details configurations for both server and client-side tracing, including specific parameters to set in the sqlnet.ora file. Additionally, it provides instructions for tracing with SQL*Developer and JDBC clients, along with references for further information.

Uploaded by

Mahesh Jnvbd
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
2 views8 pages

Oracle DB SQL-Net Trace Procedure

The document outlines methods for enabling SQL*Net tracing in Oracle databases, including static and dynamic approaches. It details configurations for both server and client-side tracing, including specific parameters to set in the sqlnet.ora file. Additionally, it provides instructions for tracing with SQL*Developer and JDBC clients, along with references for further information.

Uploaded by

Mahesh Jnvbd
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 8

Oracle DB SQL*Net Trace Procedure

The following is the static method of enabling SQL*Net tracing, via edits to the sqlnet.ora file.
This method requires a bounce of the DB to pick up the changes to sqlnet.ora.

There is a dynamic method (MOS Note 1550897.1) that is more complex but does not require a
DB outage. This can be useful if you need to enable limited tracing in a production environment
where bouncing the DB is not possible.

Table of Contents
References:............................................................................................................................1
Trace Levels (from 12c Net Svcs Admin Guide)....................................................................1
1. SERVER side tracing.............................................................................................................2
2. CLIENT side tracing...............................................................................................................3
2.A. SQL*Developer Tracing..................................................................................................4
FULL ORACLE CLIENT TRACING.......................................................................................4
JAVA NET TRACE with LISTENER.....................................................................................7
2.B. JDBC client-side tracing/logging.....................................................................................8

References:
● SQL*Net & Oracle Net Services - Tracing and Logging at a Glance (MOS Note 219968.1)
● 12c Database Net Services Administrator's Guide
● 12c Database Net Services Reference

Trace Levels (from 12c Net Svcs Admin Guide)


● off (equivalent to 0) provides no tracing.
● user (equivalent to 4) traces to identify user-induced error conditions.
● admin (equivalent to 6) traces to identify installation-specific problems.
● support (equivalent to 16) provides trace information for troubleshooting by Oracle
Support Services.
1.SERVER side tracing
For tracing of DB server processes, place the following lines in the sqlnet.ora file
(found in directory $TNS_ADMIN if set, else in $ORACLE_HOME/network/admin):

trace_level_server=16 16 is highest level, see here for level descriptions

trace_file_server=svr.trc Trace file name (suffix if unique)

trace_directory_server=/tmp/oracle Directory where trace files are written to

true= writes individual trace files per server process


trace_unique_server=true
false= writes all trace records into one file

Override ADR control of trace files, otherwise won’t get


diag_adr_enabled=off
written to above places

NB: Syntax and formatting errors in sqlnet.ora can be pernicious and


insidious!
2.CLIENT side tracing
For tracing of client processes, configure at the location where the client is initiated
(on target DB or on a remote client) by placing these lines in the active sqlnet.ora
(in directory $TNS_ADMIN if set, else $ORACLE_HOME/network/admin). Remote
client tracing requires the oracle client to be installed and used. See below for
special considerations to enable JDBC client tracing. If client is same as DB
targeted, file name or directory should be set differently from server tracing to
distinguish. Note these are all essentially the same as above but with the term
client in place of the term server.

trace_level_client=16 16 is highest level, see here for level descriptions

trace_file_client=cli.trc Trace file name (suffix if unique)

trace_directory_client=/<linux path> or
\<windows path> Directory where trace files are written to

true= writes individual trace files per client process


trace_unique_client=true
false= writes all trace records into one file

Override ADR control of trace files, otherwise won’t get


diag_adr_enabled=off
written to above places

NB: Syntax and formatting errors in sqlnet.ora can be pernicious and


insidious!
2.A. SQL*Developer Tracing

FULL ORACLE CLIENT TRACING

This approach requires that the platform where you want to trace under SQL*Developer also is
configured with the full Oracle Client stack. First ensure that this is the case. Then follow these
steps in SQL*Developer:

1. Tools > Preferences > Database > Advanced -- gets you to this screen.
2. Click the box for Use Oracle Client

3. Click the Configure button below that to set the client home directory as described in this
article. (In our testing, the instant client did not work!)

4. Click the box for Use OCI/thick driver under that.

5. Save. This will prompt a restart of SQL Developer.

6. Place the trace parameters in the sqlnet.ora file as outlined in the first section.
7. Open any database connection in SQL Developer and run these commands to show that the
configuration is functioning properly:

8. CONNECTION should show that the connection is using the OCI thick driver, which means it
should pick up the sqlnet.ora setings.

9. Run your sql, and close the connection.

10. Verify that trace files were generated in the appropriate directory as you specified in the
trace_directory_client parameter.
JAVA NET TRACE with LISTENER

https://support.oracle.com/epmos/faces/DocContentDisplay?id=1390063.1

This is another method documented by Oracle that might work, but may have issues:
1. Documentation only certifies compatible through SQL Developer version 4. Version 20 is now
available.
2. It creates an intermediary “listener” on the client that may cause issues
3. It would not necessarily provide the detail Oracle is asking for

However, it might be worth a try in some settings. However, on Horizon VDIs and VMs we will
still need the CyberArk people to perform many of the client-side steps.

The steps for this are:

1. Download this jar file to the client platform at c:\temp:

https://www.oracle.com/technetwork/database/enterprise-edition/jnettra
ce.jar
2. Run this command to set up the “listener” that will generate tracing on
connections to our problem database:

java -jar jnettrace.jar didmna250u-scan 1641 8090

8090 is just a random port on the client that will be used by the listener. You
can use any free port.
Following command can be used to check for example if the port <8090> is
free:
netstat -na |find "8090"
The port is free if no line is returned.

3. Start SQL Developer and use this jdbc connection string to create a
connection to the problem database:

dbc:oracle:thin:@<ipaddress_of_VM>:8090:pubuat01

note that you will need to specify the IP of the VM (client) server

Open the connection, and all network interactions will be written to trace files
named client_*.trc in the c:\temp directory.
2.B. JDBC client-side tracing/logging

JDBC clients don’t have the SQLNET tracing capability configured (unless it is
the Oracle thick JDBC client). There are some possibilities for client-side
information if you look into these references:

● java.util.logging white paper (2009) -- 11.2 and up?


● How to Perform the Equivalent of SQL*Net Client Tracing with Oracle
JDBC Thin Driver (MOS Note 793415.1) -- for pre-11.2?
● How to Trace the Network Packets Exchanged Between JDBC and the
RDBMS (MOS Note 1050942.1) -- for 11.2 and up

You might also like