一个rman备份的例子

ORACLE_BASE=/opt/11g/oracle; export ORACLE_BASE 
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1;  export ORACLE_HOME 
ORACLE_SID=nek; export ORACLE_SID 
ORACLE_TERM=xterm; export ORACLE_TERM 
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH 
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; 
export CLASSPATH 
 DAY_TAG=`date +"%Y-%m-%d"`
rman target / nocatalog msglog  /home/oracle/nek__$DAY_TAG.log << !
run
 {
   allocate channel c1 type disk;
   backup as compressed backupset database format '/oradata/nek/bakup/nek_%T_%U' tag='level0';
    backup current controlfile format '/oradata/nek/bakup/nek_%T_CTL_%U';
   sql 'alter system archive log current';
   backup archivelog all format '/oradata/nek/bakup/nek_arch_%T_%U' delete input;
   release channel c1;
   crosscheck backupset;
    delete noprompt expired backup;
    delete noprompt obsolete;
    crosscheck archivelog all;
     delete noprompt expired archivelog all;
}
!


 

发布了20 篇原创文章 · 获赞 6 · 访问量 2万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览