博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
归档日志 delete input 和delete all input 区别
阅读量:5949 次
发布时间:2019-06-19

本文共 5288 字,大约阅读时间需要 17 分钟。

关于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 没啥区别。

 

 

 

 

转载地址:http://ljixx.baihongyu.com/

你可能感兴趣的文章
N26-第二周作业
查看>>
关于一阶逻辑中实例化的可满足性问题
查看>>
cut命令用法讲解
查看>>
我的第一篇日志。
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
企业实战:mysql5.6数据库备份、恢复脚本
查看>>
RabbitMQ(消息队列)Linux安装相关问题解决
查看>>
我的友情链接
查看>>
CentOS7安装mysql
查看>>
RMB數字轉換中文
查看>>
基于rhel7.2的Zabbix平台搭建和部署(二)
查看>>
Html5本地存储和本地数据库
查看>>
我的友情链接
查看>>
JQ 循环切换DIV
查看>>
Nagios监控NetAPP NAS存储容量,Volume、Qtree
查看>>
Android Fragment实践(二)
查看>>
centos 修改主机名立即生效和重启后也生效的方法
查看>>
Windows 64 位 mysql 5.7以上版本包解压安装
查看>>
知道双字节码, 如何获取汉字 - 回复 "pinezhou" 的问题
查看>>