How to operate the listening log online listener.log

Source: Internet
Author: User

Transfer from Itpub http://blog.itpub.net/30162081/viewspace-1784677/


The Oracle Listener log file (often called listener.log) is a plain text file that is constantly growing in size, and on a production Oracle server, the DBA views the file daily, such as checking if the listener has an abnormal stop, a malicious attack connection, and so on. However, when this file is very large, it may be slow to open and browse the contents of the file (sometimes it doesn't open at all). You might think of backing up the current log file and recreating a new log file, but the Oracle listener is not allowed to delete or rename its log files at run time.
My previous practice was to stop the listener first through Lsntctl stop, rename it, and then start the listener, which automatically creates a new listener log file at startup, so that it does not affect existing connections, but will cause the client to fail to establish a new connection. Share a method to rename the listener log file without stopping the listener.

Operating Environment
I am operating in Oracle 10g+windows Server standard R2.

Click (here) to collapse or open sql>
Sql> select * from v$version;

BANNER
----------------------------------------------------------------

Oracle database  10g Enterprise Edition release 10.2.0.4.0 - 64bi
pl/sql release  10.2.0.4.0 - production
CORE 10.2.0.4.0 Production
Tns for 64-bit windows: version 10.2.0.4.0 - production
Nlsrtl Version 10.2.0.4.0 - production


sql>
1. Set Log_status to OFF
    execute the lsnrctl set log_status off command under the CMD Command window and set Log_status to OFF. As the name implies, the database no longer logs listening logs.

Click (here) to collapse or open c:\users\administrator> C:\users\administrator>lsnrctl set Log_status off lsnrctl for 64-bit Windows: Version 10.2.0.4.0-production on 2 July-August -2015 15:21:30 Copyright (c) 1991, Oracle. All rights reserved. Connecting to (Description= (address= (protocol=tcp) (Host=hoeghserver) (port=1521)) LISTENER parameter "Log_status" set to OFF command succeeds C: \ Users\administrator>


2. Operation Listening log file Listener.log
Now, you can directly manipulate the listening log file Listener.log in the $oracle_home/network/admin/log directory.
There are usually two things to follow:
Rename--Backup listening log file for fault analysis, etc.;
Delete--Delete listening log file, save storage space;



3. Set Log_status to ON
Execute the LSNRCTL set log_status on command under the CMD Command window and set the Log_status to ON. In this way, the listening log function is reopened.
At the same time, regenerate a new listener log file Listener.log under the $oracle_home/network/admin/log directory.

Click (here) to collapse or open C:\users\administrator>lsnrctl set log_status on Lsnrctl for 64-bit windows:version 10.2.0.4.0-produ Ction on 2 July-August -2015 15:22:02 Copyright (c) 1991, Oracle. All rights reserved. Connecting to (Description= (address= (protocol=tcp) (Host=hoeghserver) (port=1521)) LISTENER parameter "Log_status" set to on command execution successful C: \ Users\administrator> Hoegh 15.8.28--the End--

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.