这时应该可以推断出由于控制文件中只能保留224条归档日志数据,所以以前的归档信息已经被控制文件刷出,RMAN无法识别到这些归档文件,所以就无法删除这些归档日志。
那么现在如果使用RMAN删除这些旧的归档日志呢?我想到使用catalog start with 命令重新注册这些文件到控制文件中
RMAN> catalog start with '/opt/oracle/archive/db';
......
File Name: /opt/oracle/archive/db/1_1005_91233774.dbf
File Name: /opt/oracle/archive/db/1_1006_91233774.dbf
File Name: /opt/oracle/archive/db/1_1007_91233774.dbf
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
......
RMAN> list archivelog all;
.....
1236 1 301 A 22-OCT-16
Name: /opt/oracle/archive/db/1_301_91233774.dbf
1237 1 302 A 22-OCT-16
Name: /opt/oracle/archive/db/1_302_91233774.dbf
......
旧的归档日志文件已经注册到控制文件中了,再使用RMAN进行删除就可以了
delete archivelog until logseq 1007;
再次查询v$controlfile_record_section视图,records_total也被“撑”大了
SYS@db> select * from v$controlfile_record_section where type='ARCHIVED LOG';
TYPE RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID
---------------------------- ----------- ------------- ------------ ----------- ---------- ----------
ARCHIVED LOG 584 896 742 807 652 1800
至此问题结束。