backup archivelog from sequence 的用法,备份部分归档日志

测试 rman 中备份归档的几种用法:

https://docs.oracle.com/cd/B19306_01/backup.102/b14194/rcmsynta008.htm


首先来看一个报错,因为控制文件中的归档记录与目前磁盘路径的归档路径不相符导致的。
[
oracle@test-racdb-01 ~]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jul 31 22:36:52 2019 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: TESTDB (DBID=2796352599) RMAN> backup archivelog from sequence 22 format '/home/oracle/arc_%d_%U.arc'; Starting backup at 2019-07-31 22:37:11 current log archived using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=63 instance=testdb1 device type=DISK RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of backup command at 07/31/2019 22:37:21 RMAN-06059: expected archived log not found, loss of archived log compromises recoverability ORA-19625: error identifying file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_24_1013024473.dbf ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3
用如下方法解决: RMAN
> crosscheck archivelog all; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=63 instance=testdb1 device type=DISK validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_9_1013024473.dbf RECID=2 STAMP=1015107343 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_10_1013024473.dbf RECID=3 STAMP=1015107370 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_11_1013024473.dbf RECID=6 STAMP=1015107574 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_12_1013024473.dbf RECID=7 STAMP=1015107658 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_13_1013024473.dbf RECID=10 STAMP=1015107739 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_14_1013024473.dbf RECID=11 STAMP=1015107761 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_15_1013024473.dbf RECID=14 STAMP=1015107778 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_16_1013024473.dbf RECID=15 STAMP=1015107803 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_17_1013024473.dbf RECID=18 STAMP=1015107826 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_18_1013024473.dbf RECID=19 STAMP=1015107845 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_19_1013024473.dbf RECID=22 STAMP=1015107874 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_20_1013024473.dbf RECID=23 STAMP=1015107961 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_21_1013024473.dbf RECID=25 STAMP=1015107991 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_22_1013024473.dbf RECID=28 STAMP=1015108111 validation succeeded for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_23_1013024473.dbf RECID=29 STAMP=1015108193 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_24_1013024473.dbf RECID=31 STAMP=1015108312 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_25_1013024473.dbf RECID=32 STAMP=1015108312 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_26.271.1015108377 RECID=34 STAMP=1015108377 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_27.272.1015108389 RECID=35 STAMP=1015108388 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_28.274.1015108545 RECID=39 STAMP=1015108544 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_29.275.1015108559 RECID=40 STAMP=1015108559 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_30.277.1015108581 RECID=42 STAMP=1015108580 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_31.279.1015108593 RECID=44 STAMP=1015108592 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_1_seq_32.281.1015108631 RECID=46 STAMP=1015108632 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_7_1013024473.dbf RECID=1 STAMP=1015107334 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_8_1013024473.dbf RECID=4 STAMP=1015107364 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_9_1013024473.dbf RECID=5 STAMP=1015107565 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_10_1013024473.dbf RECID=8 STAMP=1015107652 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_11_1013024473.dbf RECID=9 STAMP=1015107730 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_12_1013024473.dbf RECID=12 STAMP=1015107754 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_13_1013024473.dbf RECID=13 STAMP=1015107769 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_14_1013024473.dbf RECID=16 STAMP=1015107796 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_15_1013024473.dbf RECID=17 STAMP=1015107817 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_16_1013024473.dbf RECID=20 STAMP=1015107838 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_17_1013024473.dbf RECID=21 STAMP=1015107865 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_18_1013024473.dbf RECID=24 STAMP=1015107955 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_19_1013024473.dbf RECID=26 STAMP=1015107985 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_20_1013024473.dbf RECID=27 STAMP=1015108102 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_21_1013024473.dbf RECID=30 STAMP=1015108252 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_22_1013024473.dbf RECID=33 STAMP=1015108369 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_23_1013024473.dbf RECID=36 STAMP=1015108384 validation failed for archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_24_1013024473.dbf RECID=37 STAMP=1015108419 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_2_seq_25.273.1015108533 RECID=38 STAMP=1015108533 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_2_seq_26.276.1015108553 RECID=41 STAMP=1015108553 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_2_seq_27.278.1015108575 RECID=43 STAMP=1015108575 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_2_seq_28.280.1015108587 RECID=45 STAMP=1015108586 validation succeeded for archived log archived log file name=+DATADG/testdb/archivelog/2019_07_31/thread_2_seq_29.282.1015108625 RECID=47 STAMP=1015108625 Crosschecked 47 objects
然后开始 from sequence 22 进行备份,那么只会备份 thread 1 的日志。 RMAN
> backup archivelog from sequence 22 format '/home/oracle/arc_%d_%U.arc'; Starting backup at 2019-07-31 22:37:36 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=22 RECID=28 STAMP=1015108111 input archived log thread=1 sequence=23 RECID=29 STAMP=1015108193 input archived log thread=1 sequence=26 RECID=34 STAMP=1015108377 input archived log thread=1 sequence=27 RECID=35 STAMP=1015108388 input archived log thread=1 sequence=28 RECID=39 STAMP=1015108544 input archived log thread=1 sequence=29 RECID=40 STAMP=1015108559 input archived log thread=1 sequence=30 RECID=42 STAMP=1015108580 input archived log thread=1 sequence=31 RECID=44 STAMP=1015108592 input archived log thread=1 sequence=32 RECID=46 STAMP=1015108632 input archived log thread=1 sequence=33 RECID=48 STAMP=1015108659 channel ORA_DISK_1: starting piece 1 at 2019-07-31 22:37:42 channel ORA_DISK_1: finished piece 1 at 2019-07-31 22:37:43 piece handle=/home/oracle/arc_TESTDB_03u82l1l_1_1.arc tag=TAG20190731T223741 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2019-07-31 22:37:43
这样才会备份两个节点的日志: RMAN
> backup archivelog all format '/home/oracle/arc_%d_%U.arc'; Starting backup at 2019-07-31 22:37:52 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=9 RECID=2 STAMP=1015107343 input archived log thread=1 sequence=10 RECID=3 STAMP=1015107370 input archived log thread=1 sequence=11 RECID=6 STAMP=1015107574 input archived log thread=1 sequence=12 RECID=7 STAMP=1015107658 input archived log thread=1 sequence=13 RECID=10 STAMP=1015107739 input archived log thread=1 sequence=14 RECID=11 STAMP=1015107761 input archived log thread=1 sequence=15 RECID=14 STAMP=1015107778 input archived log thread=1 sequence=16 RECID=15 STAMP=1015107803 input archived log thread=1 sequence=17 RECID=18 STAMP=1015107826 input archived log thread=1 sequence=18 RECID=19 STAMP=1015107845 input archived log thread=1 sequence=19 RECID=22 STAMP=1015107874 input archived log thread=1 sequence=20 RECID=23 STAMP=1015107961 input archived log thread=1 sequence=21 RECID=25 STAMP=1015107991 input archived log thread=1 sequence=22 RECID=28 STAMP=1015108111 input archived log thread=1 sequence=23 RECID=29 STAMP=1015108193 input archived log thread=1 sequence=26 RECID=34 STAMP=1015108377 input archived log thread=1 sequence=27 RECID=35 STAMP=1015108388 input archived log thread=1 sequence=28 RECID=39 STAMP=1015108544 input archived log thread=2 sequence=25 RECID=38 STAMP=1015108533 input archived log thread=2 sequence=26 RECID=41 STAMP=1015108553 input archived log thread=1 sequence=29 RECID=40 STAMP=1015108559 input archived log thread=1 sequence=30 RECID=42 STAMP=1015108580 input archived log thread=2 sequence=27 RECID=43 STAMP=1015108575 input archived log thread=1 sequence=31 RECID=44 STAMP=1015108592 input archived log thread=2 sequence=28 RECID=45 STAMP=1015108586 input archived log thread=1 sequence=32 RECID=46 STAMP=1015108632 input archived log thread=2 sequence=29 RECID=47 STAMP=1015108625 input archived log thread=1 sequence=33 RECID=48 STAMP=1015108659 input archived log thread=2 sequence=30 RECID=49 STAMP=1015108652 input archived log thread=1 sequence=34 RECID=50 STAMP=1015108673 input archived log thread=2 sequence=31 RECID=51 STAMP=1015108667 channel ORA_DISK_1: starting piece 1 at 2019-07-31 22:37:57 channel ORA_DISK_1: finished piece 1 at 2019-07-31 22:37:58 piece handle=/home/oracle/arc_TESTDB_04u82l25_1_1.arc tag=TAG20190731T223756 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2019-07-31 22:37:58
这样也是仅仅备份的 节点1 的日志 RMAN
> backup archivelog from sequence 22 all format '/home/oracle/arc_%d_%U.arc'; Starting backup at 2019-07-31 22:38:24 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=22 RECID=28 STAMP=1015108111 input archived log thread=1 sequence=23 RECID=29 STAMP=1015108193 input archived log thread=1 sequence=26 RECID=34 STAMP=1015108377 input archived log thread=1 sequence=27 RECID=35 STAMP=1015108388 input archived log thread=1 sequence=28 RECID=39 STAMP=1015108544 input archived log thread=1 sequence=29 RECID=40 STAMP=1015108559 input archived log thread=1 sequence=30 RECID=42 STAMP=1015108580 input archived log thread=1 sequence=31 RECID=44 STAMP=1015108592 input archived log thread=1 sequence=32 RECID=46 STAMP=1015108632 input archived log thread=1 sequence=33 RECID=48 STAMP=1015108659 input archived log thread=1 sequence=34 RECID=50 STAMP=1015108673 input archived log thread=1 sequence=35 RECID=53 STAMP=1015108706 channel ORA_DISK_1: starting piece 1 at 2019-07-31 22:38:27 channel ORA_DISK_1: finished piece 1 at 2019-07-31 22:38:28 piece handle=/home/oracle/arc_TESTDB_05u82l32_1_1.arc tag=TAG20190731T223826 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2019-07-31 22:38:28如果想备份节点2 的日志可以用如下的方法: RMAN> backup archivelog from sequence 22 thread 2 format '/home/oracle/arc_%d_%U.arc'; Starting backup at 2019-07-31 22:44:03 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=2 sequence=25 RECID=38 STAMP=1015108533 input archived log thread=2 sequence=26 RECID=41 STAMP=1015108553 input archived log thread=2 sequence=27 RECID=43 STAMP=1015108575 input archived log thread=2 sequence=28 RECID=45 STAMP=1015108586 input archived log thread=2 sequence=29 RECID=47 STAMP=1015108625 input archived log thread=2 sequence=30 RECID=49 STAMP=1015108652 input archived log thread=2 sequence=31 RECID=51 STAMP=1015108667 input archived log thread=2 sequence=32 RECID=52 STAMP=1015108697 input archived log thread=2 sequence=33 RECID=55 STAMP=1015109013 input archived log thread=2 sequence=34 RECID=56 STAMP=1015109036 channel ORA_DISK_1: starting piece 1 at 2019-07-31 22:44:07 channel ORA_DISK_1: finished piece 1 at 2019-07-31 22:44:08 piece handle=/home/oracle/arc_TESTDB_07u82ldn_1_1.arc tag=TAG20190731T224406 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2019-07-31 22:44:08

命令:

backup archivelog from sequence 22 thread 1 format '/home/oracle/arc_%d_%U.arc';
backup archivelog from sequence 22 thread 2 format '/home/oracle/arc_%d_%U.arc';

 

猜你喜欢

转载自www.cnblogs.com/chendian0/p/11374233.html