Linux regularly cleans up archive logs

Source: Internet
Author: User

#!/bin/sh
Export back_date= ' DATE +%y%m%d '
Export Backup_path=/home/oracle/dbbak
echo ' Mkdir-p ${backup_path}/archivelog/${back_date} '
Rman msglog= $BACKUP _path/archivelog/${back_date}/arch_0_$back_date.log << EOF
Connect target/;
Delete Expired Archivelog all;
Delete noprompt Archivelog until time ' sysdate-1 ';
Exit
Eof

The following is an Rman timed Delete archive Log method:
Upload the del_arch.sh file in the attachment to the database server, the readable directory of the Oracle user, such as/home/oracle. Assign executable permissions (chmod +x del_arch.sh)
Under root user, CRONTAB-E
* * 3 su-oracle-c '/home/oracle/del_arch.sh ' in quotation marks for the script location. (on behalf of every Wednesday 20:20 execute the script, delete the log)

Linux regularly cleans up archive logs

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.