您的位置:首页 > 其它

RMAN DELETE INPUT和DELETE ALL INPUT的区别

2015-10-28 11:03 501 查看
1.首先检查一下归档的路径

SYS@prod2 > show parameter archive

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target                   integer     0
log_archive_config                   string
log_archive_dest                     string
log_archive_dest_1                   string      location=/home/oracle/app/arch
ive
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
log_archive_dest_13                  string
log_archive_dest_14                  string
log_archive_dest_15                  string

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_16                  string
log_archive_dest_17                  string
log_archive_dest_18                  string
log_archive_dest_19                  string
log_archive_dest_2                   string      location=/home/oracle/app/fast
_recovery_area/prod2


有两个归档路径log_archive_dest_1,log_archive_dest_2

2.使用rman列出目标库的归档日志

RMAN> list archivelog all;

397     1    48      A 25-OCT-15
Name: /home/oracle/app/archive/1_48_892652515.dbf

398     1    49      A 26-OCT-15
Name: /home/oracle/app/archive/1_49_892652515.dbf

399     1    50      A 26-OCT-15
Name: /home/oracle/app/archive/1_50_892652515.dbf

400     1    51      A 27-OCT-15
Name: /home/oracle/app/archive/1_51_892652515.dbf

401     1    52      A 27-OCT-15
Name: /home/oracle/app/archive/1_52_892652515.dbf

402     1    53      A 28-OCT-15
Name: /home/oracle/app/archive/1_53_892652515.dbf

403     1    53      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_53_892652515.dbf

404     1    54      A 28-OCT-15
Name: /home/oracle/app/archive/1_54_892652515.dbf

405     1    54      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_54_892652515.dbf

406     1    55      A 28-OCT-15
Name: /home/oracle/app/archive/1_55_892652515.dbf

407     1    55      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_55_892652515.dbf

408     1    56      A 28-OCT-15
Name: /home/oracle/app/archive/1_56_892652515.dbf

409     1    56      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_56_892652515.dbf

410     1    57      A 28-OCT-15
Name: /home/oracle/app/archive/1_57_892652515.dbf

411     1    57      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_57_892652515.dbf


可以看到53之前的日志只有一个归档路径,之后的有两个归档路径

3.我们使用delete input看一下结果

RMAN> backup archivelog all delete input;

