rman现场备份策略

 


/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl0   log=/opt/rmanbak/bakl0.log append
/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl1   log=/opt/rmanbak/bakl1.log append
/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl2   log=/opt/rmanbak/bakl2.log append


run{

    allocate channel cha1 type disk;
    crosscheck backupset of archivelog all ;
    delete  noprompt expired archivelog all;
 
    backup

    incremental level  0

    format '/opt/rmanbak/inc0_%u_%T'

    tag monday_inc0

    database
    include current controlfile;
    sql "alter system archive log current";  
  
    backup format='/opt/rmanbak/%d_%s.arc' archivelog from time='sysdate-2'until time='sysdate'  delete all input;
 
    release channel cha1;

    }


exit;

-------------
run{

    allocate channel cha1 type disk;

    backup

    incremental level  1

    format '/opt/rmanbak/inc1_%u_%T'

    tag monday_inc1

     database
    include current controlfile;
   
    release channel cha1;

    }
exit;
--------------------
run{

    allocate channel cha1 type disk;

    backup

    incremental level  2

    format '/opt/rmanbak/inc2_%u_%T'

    tag monday_inc2

     database
    include current controlfile;
   
    release channel cha1;

    }
exit;
--------------
0 2 * * * find  /u01/app/oracle/flash_recovery_area/SXTSIOMS/archivelog -mtime +2 -exec rm -f {} /;

45 2  *  *    0    /opt/rmanbak/rmanlevel0.sh

45 2  *  *    1    /opt/rmanbak/rmanlevel2.sh

45 2  *  *    2    /opt/rmanbak/rmanlevel2.sh

45 2  *  *    3    /opt/rmanbak/rmanlevel1.sh

45 2  *  *    4    /opt/rmanbak/rmanlevel2.sh

45 2 *  *    5    /opt/rmanbak/rmanlevel2.sh

45 2 *  *    6    /opt/rmanbak/rmanlevel2.sh

rmanlevel0.sh

export  ORACLE_HOME='/u01/app/oracle/product/10.1';
export  ORACLE_SID='sxtsioms';
/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl0  log=/opt/rmanbak/bakl0.log append


rmanlevel1.sh
export  ORACLE_HOME='/u01/app/oracle/product/10.1';
export  ORACLE_SID='sxtsioms';
/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl1  log=/opt/rmanbak/bakl1.log append

rmanlevel2.sh
export  ORACLE_HOME='/u01/app/oracle/product/10.1';
export  ORACLE_SID='sxtsioms';
/u01/app/oracle/product/10.1/bin/rman target sys/sys123@sxtsioms   cmdfile=/opt/rmanbak/bakl2  log=/opt/rmanbak/bakl2.log append

 

 

RMAN> DELETE noprompt  ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-30';   物理逻辑一起删除


RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/opt/rmanbak/ctl_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.1/dbs/snapcf_sxtsioms.f'; # default

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值