当前位置: 移动技术网 > IT编程>数据库>Oracle > oracle备份方案

oracle备份方案

2020年03月17日  | 移动技术网IT编程  | 我要评论

琅善,qq技术网站,小游戏俱乐部

目录

oracle生产备份方案

crontab 配置

周末全量备份,其他日期增量备份,清除15天以前文件

0 5 * * * find /app/oracle11g/product/11.2.0/archdir/ecudb/* -mtime +6 |xargs  rm -fr

#rmanbackup
30 4 * * 6  sh /backup/feikong/scripts/rman_backup_0.sh
30 4 * * 0,1,2,3,4,5  sh /backup/feikong/scripts/rman_backup_1.sh
30 4 * * * find /backup/data -ctime +15 -type f |grep -e "db_0|db_1|arch_" |xargs -l 1 rm -rf

rman_backup_0.sh

#!/bin/bash
source ~/.bash_profile
rq=`date +%y%m%d`
rman target / log /backup/log/rmanbackup_${rq}.log append<<eof
set encryption on identified by "u9j04hkuvfru" only;
run{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup incremental level 0 tag "db0" database format "/backup/data/db_0_%t%u.bkp";
crosscheck archivelog all;
delete noprompt expired archivelog all;
sql "alter system archive log current";
backup archivelog all format "/backup/data/arch_%t%u.arc";
delete noprompt backup of archivelog until time "sysdate-8";
backup current controlfile format "/backup/data/ctl_%t%u.ctl";
crosscheck backup;
crosscheck backupset;
delete noprompt expired backup;
delete noprompt expired backupset;
report obsolete;
delete noprompt obsolete device type disk; 
release channel ch1;
release channel ch2;
}
exit
eof

rman_backup_1.sh

#!/bin/bash
source ~/.bash_profile
rq=`date +%y%m%d`
rman target / log /backup/log/rmanbackup_${rq}.log append<<eof
set encryption on identified by "u9j04hkuvfru" only;
run{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup incremental level 1 tag "db1" database format "/backup/data/db_1_%t%u.bkp";
crosscheck archivelog all;
delete noprompt expired archivelog all;
sql "alter system archive log current";
backup archivelog all format "/backup/data/arch_%t%u.arc";
delete noprompt backup of archivelog until time "sysdate-8";
backup current controlfile format "/backup/data/ctl_%t%u.ctl";
crosscheck backup;
crosscheck backupset;
delete noprompt expired backup;
delete noprompt expired backupset;
report obsolete;
delete noprompt obsolete device type disk; 
release channel ch1;
release channel ch2;
}
exit
eof

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网