在controlfile中记录着每一个archivelog的相关信息,当我们在OS下把这些物理文件delete掉或异常变动后,在controlfile中仍然记录着这些archivelog的信息,当我们手工清除archive目录下的文件后,这些记录并没有被我们从controlfile中清除掉,也就是oracle并不知道这些文件已经不存在了!这时候我们要做手工的清除。

 
 
报错信息
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 1/21/2011 20:32:53
RMAN-06726: could not locate archivelog /arch2/instance/2_111_11111.dbf
 
 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 1/22/2011 03:23:29
RMAN-06059: expected archived log not found, lost of archived log compromises re
coverability
ORA-19625: error identifying file /arch01/1_111_111111.dbf
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
 
------------------------------------------------------------------------------------------------------------------------
Oracle归档交叉校验
 
su - oracle 
export ORACLE_SID=****
rman target /  (rman target sys/oracle@8888)
如果是单实例的数据库,最简单的方法就是crosscheck一下:
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;
但是在rac环境就不同了
例如数据库cog有两个instance:cog1,cog2
rman在一个实例cog1上连接后做crosscheck通常都会碰到另一个实例cog2上的archivelog全都为failed。
如果是归档到各个节点都能操作的共享文件系统,例如ocfs2,nfs或者是ASM就不会出现这种问题。
但如果是rac并且各个节点都是归档到本地文件系统的话就一定要使用下面的方式crosscheck:
RAC模式下:
RMAN> allocate channel for maintenance device type disk connect 'sys/oracle@password';
RMAN> allocate channel for maintenance device type disk connect 'sys/oracle@password';
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;