通过select * from v$archive_gap;或者告警日志检查可以查看是否有归档日志的裂缝
例如:
Media Recovery Waiting for thread 1 sequence 1638
Fetching gap sequence in thread 1, gap sequence 1638-1737
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE disconnect from session
Wed Jul 13 17:36:44 2016
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 1638-1737
DBID 1415359633 branch 887578899
FAL[client]: All defined FAL servers have been attempted.
------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that‘s sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
------------------------------------------------------------
恢复时等待1638的归档日志;
如果归档日志存在可以通过:
alter database register logfile ‘/db/archivelog/1_1868_887578899.dbf‘;
的方法进行注册,注册后会自动恢复
几个命令:
当前主库正常 OPEN 状态 、 备库处于日志传送状态 .
在备库停止日志传送
SQL> recover managed standby database cancel;
ALTER DATABASE RECOVER managed standby database cancel
备库 Read-only 模式打开
SQL> alter database open read only;
备库回到日志传送模式
SQL> recover managed standby database disconnect from session;
ALTER DATABASE RECOVER managed standby database disconnect from session;
手工令备库应用归档日志
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
备库alter database open read only;后有两种方式,一种是
recover managed standby database disconnect from session;
这种方式不能应用备库当前的日志文件,再主库做日志切换后会应用日志;
另一种:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
实时应用日志文件;两边数据保证时时同步;