一、rman备份脚本
#!/bin/bash #rm -rf /data/backup/${BACK_DATE} export BACK_DATE=`date +%Y%m%d` mkdir -p /data/backup/${BACK_DATE} export ORACLE_HOME=/data/PROD/db/oracle-server/12.1.0.2 export ORACLE_SID=CDBHCM /data/PROD/db/oracle-server/12.1.0.2/bin/rman log='/home/oracle/rman.log' append <<EOF connect target /; run { allocate channel c1 type disk; allocate channel c2 type disk; #delete noprompt backupset; #delete noprompt archivelog all; #configure device type disk parallelism 5 backup type to backupset; #configure maxsetsize to 8392m; CONFIGURE RETENTION POLICY TO REDUNDANCY 4; configure maxsetsize to 10G; backup as compressed backupset tag 'full' database format '/data/backup/${BACK_DATE}/db_%U'; backup as compressed backupset tag 'full' archivelog all delete input format '/data/backup/${BACK_DATE}/archive_%U'; backup tag 'full' as copy current controlfile format '/data/backup/${BACK_DATE}/backup_controlfile.ctl'; release channel c2; release channel c1; } report obsolete; delete noprompt obsolete; crosscheck backup; delete noprompt expired backup; list backup summary; EOF
二、清除备份脚本
#!/bin/bash find /data/PROD/db/oradata/archivelog/ -mtime +9 -name "*.dbf" -exec rm -f {} \;
温馨提示:
琼杰笔记其他相关文档参考:oracle数据库rman删除Archivelog的方法
评论前必须登录!
注册