迁移redo文件遇到ORA-00362错误
Dec242012
今天在测试迁移redo日志文件时,遇到ORA-00362错误,如下:
SQL> alter database drop logfile member '/u01/app/oracle/oradata/stream/redo01.log'; alter database drop logfile member '/u01/app/oracle/oradata/stream/redo01.log' * ERROR at line 1: ORA-00362: member is required to form a valid logfile in group 1 ORA-01517: log member: '/u01/app/oracle/oradata/stream/redo01.log'
这个错误是因为刚刚在logfile group 1日志组里添加了一个新的日志成员,ORACLE还没构建完成新增加的日志成员,也就是现在logfile group 1日志组里的成员状态还不一致。以下是实验过程,OEL5.4 ORACLE 10.2.0.1.0。
为logfile group 1日志组增加成员。
SQL> alter database add logfile member '/u01/app/oracle/oradata/dbdream/redo01_1.log' to group 1; Database altered.
然后删除logfile group 1的原有成员redo01.log报错。
SQL> alter database drop logfile member '/u01/app/oracle/oradata/stream/redo01.log'; alter database drop logfile member '/u01/app/oracle/oradata/stream/redo01.log' * ERROR at line 1: ORA-00362: member is required to form a valid logfile in group 1 ORA-01517: log member: '/u01/app/oracle/oradata/stream/redo01.log'
查询V$LOGFILE视图就会发现,两个member状态不一致。
SQL> select * from V$logfile where group#=1; GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- ----------------------------------------------- --- 1 ONLINE /u01/app/oracle/oradata/stream/redo01.log NO 1 INVALID ONLINE /u01/app/oracle/oradata/dbdream/redo01_1.log NO
切换日志,使新增加的member被使用(构建完成)。
SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> / System altered.
再次查看V$LOGFILE视图,状态正常。
SQL> select * from V$logfile where group#=1; GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- ----------------------------------------------- --- 1 ONLINE /u01/app/oracle/oradata/stream/redo01.log NO 1 ONLINE /u01/app/oracle/oradata/dbdream/redo01_1.log NO
此时,即可删除该日志组成员。
SQL> alter database drop logfile member '/u01/app/oracle/oradata/stream/redo01.log'; Database altered.
注:当前日志组不允许删除日志组成员。