分享交流
合作共赢!

oracle数据库rman备份方法总结

一、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的方法

赞(0) 打赏
未经允许不得转载:琼杰笔记 » oracle数据库rman备份方法总结

评论 抢沙发

评论前必须登录!

 

分享交流,合作共赢!

联系我们加入QQ群

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