原因可能是:
当备用数据库具有不同的化身( 查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)
阅读(2238) | 评论(0) | 转发(0) |