归档日志 delete input 和delete all input 区别

关于archivelog delete input 和delete all input区别
1 rman的归档位置定义两个
  log_archive_dest_1                   string      LOCATION=/oracle/archive
  log_archive_dest_2                   string      LOCATION=/oracle/archive2/
2 执行alter system switch logfile命令后两个归档目录下的归档日志
[oracle@oracle archive]$ ls -lt
total 2648
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:29 1_38_791488634.dbf
-rw-r----- 1 oracle oinstall    1536 Aug 17 16:29 1_37_791488634.dbf
-rw-r----- 1 oracle oinstall    1536 Aug 17 16:29 1_35_791488634.dbf
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:29 1_36_791488634.dbf
-rw-r----- 1 oracle oinstall    5120 Aug 17 16:26 1_34_791488634.dbf
-rw-r----- 1 oracle oinstall   59392 Aug 17 16:23 1_33_791488634.dbf
--------------------------------------------------------------------------
[root@oracle archive2]# ls -lt
total 88
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:29 1_38_791488634.dbf
-rw-r----- 1 oracle oinstall  1536 Aug 17 16:29 1_37_791488634.dbf
-rw-r----- 1 oracle oinstall  1536 Aug 17 16:29 1_35_791488634.dbf
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:29 1_36_791488634.dbf
-rw-r----- 1 oracle oinstall  5120 Aug 17 16:26 1_34_791488634.dbf
-rw-r----- 1 oracle oinstall 59392 Aug 17 16:23 1_33_791488634.dbf
3 执行
RMAN> backup database plus archivelog delete input; 查看日志可以发现oracle删除的归档日志仅仅是其备份过的。
archived log file name=/oracle/archive2/1_33_791488634.dbf RECID=321 STAMP=791569408
archived log file name=/oracle/archive/1_34_791488634.dbf RECID=322 STAMP=791569592
archived log file name=/oracle/archive/1_35_791488634.dbf RECID=324 STAMP=791569775
archived log file name=/oracle/archive2/1_36_791488634.dbf RECID=327 STAMP=791569775
archived log file name=/oracle/archive2/1_37_791488634.dbf RECID=329 STAMP=791569778
archived log file name=/oracle/archive/1_38_791488634.dbf RECID=330 STAMP=791569780
archived log file name=/oracle/archive/1_39_791488634.dbf RECID=332 STAMP=791570012
archived log file name=/oracle/archive/1_40_791488634.dbf RECID=334 STAMP=791570187
注意删除的归档日志位置随机有archive2 也有archive。
4 重新切换生成归档日志
[oracle@oracle archive]$ ls -lt
total 2684
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:53 1_46_791488634.dbf
-rw-r----- 1 oracle oinstall    1536 Aug 17 16:53 1_44_791488634.dbf
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:53 1_45_791488634.dbf
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:53 1_42_791488634.dbf
-rw-r----- 1 oracle oinstall    1024 Aug 17 16:53 1_43_791488634.dbf
-rw-r----- 1 oracle oinstall   32768 Aug 17 16:53 1_41_791488634.dbf
----------------------------------------------------------------------------
[root@oracle archive2]# ls -lt
total 92
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:53 1_46_791488634.dbf
-rw-r----- 1 oracle oinstall  1536 Aug 17 16:53 1_44_791488634.dbf
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:53 1_45_791488634.dbf
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:53 1_42_791488634.dbf
-rw-r----- 1 oracle oinstall  1024 Aug 17 16:53 1_43_791488634.dbf
-rw-r----- 1 oracle oinstall 32768 Aug 17 16:53 1_41_791488634.dbf

5 执行backup database plus archivelog delete all input ;查看日志发现oracle删除的归档日志 发现删除了两个目录下的所有日志
archived log file name=/oracle/archive2/1_40_791488634.dbf RECID=335 STAMP=791570187
archived log file name=/oracle/archive/1_41_791488634.dbf RECID=336 STAMP=791571221
archived log file name=/oracle/archive2/1_41_791488634.dbf RECID=337 STAMP=791571221
archived log file name=/oracle/archive2/1_42_791488634.dbf RECID=339 STAMP=791571222
archived log file name=/oracle/archive/1_42_791488634.dbf RECID=338 STAMP=791571222
archived log file name=/oracle/archive/1_43_791488634.dbf RECID=340 STAMP=791571222
archived log file name=/oracle/archive2/1_43_791488634.dbf RECID=341 STAMP=791571222
archived log file name=/oracle/archive/1_44_791488634.dbf RECID=342 STAMP=791571228
archived log file name=/oracle/archive2/1_44_791488634.dbf RECID=343 STAMP=791571228
archived log file name=/oracle/archive/1_45_791488634.dbf RECID=344 STAMP=791571228
archived log file name=/oracle/archive2/1_45_791488634.dbf RECID=345 STAMP=791571228
archived log file name=/oracle/archive2/1_46_791488634.dbf RECID=347 STAMP=791571229
archived log file name=/oracle/archive/1_46_791488634.dbf RECID=346 STAMP=791571229
archived log file name=/oracle/archive/1_47_791488634.dbf RECID=348 STAMP=791571526
archived log file name=/oracle/archive2/1_47_791488634.dbf RECID=349 STAMP=791571526

oracle官方文档提示:
If you had specified DELETE INPUT rather than DELETE ALL INPUT, then RMAN would have only deleted the specific archived redo log files that it backed up. For
example, RMAN would delete the logs in /arc_dest1 if these files were used as the source of the backup, but leave the contents of the /arc_dest2 intact
如果指定delete input ,则rman将仅删除已备份的归档日志,例如对于有两个归档目录 /arc_dest1 和 /arc_dest2 如果把/arc_dest1做为backup的源,delete input将删除 /arc_dest1 中的内容,保留dest2中的归档日志,通过实验可以看出,就算有两个归档位置,rman备份的时候貌似是以日志文件为源,备份过的日志删除。
---------------------------------------------------------------------------------------------------------------------------------------------------
If you had specified DELETE ALL INPUT RMAN backs up only one copy of each log sequence number in these archiving locations.it deletes all copies of any log that it backed up from the other archiving destinations
如果指定delete all input RMAN对于所有归档目录中的日志序列号只备份一次,同时rman会删除dest1 和dest2 中所有归档日志。

结论:对于仅有一个归档目录 delete input 和delet all input 没啥区别。

 

 

 

 

你可能感兴趣的:(delete,区别,input,input,all,和delete)