以下是在作failover时standby端的alertlog内容,情况时拔掉primary的网线,模拟primary数据库网络环境突然损坏。
–下行表示standby端的standby redo log已经启用
rfs: successfully opened standby logfile 4: /global/oradata/ctsdb/stdby_redo04.log
tue aug 31 19:54:30 2004
media recovery log /global/oradata/ctsdb/archive/arch1_8389.log
media recovery waiting for thread 1 seq# 8390 (in transit)
tue aug 31 19:54:57 2004
restarting dead background process qmn0
qmn0 started with pid=12
tue aug 31 19:55:19 2004
–开始failover,第一步
alter database recover managed standby database finish
tue aug 31 19:55:19 2004
terminal recovery: request posted
tue aug 31 19:55:48 2004
–在sqlplus端finish命令没有报错,正常结束,但是下面几行显示standby redo file并没有被正确recover
warning: log 4 of thread 1 is being archived or modified
mrp0: background media recovery terminated with error 261
tue aug 31 19:55:48 2004
errors in file /export/home/oracle/app/oracle/admin/ctsdb/bdump/ctsdb_mrp0_2201.trc:
ora-00261: log 4 of thread 1 is being archived or modified
ora-00312: online log 4 thread 1: /global/oradata/ctsdb/stdby_redo04.log
recovery interrupted.
mrp0: background media recovery process shutdown
tue aug 31 19:55:48 2004
terminal recovery: completion detected
completed: alter database recover managed standby database fi
–failover第二步,执行switchover
tue aug 31 19:56:01 2004
alter database commit to switchover to primary
tue aug 31 19:56:01 2004
alter database commit to switchover to primary
database not recovered through end-of-redo
database not recovered through end-of-redo
–switchover报错,无法将standby转为primary
switchover: media recovery required – standby not in limbo
ora-16139 signalled during: alter database commit to switchover to primary…
–尝试使用activate命令,同样报ora-00261错误
tue aug 31 19:57:16 2004
alter database activate standby database
tue aug 31 19:57:16 2004
alter database activate [physical] standby database
tue aug 31 19:57:31 2004
warning: log 4 of thread 1 is being archived or modified
activate standby database received error 261
ora-261 signalled during: alter database activate standby database…
tue aug 31 19:58:18 2004
alter database commit to switchover to primary
tue aug 31 19:58:18 2004
alter database commit to switchover to primary
database not recovered through end-of-redo
database not recovered through end-of-redo
switchover: media recovery required – standby not in limbo
ora-16139 signalled during: alter database commit to switchover to primary…
–重新将standby置为管理恢复模式
tue aug 31 20:04:18 2004
alter database recover managed standby database disconnect from session
attempt to start background managed standby recovery process
mrp0 started with pid=12
mrp0: background managed standby recovery process started
tue aug 31 20:04:22 2004
rfs: possible network disconnect with primary database
tue aug 31 20:04:24 2004
starting datafile 1 recovery in thread 1 sequence 8390
datafile 1: /global/oradata/ctsdb/system01.dbf
starting datafile 2 recovery in thread 1 sequence 8390
datafile 2: /global/oradata/ctsdb/undotbs01.dbf
starting datafile 3 recovery in thread 1 sequence 8390
datafile 3: /global/oradata/ctsdb/indx01.dbf
starting datafile 4 recovery in thread 1 sequence 8390
datafile 4: /global/oradata/ctsdb/tools01.dbf
starting datafile 5 recovery in thread 1 sequence 8390
datafile 5: /global/oradata/ctsdb/users01.dbf
starting datafile 6 recovery in thread 1 sequence 8390
datafile 6: /global/oradata/ctsdb/perfstat.dbf
starting datafile 7 recovery in thread 1 sequence 8390
datafile 7: /global/oradata/ctsdb/stk_his_data1_01.dbf
starting datafile 8 recovery in thread 1 sequence 8390
datafile 8: /global/oradata/ctsdb/stk_his_data2_01.dbf
starting datafile 9 recovery in thread 1 sequence 8390
datafile 9: /global/oradata/ctsdb/stk_his_data3_01.dbf
starting datafile 10 recovery in thread 1 sequence 8390
datafile 10: /global/oradata/ctsdb/stk_his_data4_01.dbf
starting datafile 11 recovery in thread 1 sequence 8390
datafile 11: /global/oradata/ctsdb/stk_his_ind_ts01.dbf
starting datafile 12 recovery in thread 1 sequence 8390
datafile 12: /global/oradata/ctsdb/stk_his_ind_ts03.dbf
starting datafile 13 recovery in thread 1 sequence 8390
datafile 13: /global/oradata/ctsdb/stk_his_ind_data1_01.dbf
starting datafile 14 recovery in thread 1 sequence 8390
datafile 14: /global/oradata/ctsdb/stk_his_ind_data2_01.dbf
starting datafile 15 recovery in thread 1 sequence 8390
datafile 15: /global/oradata/ctsdb/stk_his_ind_data3_01.dbf
starting datafile 16 recovery in thread 1 sequence 8390
datafile 16: /global/oradata/ctsdb/stk_his_ind_data4_01.dbf
starting datafile 17 recovery in thread 1 sequence 8390
datafile 17: /global/oradata/ctsdb/stk_his_ts01.dbf
starting datafile 18 recovery in thread 1 sequence 8390
datafile 18: /global/oradata/ctsdb/stk_his_ts02.dbf
starting datafile 19 recovery in thread 1 sequence 8390
datafile 19: /global/oradata/ctsdb/stk_inx_ts01.dbf
starting datafile 20 recovery in thread 1 sequence 8390
datafile 20: /global/oradata/ctsdb/stk_inx_ts02.dbf
starting datafile 21 recovery in thread 1 sequence 8390
datafile 21: /global/oradata/ctsdb/stk_ts01.dbf
starting datafile 22 recovery in thread 1 sequence 8390
datafile 22: /global/oradata/ctsdb/stk_ts02.dbf
starting datafile 23 recovery in thread 1 sequence 8390
datafile 23: /global/oradata/ctsdb/logmnrts01.dbf
starting datafile 24 recovery in thread 1 sequence 8390
datafile 24: /global/oradata/ctsdb/ts_test01.dbf
starting datafile 25 recovery in thread 1 sequence 8390
datafile 25: /global/oradata/ctsdb/ts_test02.dbf
starting datafile 26 recovery in thread 1 sequence 8390
datafile 26: /global/oradata/ctsdb/stk_his_ind_ts02.dbf
starting datafile 27 recovery in thread 1 sequence 8390
datafile 27: /global/oradata/ctsdb/stk_ts03.dbf
media recovery waiting for thread 1 seq# 8390
tue aug 31 20:04:24 2004
completed: alter database recover managed standby database di
–用skip standby logfile选项作failover
tue aug 31 20:04:40 2004
alter database recover managed standby database finish skip standby logfile
tue aug 31 20:04:40 2004
database not recovered through end-of-redo
terminal incomplete recovery: request posted
tue aug 31 20:04:54 2004
terminal incomplete recovery: until change 3592753
terminal incomplete recovery: end-of-redo log allocation
terminal incomplete recovery: log 4 reserved for thread 1 seq# 8390
terminal recovery changing datafile format version from 8.0.0.0.0 to 9.0.0.0.0
switching logfile format version from 8.0.0.0.0 to 9.0.0.0.0
terminal incomplete recovery: clearing standby redo logs.
terminal incomplete recovery: thread 1 seq# 8390 redo required
terminal incomplete recovery: end-of-redo log /global/oradata/ctsdb/stdby_redo04.log
identified end-of-redo for thread 1 sequence 8390
terminal incomplete recovery: end checkpoint scn 3592754
mrp0: media recovery complete
switching logfile format version from 9.0.0.0.0 to 8.0.0.0.0
terminal incomplete recovery: successful completion
begin: wait for standby logfiles to be archived
tue aug 31 20:04:55 2004
arc0: evaluating archive log 4 thread 1 sequence 8390
arc0: beginning to archive log 4 thread 1 sequence 8390
tue aug 31 20:04:55 2004
arc1: evaluating archive log 4 thread 1 sequence 8390
tue aug 31 20:04:55 2004
creating archive destination log_archive_dest_1: /global/oradata/ctsdb/archive/arch1_8390.log
tue aug 31 20:04:55 2004
arc1: unable to archive log 4 thread 1 sequence 8390
log actively being archived by another process
tue aug 31 20:04:55 2004
arc0: completed archiving log 4 thread 1 sequence 8390
tue aug 31 20:05:10 2004
end: all standby logfiles have been archived
resetting standby activation id 4038461969 (0xf0b60a11)
mrp0: background media recovery process shutdown
tue aug 31 20:05:10 2004
terminal incomplete recovery: completion detected
completed: alter database recover managed standby database fi
–failover成功,但是可以看到数据库作了resetlogs,这并不是我们希望的,而且由于skip了当前的standby redo log,所以肯定有相当的数据损失。
tue aug 31 20:05:12 2004
alter database commit to switchover to primary
alter database commit to switchover to primary
resetlogs after incomplete recovery until change 3592754
resetting resetlogs activation id 0 (0x0)
online log 3 of thread 1 was previously cleared
online log 5 of thread 0 was previously cleared
online log 6 of thread 0 was previously cleared
online log 7 of thread 0 was previously cleared
resetlogs changing datafile format version from 9.0.0.0.0 to 8.0.0.0.0
switchover: complete – database shutdown required
completed: alter database commit to switchover to primary
查metalink,只说这种情况是可能因为standby redo log没有被启用而引起的,但是我这里的情况明显是已经被启用了。
