DataGuard

浏览:63日期:2024-01-14
在DataGuard环境中假如我们在做failover的时候,可能会碰到ORA-00261错误,下面是该错误的产生原因和解决方法。 假如是由于网络问题而导致需要切换,那么通常standby端的RFS进程并不会意识到primary已经不可访问,所以RFS进程也不会释放当前的standby redo log文件。假如是primary端的数据库实例由于故障中断,那么一般情况下standby端的RFS进程会马上意识到primary已经不可访问,也就会马上释放当前的standby redo log文件。只要RFS进程没有释放standby redo log文件,那么执行ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH命令就会在alertlog文件中发现如下的报错信息 Warning: log 4 of thread 1 is being archived or modifiedRecovery interrupted.Media Recovery failed with error 261假如在报上述错误的时候,执行SWITCH,那么将会出现下面的错误:ORA-16139: media recovery required所以必须检查alertlog文件,直到发现如下信息才表示RFS进程已经释放了standby redo log文件,这时候才可以作FINISH:RFS: Possible network disconnect with primary database促使RFS进程释放standby redo log 文件有两种方法:1.;等待RFS进程的network timeout,通常需要等待8分钟左右2.;关闭standby数据库,再重新开启,这样会强制RFS进程释放standby redo log我们可以通过v$managed_standby视图来监控RFS进程何时释放实行Failover:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;alertlog中将显示如下信息,表示finish成功:Terminal Incomplete Recovery: UNTIL CHANGE 3738452Terminal Incomplete Recovery: End-Of-Redo log allocationTerminal Incomplete Recovery: log 4 reserved for thread 1 seq# 8772TERMINAL RECOVERY changing datafile format version from 8.0.0.0.0 to 9.0.0.0.0Switching logfile format version from 8.0.0.0.0 to 9.0.0.0.0Terminal Incomplete Recovery: clearing standby redo logs.Terminal Incomplete Recovery: thread 1 seq# 8772 redo requiredTerminal Incomplete Recovery: End-Of-Redo log /global/oradata/ctsdb/stdby_redo04.logIdentified end-of-REDO for thread 1 sequence 8772Terminal Incomplete Recovery: end checkpoint SCN 3738453Media Recovery CompleteSwitching logfile format version from 9.0.0.0.0 to 8.0.0.0.0Terminal Incomplete Recovery: sUCcessful completionBegin: Wait for standby logfiles to be archivedWed Sep; 1 13:42:28 2004ARC1: Evaluating archivelog 4 thread 1 sequence 8772Wed Sep; 1 13:42:28 2004ARC0: Evaluating archivelog 4 thread 1 sequence 8772Wed Sep; 1 13:42:28 2004ARC1: Beginning to archive log 4 thread 1 sequence 8772Wed Sep; 1 13:42:28 2004ARC0: Unable to archive log 4 thread 1 sequence 8772Wed Sep; 1 13:42:28 2004Creating archive destination LOG_ARCHIVE_DEST_1: '/global/oradata/ctsdb/archive/arch1_8772.log'Wed Sep; 1 13:42:28 2004 Log actively being archived by another processWed Sep; 1 13:42:28 2004ARC1: Completed archiving; log 4 thread 1 sequence 8772Wed Sep; 1 13:42:43 2004End: All standby logfiles have been archivedResetting standby activation ID 4038461969 (0xf0b60a11)Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISHFINSH成功之后再执行SWITCH:ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;SWITCH成功之后,重新启动数据库:SHUTDOWN IMMEDIATE;STARTUP;
相关文章: