The Oracle listener is a server program used to listen to all requests from the client and provide database services for it. Therefore, listener management and maintenance are very important. Ben
The Oracle listener is a server program used to listen to all requests from the client and provide database services for it. Therefore, listener management and maintenance are very important. Ben
-- ======================================
-- Oracle listener log configuration and management
-- ======================================
The Oracle listener is a server program used to listen to all requests from the client and provide database services for it. Therefore, listener management and maintenance are very important.
This document describes how to configure and manage Oracle listener log files.
For listener descriptions, see
Configure the ORACLE client to connect to the database
Configure dynamic service registration for non-default ports
Related reading:
Configuration of Oracle dual listener
Six connection problems and solutions for Oracle listeners
Listener Configuration for Oracle 11g2
Oracle Database Listener Suspension
Listener registration and ORA-12514 Error Analysis
1. Listener log features
1. The Listener log is a plain text file, usually located in the $ ORACLE_HOME/network/log directory, in the same path as the sqlnet. log file.
2. The default file name is listener. log. For non-default listeners, the generated log file is usually listenername. log.
3. This file is automatically created by the listener by default. When the log file is lost or does not exist, a file with the same name will be automatically created _ The. log file is similar
4. The size of the file will keep increasing automatically. When the size is too large or not easy to read, consider backing up the file.
5. Oracle listeners cannot delete or rename log files during runtime.
6. You can set the log status to ON or OFF to enable or disable logs.
2. Set the log file directory and Path
1. Set the log file directory in two ways
Lsnrctl SET LOG_DIRECTORY directory
LSNRCTL> SET LOG_DIRECTORY/usr/oracle/admin/log
2. Set log files in two ways
Lsnrctl SET LOG_FILE file_name
LSNRCTL> SET LOG_FILE file_name
3. Set the log status
Lsnrctl SET LOG_STATUS {on | off}
LSNRCTL> SET LOG_STATUS {on | off}
4. Demo settings
A. Switch to the log directory to view log files.
[Oracle @ test ~] $ Cd $ ORACLE_HOME/network/log
[Oracle @ test log] $ ls-hltr
Total 348 K
-Rw-r -- 1 oracle oinstall 305 K Apr 6 listener. log
-Rw-r -- 1 oracle oinstall 26 K Jun 27 0:52 listener_demo92.log
B. view the current listener status
[Oracle @ test log] $ lsnrctl status listener_demo92
LSNRCTL for Linux: Version 9.2.0.8.0-Production on 27-JUN-2011 01:54:31
Copyright (c) 1991,200 6, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521 )))
STATUS of the LISTENER
------------------------
Alias listener_demo92
Version TNSLSNR for Linux: Version 9.2.0.8.0-Production
Start Date 27-JUN-2011 01:52:18
Uptime 0 days 0 hr. 2 min. 13 sec
Trace Level off
Security ON
SNMP OFF
Listener Parameter File/oracle/92/network/admin/listener. ora
Listener Log File/oracle/92/network/log/listener_demo92.log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = test) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC )))
Services Summary...
Service "demo92" has 1 instance (s ).
Instance "demo92", status READY, has 1 handler (s) for this service...
The command completed successfully
C. Set the listener directory and Log File
LSNRCTL> set current_listener listener_demo92
Current Listener is listener_demo92
LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> set log_directory/home/oracle/log
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521 )))
Listener_demo92 parameter "log_directory" set to/home/oracle/log
The command completed successfully
LSNRCTL> set log_file listener_test.log
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521 )))
Listener_demo92 parameter "log_file" set to listener_test.log
The command completed successfully
LSNRCTL> set log_status on
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521 )))
Listener_demo92 parameter "log_status" set to ON
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521 )))
Saved listener_demo92 configuration parameters.
Listener Parameter File/oracle/92/network/admin/listener. ora
Old Parameter File/oracle/92/network/admin/listener. bak
The command completed successfully
LSNRCTL> exit
D. view log files generated in the new path