rman现场备份策略

来源:互联网 发布:mac迅雷没有下载速度 编辑:程序博客网 时间:2024/04/30 02:50

 


/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

原创粉丝点击