ORACLE/ADMIN2011. 5. 2. 21:36
반응형

In this Document
  Goal
  Solution
     Launch the Net Manager utility
     Enabling Oracle Net Client / Server tracing (or both).
      Enabling Oracle SQLNet Listener tracing.
     Cyclic Tracing
     Tracing Kerberos
     Tracing Externel Procedures (Extproc)
     Tnsping Trace
     Enabling Dynamic Listener Tracing
     Only for 11g
  References


Applies to:

Oracle Net Services - Version: 9.2.0.1.0 to 10.2.0.2.0
Information in this document applies to any platform.

Goal

This document covers how to use Oracle Net Manager tool to enable Oracle SQLNet Client, Server, Listener, Kerberos and External Procedure tracing.  It also includes how to control the size and amount of trace files produced and steps to start dynamic listener tracing.

Solution

Launch the Net Manager utility

 

Windows : Go to Start button, select the Oracle Home on which we are going to generate the tracing for. Net Manager is located under 'Configuration and Migration Tools' of the Oracle Home menu.

Unix : The tool can also be started remotely from a Microsoft Windows system with the help a terminal emulation software. You need to ensure this software is up and running first.  Ensure that the $DISPLAY, $ORACLE_HOME, and $PATH environment variables are properly set. The Net Manager tool is started by the command "netmgr".

[oracle@testnet ~]$ export DISPLAY=152.69.172.167:0.0
[oracle@testnet ~]$ . ora10gr2.env
The environment settings are performed for 10gr2 home
[oracle@testnet bin]$ pwd
/u01/ora10gr2/bin
[oracle@testnet ~]$ netmgr

 

After launching the Net Manager, the location of the network configuration files shown in the top of the Net Manager window.  Ensure this is the expected location. If it is not, you have TNS_ADMIN environment variable set, which is pointing the session towards a different location.

 

Enabling Oracle Net Client / Server tracing (or both).

 

A. Click on Profiles in the left panel. The right panel of Net Manager will now show more details.

B. Select General from drop down menu on the right panel of the Net Manager.

C. Select Tracing tab in the right panel. Client Information and Server Information is now seen.

D. Select the required Trace Level. Oracle Support usually requests level SUPPORT (also known as level 16). It is optional to provide a value for the Trace Directory and Trace File. If you do,  ensure that the directory exists and that the owner of the Oracle software is able to write to that directory. The default location for the trace files is the $ORACLE_HOME/network/trace directory. Default name is CLI.TRC

The Unique Trace File Name option for the Client Information section, will make unique trace files for every connection. Without this option selected, all client tracing goes into the one file.  If running Microsoft Windows, always set this parameter or there is the potential that the trace file with the error will be overwritten.  The Server does not have this parameter available.

E. If tracing is to be done on the Server and the connection model is Shared Server, then the Instance will have to be restarted for the Dispatchers to pick up the changes to the SQLNET.ORA file.

The SQLNET.ORA will now look like the following :

TRACE_LEVEL_CLIENT = SUPPORT
TRACE_UNIQUE_CLIENT = on
TRACE_LEVEL_SERVER = SUPPORT
TRACE_DIRECTORY_CLIENT = C:\TEMP
TRACE_FILE_CLIENT = CLIENT
TRACE_DIRECTORY_SERVER = C:\TEMP
TRACE_FILE_SERVER = SERVER
TRACE_TIMESTAMP_ CLIENT = ON
Note:If tracing is to be done on the Server and the connection model is Shared Server(MTS), then the Instance will have to be restarted for the Dispatchers to pick up the changes to the SQLNET.ORA file.

 Enabling Oracle SQLNet Listener tracing.

A. In the left panel of the Net Manager, select Listeners view.

B. Select the Listener you want to trace. Once selected the right hand panel will show more details.

C. Select General Parameters from the drop down button, in the right hand panel.

D. Select Logging & Tracing tab.

E. Click the Tracing Enabled radio button and select Trace Level. SUPPORT level is normally requested by Oracle Support.

Select a directory for the trace to be generated.

