Collect Oracle listener log files

Source: Internet
Author: User

Oracle listener log file (usually called listener. log) is a plain text file whose size keeps increasing. On a production Oracle Server, DBA checks the file daily, such as checking whether the listener has an abnormal stop, whether there is a malicious attack connection or not. When this file is very large, it may be slow to open and browse the file content. In this case, you may think of backing up the current log file, then create a new log file again. However, Oracle listeners cannot delete or rename the log file at runtime. Therefore, only the listener is stopped and renamed before the listener is started, A new listener log file will be automatically created at startup, but the client connection will be disconnected. This article introduces a way to rename the listener log file without stopping the listener.

On Windows:

C: \> cd \ oracle \ ora92 \ network \ log # Switch to the directory where the listener log file is located

C: \ oracle \ ora92 \ network \ log> lsnrctl set log_status off # temporarily offline the listener log File

C: \ oracle \ ora92 \ network \ log> rename listener. log listener. old # rename the log file and add the date

C: \ oracle \ ora92 \ network \ log> lsnrctl set log_status on # Bring the listener log file online and a new log file will be created automatically.

On Linux/Unix platforms:

% Cd/u01/app/oracle/product/9.2.0/network/log

% Lsnrctl set log_status off

% Mv listener. log listener. old

% Lsnrctl set log_status on

After the name is renamed, you can copy listener. old to the DBA's work computer for in-depth analysis. In case of hacker attacks, you can also retain the file as evidence.

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.