ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RMAN 备份策略 scripts

RMAN 备份策略 scripts

原创 Linux操作系统 作者:beatony 时间:2013-02-16 11:19:18 0 删除 编辑
szjsdbsvr1:11g:jingsuan > more rman_jingsuan.rcv
crosscheck archivelog all;
delete noprompt expired archivelog all;
crosscheck backup;
delete noprompt obsolete; 
delete expired copy;
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
backup as compressed backupset database format '/bea/rman/jingsuan_full_%U'
plus archivelog skip inaccessible delete all input format '/bea/rman/jingsuan_ARC_%U';
backup current controlfile format '/bea/rman/jingsuan_control_bak_%T';
backup spfile format '/bea/rman/jingsuan_spfile_bak_%T';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}

szjsdbsvr1:11g:jingsuan > more backup_db.sh
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/bea/app/oracle
export ORACLE_SID=jingsuan
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export EDITOR=vi
export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
mv /bea/rman/jingsuan_* /bea/rmanbak/
logName=jingsuan_rman_`date +'%Y%m%d%H%M%S'`_full.log
find /bea/rmanbak/ -name "jingsuan_*" -mtime +1 -exec rm -rf {} \;
cd /bea/rman
rman target / CMDFILE rman_jingsuan.rcv >> $logName

szjsdbsvr1:11g:jingsuan > crontab -l
00 02 * * * sh /bea/rman/backup_db.sh
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22578826/viewspace-754139/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-05-18

  • 博文量
    192
  • 访问量
    456143