Use the Linux logrotate tool to clear oracle listener logs

Source: Internet
Author: User

The logrotate tool is a log rollback program that comes with the Linux system. It is started by the cron program of the System Planning Service tool and can be used to roll back various system logs. Due to the rapid growth of Oracle listener logs, it needs to be cleaned regularly, so I thought of using this tool. The specific usage is as follows:

1. Add a configuration file

Vi/etc/logrotate. d/oracle-listener

/Oracle/app/oracle/diag/tnslsnr/dtydb3/listener/trace/listener. log {
Daily
Copytruncate
Rotate 7
}


2. Perform a manual test to archive the log file. The following command can be executed manually. If the configuration file is not in the/etc/logrotate/directory, add it to cron.

Logrotate-f/etc/logrotate. d/oracle-listener

Note: The logrotate tool has a serious disadvantage, that is, by sending the HUP restart command to the web server process to truncate and round-robin The current log file. Log rollback in this way will seriously affect the continuity of web Services, so it is not practical for real-time monitoring systems.

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.