原因可能是:
当备用数据库具有不同的化身( 查V$DATABASE_INCARNATION )时,可能会发生这种情况。
每当使用 RESETLOGS 选项(例如闪回、故障转移)打开数据库时,数据库都会创建一个新的化身
例如:
解决方法1:
-
--v$archive_gap 的替代SQL
-
-
select USERENV('Instance'), high.thread#, low.lsq, high.hsq
-
from (select a.thread#, rcvsq, min(a.sequence#) - 1 hsq
-
from v$archived_log a,
-
(select thread#, resetlogs_change#, max(sequence#) rcvsq
-
from v$log_history
-
where (thread#, resetlogs_change#) in
-
(select thread#, max(resetlogs_change#)
-
from v$log_history
-
group by thread#)
-
group by thread#, resetlogs_change#) b
-
where a.thread# = b.thread#
-
and a.resetlogs_change# = b.resetlogs_change#
-
and a.sequence# > rcvsq
-
group by a.thread#, rcvsq) high,
-
(select srl_lsq.thread#, nvl(lh_lsq.lsq, srl_lsq.lsq) lsq
-
from (select thread#, min(sequence#) + 1 lsq
-
from v$log_history, v$datafile
-
where checkpoint_change# <= next_change#
-
and checkpoint_change# >= first_change#
-
and enabled = 'READ WRITE'
-
group by thread#) lh_lsq,
-
(select thread#, max(sequence#) + 1 lsq
-
from v$log_history
-
where (select min(checkpoint_change#)
-
from v$datafile
-
where enabled = 'READ WRITE') >= next_change#
-
group by thread#) srl_lsq
-
where srl_lsq.thread# = lh_lsq.thread#(+)) low
-
where low.thread# = high.thread#
-
and lsq < = hsq
-
and hsq > rcvsq;
-
解决方法2:
如果方法 1 的替代 SQL 仍然没有显示 GAP,请重新创建备用控制文件。这将清除 v$archived_log 中的当前归档日志。
在主库上:
alter database create standby controlfile as '/tmp/ctl_for_standby';
scp到备库上
备库上:
shu abort
改名
mv ctl_for_standby control01.dbf
startup mount
recover managed standby database disconnect;
参考
V$ARCHIVE_GAP doesn't show a existing GAP (Doc ID 974730.1)
Steps to recreate a Physical Standby Controlfile (Doc ID 459411.1)
阅读(5397) | 评论(0) | 转发(0) |