发现11.2.0.2的物理备库无法删除过期日志,删除脚本如下
[oracle@report-db01 ~]$ more /home/oracle/monitor/deletearchivelog.sh
. /home/oracle/.bash_profile
rman target / @/home/oracle/monitor/deletearchivelog > /home/oracle/monitor/deletearchivelog.log
[oracle@report-db01 ~]$ more /home/oracle/monitor/deletearchivelog
crosscheck archivelog all;
delete noprompt force archivelog until time 'sysdate-1/4';
其中报错日志为
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
此为11g的bug,需要在delete后加上force关键字,metalink上有记载
RMAN-08137 When deleting archivelogs even when Streams CAPTURE does not require them [ID 1079953.1]
修改时间27-FEB-2011 类型PROBLEM 状态PUBLISHED
In this Document
Symptoms
Changes
Cause
Solution
References
Symptoms
Applies To:11gR1-11gR2
RMAN is unable to delete archive logs from database even though they are not needed by CAPTURE process anymore.
Changes
Cause
In 11g, RMAN looks at MIN_REQUIRED_CAPTURE_CHANGE# in v$database and not at DBA_CAPTURE. By default this value is updated every 6 hours. So by default the value in v$database will be six hours behind the current value.
Solution
Since changing frequency of update to MIN_REQUIRED_CAPTURE_CHANGE# in v$database can not be controlled, following workaround can be used:
Archive log which are not needed by capture process can be deleted using:
delete noprompt force archivelog all completed before 'sysdate-10/1440';