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
,