Starting backup at 28-OCT-15
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=267 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=16 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=98 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=182 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=352 STAMP=892677675
input archived log thread=1 sequence=4 RECID=353 STAMP=892678596
input archived log thread=1 sequence=5 RECID=354 STAMP=892687714
input archived log thread=1 sequence=6 RECID=355 STAMP=892708411
input archived log thread=1 sequence=7 RECID=356 STAMP=892718054
input archived log thread=1 sequence=8 RECID=357 STAMP=892718173
input archived log thread=1 sequence=9 RECID=358 STAMP=892718473
input archived log thread=1 sequence=10 RECID=359 STAMP=892749728
input archived log thread=1 sequence=11 RECID=360 STAMP=892765363
input archived log thread=1 sequence=12 RECID=361 STAMP=892792842
input archived log thread=1 sequence=13 RECID=362 STAMP=892817313
input archived log thread=1 sequence=14 RECID=363 STAMP=892850671
input archived log thread=1 sequence=15 RECID=364 STAMP=892864836
input archived log thread=1 sequence=16 RECID=365 STAMP=892892271
channel ORA_DISK_1: starting piece 1 at 28-OCT-15
channel ORA_DISK_2: starting compressed archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=17 RECID=366 STAMP=892910475
input archived log thread=1 sequence=18 RECID=367 STAMP=892939309
input archived log thread=1 sequence=19 RECID=368 STAMP=892980037
input archived log thread=1 sequence=20 RECID=369 STAMP=893025820
input archived log thread=1 sequence=21 RECID=370 STAMP=893044821
input archived log thread=1 sequence=22 RECID=371 STAMP=893109645
input archived log thread=1 sequence=23 RECID=372 STAMP=893112349
input archived log thread=1 sequence=24 RECID=373 STAMP=893190737
input archived log thread=1 sequence=25 RECID=374 STAMP=893198839
input archived log thread=1 sequence=26 RECID=375 STAMP=893260831
input archived log thread=1 sequence=27 RECID=376 STAMP=893290748
input archived log thread=1 sequence=28 RECID=377 STAMP=893311245
input archived log thread=1 sequence=29 RECID=378 STAMP=893358035
channel ORA_DISK_2: starting piece 1 at 28-OCT-15
channel ORA_DISK_3: starting compressed archived log backup set
channel ORA_DISK_3: specifying archived log(s) in backup set
input archived log thread=1 sequence=30 RECID=379 STAMP=893397618
input archived log thread=1 sequence=31 RECID=380 STAMP=893437206
input archived log thread=1 sequence=32 RECID=381 STAMP=893463766
input archived log thread=1 sequence=33 RECID=382 STAMP=893541621
input archived log thread=1 sequence=34 RECID=383 STAMP=893550271
input archived log thread=1 sequence=35 RECID=384 STAMP=893628016
input archived log thread=1 sequence=36 RECID=385 STAMP=893636762
input archived log thread=1 sequence=37 RECID=386 STAMP=893680197
input archived log thread=1 sequence=38 RECID=387 STAMP=893723265
input archived log thread=1 sequence=39 RECID=388 STAMP=893727390
input archived log thread=1 sequence=40 RECID=389 STAMP=893800830
input archived log thread=1 sequence=41 RECID=390 STAMP=893809792
channel ORA_DISK_3: starting piece 1 at 28-OCT-15
channel ORA_DISK_4: starting compressed archived log backup set
channel ORA_DISK_4: specifying archived log(s) in backup set
input archived log thread=1 sequence=42 RECID=391 STAMP=893887217
input archived log thread=1 sequence=43 RECID=392 STAMP=893894493
input archived log thread=1 sequence=44 RECID=393 STAMP=893916038
input archived log thread=1 sequence=45 RECID=394 STAMP=893977209
input archived log thread=1 sequence=46 RECID=395 STAMP=893998835
input archived log thread=1 sequence=47 RECID=396 STAMP=894034820
input archived log thread=1 sequence=48 RECID=397 STAMP=894067506
input archived log thread=1 sequence=49 RECID=398 STAMP=894146417
input archived log thread=1 sequence=50 RECID=399 STAMP=894154008
input archived log thread=1 sequence=51 RECID=400 STAMP=894232821
input archived log thread=1 sequence=52 RECID=401 STAMP=894240522
input archived log thread=1 sequence=53 RECID=402 STAMP=894278467
channel ORA_DISK_4: starting piece 1 at 28-OCT-15
channel ORA_DISK_1: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_124_3sqkr73s_1_1.bak tag=TAG20151028T104619 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:37
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_3_892652515.dbf RECID=352 STAMP=892677675
archived log file name=/home/oracle/app/archive/1_4_892652515.dbf RECID=353 STAMP=892678596
archived log file name=/home/oracle/app/archive/1_5_892652515.dbf RECID=354 STAMP=892687714
archived log file name=/home/oracle/app/archive/1_6_892652515.dbf RECID=355 STAMP=892708411
archived log file name=/home/oracle/app/archive/1_7_892652515.dbf RECID=356 STAMP=892718054
archived log file name=/home/oracle/app/archive/1_8_892652515.dbf RECID=357 STAMP=892718173
archived log file name=/home/oracle/app/archive/1_9_892652515.dbf RECID=358 STAMP=892718473
archived log file name=/home/oracle/app/archive/1_10_892652515.dbf RECID=359 STAMP=892749728
archived log file name=/home/oracle/app/archive/1_11_892652515.dbf RECID=360 STAMP=892765363
archived log file name=/home/oracle/app/archive/1_12_892652515.dbf RECID=361 STAMP=892792842
archived log file name=/home/oracle/app/archive/1_13_892652515.dbf RECID=362 STAMP=892817313
archived log file name=/home/oracle/app/archive/1_14_892652515.dbf RECID=363 STAMP=892850671
archived log file name=/home/oracle/app/archive/1_15_892652515.dbf RECID=364 STAMP=892864836
archived log file name=/home/oracle/app/archive/1_16_892652515.dbf RECID=365 STAMP=892892271
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=54 RECID=404 STAMP=894278583
input archived log thread=1 sequence=55 RECID=406 STAMP=894278584
input archived log thread=1 sequence=56 RECID=409 STAMP=894278585
input archived log thread=1 sequence=57 RECID=410 STAMP=894278588
input archived log thread=1 sequence=58 RECID=412 STAMP=894278778
channel ORA_DISK_1: starting piece 1 at 28-OCT-15
channel ORA_DISK_4: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_127_3vqkr73u_1_1.bak tag=TAG20151028T104619 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:02:41
channel ORA_DISK_4: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_42_892652515.dbf RECID=391 STAMP=893887217
archived log file name=/home/oracle/app/archive/1_43_892652515.dbf RECID=392 STAMP=893894493
archived log file name=/home/oracle/app/archive/1_44_892652515.dbf RECID=393 STAMP=893916038
archived log file name=/home/oracle/app/archive/1_45_892652515.dbf RECID=394 STAMP=893977209
archived log file name=/home/oracle/app/archive/1_46_892652515.dbf RECID=395 STAMP=893998835
archived log file name=/home/oracle/app/archive/1_47_892652515.dbf RECID=396 STAMP=894034820
archived log file name=/home/oracle/app/archive/1_48_892652515.dbf RECID=397 STAMP=894067506
archived log file name=/home/oracle/app/archive/1_49_892652515.dbf RECID=398 STAMP=894146417
archived log file name=/home/oracle/app/archive/1_50_892652515.dbf RECID=399 STAMP=894154008
archived log file name=/home/oracle/app/archive/1_51_892652515.dbf RECID=400 STAMP=894232821
archived log file name=/home/oracle/app/archive/1_52_892652515.dbf RECID=401 STAMP=894240522
archived log file name=/home/oracle/app/archive/1_53_892652515.dbf RECID=402 STAMP=894278467
channel ORA_DISK_1: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_128_40qkr78v_1_1.bak tag=TAG20151028T104619 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_54_892652515.dbf RECID=404 STAMP=894278583
archived log file name=/home/oracle/app/archive/1_55_892652515.dbf RECID=406 STAMP=894278584
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_56_892652515.dbf RECID=409 STAMP=894278585
archived log file name=/home/oracle/app/archive/1_57_892652515.dbf RECID=410 STAMP=894278588
archived log file name=/home/oracle/app/archive/1_58_892652515.dbf RECID=412 STAMP=894278778
channel ORA_DISK_3: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_126_3uqkr73t_1_1.bak tag=TAG20151028T104619 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:02:47
channel ORA_DISK_3: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_30_892652515.dbf RECID=379 STAMP=893397618
archived log file name=/home/oracle/app/archive/1_31_892652515.dbf RECID=380 STAMP=893437206
archived log file name=/home/oracle/app/archive/1_32_892652515.dbf RECID=381 STAMP=893463766
archived log file name=/home/oracle/app/archive/1_33_892652515.dbf RECID=382 STAMP=893541621
archived log file name=/home/oracle/app/archive/1_34_892652515.dbf RECID=383 STAMP=893550271
archived log file name=/home/oracle/app/archive/1_35_892652515.dbf RECID=384 STAMP=893628016
archived log file name=/home/oracle/app/archive/1_36_892652515.dbf RECID=385 STAMP=893636762
archived log file name=/home/oracle/app/archive/1_37_892652515.dbf RECID=386 STAMP=893680197
archived log file name=/home/oracle/app/archive/1_38_892652515.dbf RECID=387 STAMP=893723265
archived log file name=/home/oracle/app/archive/1_39_892652515.dbf RECID=388 STAMP=893727390
archived log file name=/home/oracle/app/archive/1_40_892652515.dbf RECID=389 STAMP=893800830
archived log file name=/home/oracle/app/archive/1_41_892652515.dbf RECID=390 STAMP=893809792
channel ORA_DISK_2: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_125_3tqkr73s_1_1.bak tag=TAG20151028T104619 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:02:52
channel ORA_DISK_2: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_17_892652515.dbf RECID=366 STAMP=892910475
archived log file name=/home/oracle/app/archive/1_18_892652515.dbf RECID=367 STAMP=892939309
archived log file name=/home/oracle/app/archive/1_19_892652515.dbf RECID=368 STAMP=892980037
archived log file name=/home/oracle/app/archive/1_20_892652515.dbf RECID=369 STAMP=893025820
archived log file name=/home/oracle/app/archive/1_21_892652515.dbf RECID=370 STAMP=893044821
archived log file name=/home/oracle/app/archive/1_22_892652515.dbf RECID=371 STAMP=893109645
archived log file name=/home/oracle/app/archive/1_23_892652515.dbf RECID=372 STAMP=893112349
archived log file name=/home/oracle/app/archive/1_24_892652515.dbf RECID=373 STAMP=893190737
archived log file name=/home/oracle/app/archive/1_25_892652515.dbf RECID=374 STAMP=893198839
archived log file name=/home/oracle/app/archive/1_26_892652515.dbf RECID=375 STAMP=893260831
archived log file name=/home/oracle/app/archive/1_27_892652515.dbf RECID=376 STAMP=893290748
archived log file name=/home/oracle/app/archive/1_28_892652515.dbf RECID=377 STAMP=893311245
archived log file name=/home/oracle/app/archive/1_29_892652515.dbf RECID=378 STAMP=893358035
Finished backup at 28-OCT-15

