使用RMAN备份archived log files
- Include only archived redo log files
- Are alwarys full backups
RMAN>BACKUP
FORMAT '/disk1/backup/ar_%t_%s_%p'
ARCHIVELOG ALL DELETE ALL INPUT;(ALL DELETE ALL INPUT防止重复备份)
1、Archived Redo Log Backups
Online redo log file switch is automatic
Archived log failover is performed.
Back up archived logs that need backing up.
2、Backup Database Plus Archivelog(执行archived log back up 期间,具体执行过程步骤)
- Run the alter system archive log current command
- Run the backup archivelog all command
- Back up the rest of the datafiles specified by the backup database command.
- Run the alter system archive log current command
- Back up the new archive logs generated during the backup operation.
3、archive log的备份
SQL> alter system archive log current; System altered.
4、RMAN备份archive log
RMAN> backup archivelog all format '/u01/arcerzhang/ac_%U'; Starting backup at 24-MAR-13 current log archived allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=7 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=5 RECID=1 STAMP=809892057 input archived log thread=1 sequence=6 RECID=2 STAMP=809893274 input archived log thread=1 sequence=7 RECID=3 STAMP=809907842 input archived log thread=1 sequence=8 RECID=4 STAMP=809911423 input archived log thread=1 sequence=9 RECID=5 STAMP=809911902 input archived log thread=1 sequence=10 RECID=6 STAMP=809968863 input archived log thread=1 sequence=11 RECID=7 STAMP=809993975 input archived log thread=1 sequence=12 RECID=8 STAMP=810481799 input archived log thread=1 sequence=13 RECID=9 STAMP=810599313 input archived log thread=1 sequence=14 RECID=10 STAMP=810684113 input archived log thread=1 sequence=15 RECID=11 STAMP=810752782 input archived log thread=1 sequence=16 RECID=12 STAMP=810825309 input archived log thread=1 sequence=17 RECID=13 STAMP=810854172 input archived log thread=1 sequence=18 RECID=14 STAMP=810865159 input archived log thread=1 sequence=19 RECID=15 STAMP=810866182 input archived log thread=1 sequence=20 RECID=16 STAMP=810866373 channel ORA_DISK_1: starting piece 1 at 24-MAR-13 channel ORA_DISK_1: finished piece 1 at 24-MAR-13 piece handle=/u01/arcerzhang/ac_0ko59lm6_1_1 tag=TAG20130324T003934 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56 Finished backup at 24-MAR-13 Starting Control File Autobackup at 24-MAR-13 piece handle=/u01/flash_recovery_area/POLI/autobackup/2013_03_24/o1_mf_n_810866430_8nvpr083_.bkp comment=NONE Finished Control File Autobackup at 24-MAR-13
5、RMAN备份archive log ,并删除之前的arichive log;
RMAN> backup archivelog all format '/u01/arcerzhang/ac_%U' delete all input; Starting backup at 24-MAR-13 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=5 RECID=1 STAMP=809892057 input archived log thread=1 sequence=6 RECID=2 STAMP=809893274 input archived log thread=1 sequence=7 RECID=3 STAMP=809907842 input archived log thread=1 sequence=8 RECID=4 STAMP=809911423 input archived log thread=1 sequence=9 RECID=5 STAMP=809911902 input archived log thread=1 sequence=10 RECID=6 STAMP=809968863 input archived log thread=1 sequence=11 RECID=7 STAMP=809993975 input archived log thread=1 sequence=12 RECID=8 STAMP=810481799 input archived log thread=1 sequence=13 RECID=9 STAMP=810599313 input archived log thread=1 sequence=14 RECID=10 STAMP=810684113 input archived log thread=1 sequence=15 RECID=11 STAMP=810752782 input archived log thread=1 sequence=16 RECID=12 STAMP=810825309 input archived log thread=1 sequence=17 RECID=13 STAMP=810854172 input archived log thread=1 sequence=18 RECID=14 STAMP=810865159 input archived log thread=1 sequence=19 RECID=15 STAMP=810866182 input archived log thread=1 sequence=20 RECID=16 STAMP=810866373 input archived log thread=1 sequence=21 RECID=17 STAMP=810866506 channel ORA_DISK_1: starting piece 1 at 24-MAR-13 channel ORA_DISK_1: finished piece 1 at 24-MAR-13 piece handle=/u01/arcerzhang/ac_0mo59lqb_1_1 tag=TAG20130324T004146 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25 channel ORA_DISK_1: deleting archived log(s) archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_12/o1_mf_1_5_8mxz5swy_.arc RECID=1 STAMP=809892057 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_12/o1_mf_1_6_8my0dtxl_.arc RECID=2 STAMP=809893274 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_12/o1_mf_1_7_8mygmqpn_.arc RECID=3 STAMP=809907842 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_12/o1_mf_1_8_8myl3oq3_.arc RECID=4 STAMP=809911423 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_12/o1_mf_1_9_8myllymq_.arc RECID=5 STAMP=809911902 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_13/o1_mf_1_10_8n0b5n02_.arc RECID=6 STAMP=809968863 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_13/o1_mf_1_11_8n12qc0p_.arc RECID=7 STAMP=809993975 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_19/o1_mf_1_12_8nhz43gk_.arc RECID=8 STAMP=810481799 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_20/o1_mf_1_13_8nmkw6x0_.arc RECID=9 STAMP=810599313 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_21/o1_mf_1_14_8np4pfbk_.arc RECID=10 STAMP=810684113 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_22/o1_mf_1_15_8nr7r9fz_.arc RECID=11 STAMP=810752782 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_23/o1_mf_1_16_8ntglghk_.arc RECID=12 STAMP=810825309 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_23/o1_mf_1_17_8nvbr407_.arc RECID=13 STAMP=810854172 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_24/o1_mf_1_18_8nvoj566_.arc RECID=14 STAMP=810865159 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_24/o1_mf_1_19_8nvpj6cn_.arc RECID=15 STAMP=810866182 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_24/o1_mf_1_20_8nvpp5jh_.arc RECID=16 STAMP=810866373 archived log file name=/u01/flash_recovery_area/POLI/archivelog/2013_03_24/o1_mf_1_21_8nvptbo3_.arc RECID=17 STAMP=810866506 Finished backup at 24-MAR-13 Starting Control File Autobackup at 24-MAR-13 piece handle=/u01/flash_recovery_area/POLI/autobackup/2013_03_24/o1_mf_n_810866533_8nvpv61w_.bkp comment=NONE Finished Control File Autobackup at 24-MAR-13
6、RMAN备份archive log,按照sequence no进行备份
backup archivelog sequence between 99 and 199 thread 1 delete input;
thread 1,如果是非RAC模式下,thread 的值只有一个;
7、RMAN备份archive log ,按照日期区间备份
backup archivelog from time "sysdate-15" until time "sysdate-7";
查询当前日期前15天至当前日期7天的归档日志信息;