归档日志 delete input 和delete all input 区别
關(guān)于archivelog delete input 和delete all input區(qū)別
1 rman的歸檔位置定義兩個(gè)
? log_archive_dest_1?????????????????? string????? LOCATION=/oracle/archive
? log_archive_dest_2?????????????????? string????? LOCATION=/oracle/archive2/
2 執(zhí)行alter system switch logfile命令后兩個(gè)歸檔目錄下的歸檔日志
[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 執(zhí)行
RMAN> backup database plus archivelog delete input; 查看日志可以發(fā)現(xiàn)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
注意刪除的歸檔日志位置隨機(jī)有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 執(zhí)行backup database plus archivelog delete all input ;查看日志發(fā)現(xiàn)oracle刪除的歸檔日志 發(fā)現(xiàn)刪除了兩個(gè)目錄下的所有日志
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將僅刪除已備份的歸檔日志,例如對(duì)于有兩個(gè)歸檔目錄 /arc_dest1 和 /arc_dest2 如果把/arc_dest1做為backup的源,delete input將刪除 /arc_dest1 中的內(nèi)容,保留dest2中的歸檔日志,通過實(shí)驗(yàn)可以看出,就算有兩個(gè)歸檔位置,rman備份的時(shí)候貌似是以日志文件為源,備份過的日志刪除。
---------------------------------------------------------------------------------------------------------------------------------------------------
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對(duì)于所有歸檔目錄中的日志序列號(hào)只備份一次,同時(shí)rman會(huì)刪除dest1 和dest2 中所有歸檔日志。
結(jié)論:對(duì)于僅有一個(gè)歸檔目錄 delete input 和delet all input 沒啥區(qū)別。
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的归档日志 delete input 和delete all input 区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云计算涉足网游
- 下一篇: 编写properties文件的Eclip