Oraclealertlog stores scripts by day

Source: Internet
Author: User
2. The common shell scripts used by DBAs in Linux are also described. For details, refer to the common shell scripts www.

2. The common shell scripts used by DBAs in Linux are also described. For details, refer to the common shell scripts used by eight DBAs to monitor Oracle databases. http: // www.

By default, alert log has only one file. When a certain amount of data is accumulated, it is a little troublesome to view alert. log. You can only use the tail-xxx line for viewing. Therefore, if you can store alert. log by day or put it in a historical file. Alert. log only keeps the log Content of the current day, which makes it easy to view.

In addition, this also helps us to use scripts to check whether errors occur in alert logs on the current day.

I. Windows Platform

Windows is a batch processing file. Add the batch processing file to the scheduled task and execute it at every day.

Back_log_file.bat

Rem copies the log file and changes its name. Modify the script according to the SID.

Set year = % DATE :~ 0, 4%

Set month = % DATE :~ 5, 2%

Set day = % DATE :~ 8, 2%

Copy D: \ Oracle \ admin \ orcl \ bdump \ alert_orcl.log D: \ oracle \ admin \ orcl \ bdump \ alert_orcl "% year % month % day %". log

Rem clear log files

The following sentence of rem is used to clear alert_orcl.log.

Cd.> D: \ oracle \ admin \ orcl \ bdump \ alert_orcl.log

,

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.