G. Listener will need to be restarted or reloaded to enable or disable tracing.
 

Note: Stopping a Listener does not effect existing connections.

 

The LISTENER.ORA will now have the following lines.

TRACE_FILE_LISTENER = LISTENER.TRC
TRACE_DIRECTORY_LISTENER = C:\TEMP
TRACE_LEVEL_LISTENER = SUPPORT

Cyclic Tracing

Adding parameters TRACE_FILENO_ and TRACE_FILELEN_ to the SQLNET.ORA or LISTENER.ORA files enables Oracle Net trace files to be limited a certain size and a certain number of files. Following example is for Listener traces of 10 MB, with a maximum of 10 files for a maximum of 100 Mb of trace files. Cyclic tracing can be configured for the Client, Server and Listener

TRACE_FILELEN_LISTENER=10240
TRACE_FILENO_LISTENER=10

TRACE_FILENO_{CLIENT/SERVER/listener_name}: When this parameter is set it will determine the maximum number of trace files that will be generated. Trace data will continue to generate but in a cyclic fashion. The maximum size of each file is set by configuring the appropriate TRACE_FILELEN parameter.

TRACE_FILELEN_{CLIENT/SERVER/listener_name}: When set determines the maximum size of each trace file before either starting a new trace file (if the TRACE_FILENO parameter is set) or will overwrites an existing file (cyclic tracing). Once the last trace file has been written, up to the size specified by TRACE_FILELEN_<CLIENT/SERVER/listener_name>, tracing will continue by overwriting the first trace file in the cycle.

Tracing Kerberos

Kerberos can be traced using the following parameters in the SQLNET.ORA file.
See Note 185897.1 Kerberos Troubleshooting Guide for more details.

TRACE_LEVEL_OKINIT=SUPPORT
TRACE_DIRECTORY_OKINIT=<VALID_DIRECTORY>
TRACE_FILE_OKINIT=<VALID_FILE_NAME>

 

Tracing Externel Procedures (Extproc)

External procedure can be traced using the following parameter in the SQLNET.ORA file, where extproc is setup.

TRACE_LEVEL_AGENT= SUPPORT
TRACE_DIRECTORY_AGENT = <VALID_DIRECTORY_PATH>
TRACE_TIMESTAMP_AGENT =ON

 

Tnsping Trace

TNSPING.TRACE_LEVEL = SUPPORT
TNSPING.TRACE_DIRECTORY = <path where tnsping.trc will go>

 

Enabling Dynamic Listener Tracing

There might be situations when you cannot reload or restart the listener to enable the traces.Such times, you can fmake use of the dynamic tracing for the listener .

LSNRCTL> set current_listener listener
Current Listener is listener
LSNRCTL> set trc_level 16
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "trc_level" set to support
The command completed successfully
LSNRCTL> set trc_directory /home/oracle
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "trc_directory" set to /home/oracle
The command completed successfully
LSNRCTL> exit

This would create sqlnet support level tracing on the listener under directory /home/oracle with name listener.trc

Only for 11g

11g has new method of tracing Automatic Diagnostic Repository(ADR)  which will create the trace to the ADR directories
Reference
Note 454927.1Using and Disabling the Automatic Diagnostic Repository (ADR) with Oracle Net for 11g

To create the trace files to the desired directory,
For client tracing & server tracing add:
DIAG_ADR_ENABLED= OFF


For listener tracing:
DIAG_ADR_ENABLED_<listener name> = OFF


Unable to start Net Manager

If Net Manager is unable to start, check that you are able to launch other GUI tools from the same server, where Net Manager is failing. For example the X-Window utility "xclock". If you are not able to launch xclock, you need to address this problem, before attempting to start Oracle GUI tools. If xclock works, check other Oracle GUI tools, like DBCA before reporting the issue to Oracle Support.

References

NOTE:374116.1 - How to Match Oracle Net Client and Server Trace Files
NOTE:454927.1 - Using and Disabling the Automatic Diagnostic Repository (ADR) with Oracle Net for 11g


반응형
Posted by [PineTree]