Configure and manage Oracle listener logs

Source: Internet
Author: User

-- ======================================
-- 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

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 is automatically created, similar to the alert _ <SID>. log file.
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

[Oracle @ test admin] $ cd/home/oracle/log
[Oracle @ test log] $ ls-hltr
Total 16 K
-Rw-r -- 1 oracle oinstall 41 Jun 27 listener_demo92.log -->
-Rw-r -- 1 oracle oinstall 113 Jun 27 listener_test.log --> set the new log file after the log file name

[Oracle @ test log] $ ls-hltr --> you can view the log file in a specified time interval. The original log file does not grow any more and the log file name is used to record the log.
Total 16 K
-Rw-r -- 1 oracle oinstall 41 Jun 27 02: 11 listener_demo92.log
-Rw-r -- 1 oracle oinstall 1.3 K Jun 27 listener_test.log

E. view the changes in the listener. ora configuration file.

[Oracle @ test admin] $ more listener. ora
# ---- Added by tnslsnr 27-JUN-2011 02:12:37 ---
LOG_DIRECTORY_listener_demo92 =/home/oracle/log
LOG_FILE_listener_demo92 = listener_test.log
LOGGING_listener_demo92 = ON
#--------------------------------------------

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.