分类: Oracle
2011-06-10 17:00:02
弄oracle的备份的时候可能大家都碰到过RMAN-06726: could not locate archivelog错误,就像下面:
piece handle=full_584_1_702177777 tag=HOT_DB_BK_LEVEL0 comment=API Version 2.0,MMS Version 5.4.1.0
channel ch01: backup set complete, elapsed time: 00:00:14
Finished backup at 06-NOV-09
Starting backup at 06-NOV-09
current log archived
released channel: ch00
released channel: ch01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/06/2009 01:23:36
RMAN-06726: could not locate archivelog /archive/cog/1_132_680807139.dbf
RMAN>
如果是单实例的数据库,最简单的方法就是crosscheck一下,但是在rac环境就不同了
例如数据库cog有两个instance:cog1,cog2
rman在一个实例cog1上连接后做crosscheck通常都会碰到另一个实例cog2上的archivelog全都为failed。
$ rman target / catalog
RMAN> crosscheck archivelog all;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 instance=cog1 devtype=DISK
validation succeeded for archived log
archive log filename=/archive/cog/1_132_680807139.dbf recid=669 stamp=696734643
validation succeeded for archived log
archive log filename=/archive/cog/1_133_680807139.dbf recid=670 stamp=696734643
validation succeeded for archived log
archive log filename=/archive/cog/1_134_680807139.dbf recid=671 stamp=696734643
validation succeeded for archived log
...
archive log filename=/archive/cog/2_3_680807139.dbf recid=10 stamp=682605190
validation failed for archived log
archive log filename=/archive/cog/2_4_680807139.dbf recid=12 stamp=682651434
validation failed for archived log
archive log filename=/archive/cog/2_5_680807139.dbf recid=13 stamp=682737824
validation failed for archived log
archive log filename=/archive/cog/2_6_680807139.dbf recid=15 stamp=682824213
validation failed for archived log
如果是归档到各个节点都能操作的共享文件系统,例如ocfs2,nfs或者是ASM就不会出现这种问题。
但如果是rac并且各个节点都是归档到本地文件系统的话就一定要使用下面的方式crosscheck:
run {
allocate channel for maintenance device type disk connect ;
allocate channel for maintenance device type disk connect ;
crosscheck archivelog all;
}