Starting Control File and SPFILE Autobackup at 28-OCT-15
piece handle=/home/oracle/rmanback/con_c-1536971911-20151028-00 comment=NONE
Finished Control File and SPFILE Autobackup at 28-OCT-15


可以看到sequence 53 之前的,只有一个路径的已经被删除了,而多个路径的只删除一个路径下面的归档

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name PROD2
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
403     1    53      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_53_892652515.dbf

405     1    54      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_54_892652515.dbf

407     1    55      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_55_892652515.dbf

408     1    56      A 28-OCT-15
Name: /home/oracle/app/archive/1_56_892652515.dbf

411     1    57      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_57_892652515.dbf

413     1    58      A 28-OCT-15
Name: /home/oracle/app/fast_recovery_area/prod2/1_58_892652515.dbf


4.我们使用delete all input看一下结果

RMAN> backup archivelog all delete all input;

Starting backup at 28-OCT-15
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
skipping archived logs of thread 1 from sequence 53 to 58; already backed up
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=59 RECID=414 STAMP=894279095
channel ORA_DISK_1: starting piece 1 at 28-OCT-15
channel ORA_DISK_2: deleting archived log(s)
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_53_892652515.dbf RECID=403 STAMP=894278467
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_54_892652515.dbf RECID=405 STAMP=894278583
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_55_892652515.dbf RECID=407 STAMP=894278584
archived log file name=/home/oracle/app/archive/1_56_892652515.dbf RECID=408 STAMP=894278585
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_57_892652515.dbf RECID=411 STAMP=894278588
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_58_892652515.dbf RECID=413 STAMP=894278778
channel ORA_DISK_1: finished piece 1 at 28-OCT-15
piece handle=/home/oracle/rmanback/backupPROD2_130_42qkr7dn_1_1.bak tag=TAG20151028T105135 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/home/oracle/app/archive/1_59_892652515.dbf RECID=414 STAMP=894279095
archived log file name=/home/oracle/app/fast_recovery_area/prod2/1_59_892652515.dbf RECID=415 STAMP=894279095
Finished backup at 28-OCT-15

Starting Control File and SPFILE Autobackup at 28-OCT-15
piece handle=/home/oracle/rmanback/con_c-1536971911-20151028-01 comment=NONE
Finished Control File and SPFILE Autobackup at 28-OCT-15

RMAN> list archivelog all;

specification does not match any archived log in the repository


总结:

delete input 只备份一个路径下的archivelog,只删除备份的目标路径下的archivelog;

delete all input 只备份一个路径下的archivelog,删除所有路径下的archivelog;

–本文乃原创文章,请勿转载。如须转载请详细标明转载出处
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: