You can enable tracing in Oracle Network Services at various levels, depending on what you're trying to troubleshoot. Here's a breakdown of the common tracing targets and when you might use them:
-
Listener Tracing:
-
Shared Server Tracing:
-
TNS Tracing (Client-Side and Server-Side):
Important Notes:
-
Trace File Location: Trace files are typically generated in the
diag/tnslsnr/<hostname>/listener/trace
or diag/rdbms/<dbname>/<instance>/trace
directory within the Automatic Diagnostic Repository (ADR).
-
Performance Impact: Tracing can have a performance impact, so use it judiciously and disable it when you're finished troubleshooting.
-
Security: Trace files may contain sensitive information (like passwords), so protect them accordingly.
Remember to analyze the trace files using tools like `trcasst` (for older versions) or `tkprof` to understand the network interactions and pinpoint the root cause of the problem.
The steps used to invoke tracing are outlined here. Each step is fully described in
subsequent sections. The first step is to choose the component to be traced. You may trace a client, a server, or a listener. The steps to enable
tracing are very simple:
- For any component, you can invoke tracing by editing the component configuration file that corresponds to the component traced. The component configuration files are listener.ora, sqlnet.ora or names.ora.
- Execute or start the component to be traced. If the trace component configuration files are modified while the component is running, the
modified trace parameters will take effect the next time the component is invoked or restarted. Instructions for each component follow:
- Be sure to turn off tracing when you do not need it for a specific diagnostic purpose.
Trace levels
You can set trace levels to provide different amounts of trace information. For each component, there are three levels of trace information:
- This default setting signifies that no trace output should be generated. The command is:
trace_level_client = off
- This setting is intended for DBAs who do not have extensive network knowledge. The USER trace level generates only English sentences
describing high-level significant networking events. The command is:
trace_level_client = user
- This setting is intended for network administrators with more knowledge of network terms and concepts. The ADMIN trace level generates all of the USER level statements plus additional information such as TNS addresses and detailed events. The ADMIN level of tracing provides the
highest level of detail about Oracle Network Connections. The command is:
trace_level_client = admin
Remember, the trace files are very large. If this parameter is set to USER or ADMIN, the number of large trace files created could interfere with
the available disk space on your machine. Therefore, turn on this parameter only for specific reasons and delete the resulting files when they are
no longer useful.
Note: If an existing trace file from a previous trace session exists and you need to retain the information in it, you will need to save that file under another name. Otherwise Oracle will overwrite the existing trace file.
Pinging Server
If you are having trouble pinging a server, and need a detailed trace, you can manually add the following two tracing parameters to your sqlnet.ora file to perform tracing on the TNSPING utility:
TNSPING.TRACE_LEVEL
TNSPING.TRACE_DIRECTORY
The next lesson discusses the location of the log and trace files on an Oracle server.