Most Oracle database connects are made through the use of an Oracle process called the LISTENER which monitors a certain machine and port for connection requests to one or more database instances. There are times when a DBA or SA will want to monitor connects being made through the listener for various reasons. This article covers the setup of ADMINISTRATIVE level tracing of you Oracle Listener and will work on UNIX, Linux, and Windows based machines.
1. Logon to your Oracle database server as the Oracle software owner.
2. Open up the LSNRCTL utility.
mylinux:>lsnrctl
LSNRCTL for LINUX: Version 10.2.0.4.0 – Production on 13-DEC-2009 15:17:05
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Welcome to LSNRCTL, type “help” for information.
LSNRCTL>
3. If you are not using the default name of the Oracle listener (LISTENER) then define the Oracle listener name with the following command: set current_listener LSNRCTL> set current_listener listener_orcl 4. If you have established a password for your oracle listener set it in the LSNRCTL session with the following command: set password LSNRCTL> set password oracle 5. Turn on admin level tracing by specifying 10 or admin as the level with the following command: set trc_level LSNRCTL> set trc_level 10 or LSNRCTL> set trc_level admin 6. Define the name of the trace file that will be produced by the listener process upon establishment of user connection with the command below: set trc_file LSNRCTL> set trc_file admin_access_trace NOTE: You do not have to set a trace directory by default the trace files are placed under: $ORACLE_HOME/network/trace 7. Save the changes made to the listener.ora file with the following command: save_config LSNRCTL> save_config 8. Exit out of LSNRCTL utility, change directories to ORACLE_HOME/network/trace, list the files present and you can see that the trace has already begun. LSNRCTL> exit 9. Logon to the RDBMS as sysdba and exit. mylinux:> sqlplus ‘system/devlmgr as sysdba’ SQL*Plus: Release 10.2.0.4.0 – Production on Sun Dec 13 15:44:02 2010 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Connected to: SQL> exit 10. Perform another listing of the files under the directory $ORACLE_HOME/network/admin and you will see that the file admin_access_trace.trc has grown by recording the connection from user in step 9. mylinux:> ls -lrt 11 This information can be used to show where connections in you database are coming from and other statistical information about the network connection being established with administrative options. Larry J. Catt, OCP 91, 10g
Current Listener is listener_orcl
LSNRCTL>
The command completed successfully
LSNRCTL>
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.110)(PORT=1521)))
listener_orcl parameter “trc_level” set to admin
The command completed successfully
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.110)(PORT=1521)))
listener_orcl parameter “trc_level” set to admin
The command completed successfully
LSNRCTL>
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.110)(PORT=1521)))
listener_orcl parameter “trc_file” set to admin_access_trace.trc
The command completed successfully
LSNRCTL>
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.110)(PORT=1521)))
Saved listener_orcl configuration parameters.
Listener Parameter File /opt/app/oracle/10.2.0/network/admin/listener.ora
Old Parameter File /opt/app/oracle/10.2.0/network/admin/listener.bak
The command completed successfully
LSNRCTL>
mylinux:> ls -lrt
total 1008
-rw-r—– 1 oracle dba 408755 Dec 13 15:25 listener_orcl.trc
-rw-r—– 1 oracle dba 43347 Dec 13 15:40 user_access_trace.trc
-rw-r—– 1 oracle dba 34150 Dec 13 15:42 admin_access_trace.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 –
64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
mylinux:>
total 1136
-rw-r—– 1 oracle dba 408755 Dec 13 15:25 listener_orcl.trc
-rw-r—– 1 oracle dba 43347 Dec 13 15:40 user_access_trace.trc
-rw-r—– 1 oracle dba 119638 Dec 13 15:47 admin_access_trace.trc
mylinux:>
oracle@allcompute.com
www.allcompute.com