在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;