检查alert日志发现报错如下
Wed Mar 27 15:40:30 2019
Managed Standby Recovery not using Real Time Apply
Parallel Media Recovery started with 3 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 29
Fetching gap sequence in thread 1, gap sequence 29-29
Completed: alter database recover managed standby database disconnect from session
Wed Mar 27 15:42:23 2019
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 29-29
DBID 3256623239 branch 1001954378
FAL[client]: All defined FAL servers have been attempted.
确认下29号归档是否丢失
SQL> select SEQUENCE#,DEST_ID,ARCHIVED,APPLIED,DELETED,STATUS,FIRST_TIME from v$archived_log order by SEQUENCE#;
SEQUENCE# DEST_ID ARC APPLIED DEL S FIRST_TIM
---------- ---------- --- --------- --- - ---------
25 2 YES YES NO A 27-MAR-19
26 2 YES YES NO A 27-MAR-19
27 1 YES YES NO A 27-MAR-19
28 1 YES YES NO A 27-MAR-19
30 2 YES NO NO A 27-MAR-19
31 1 YES NO NO A 27-MAR-19
32 1 YES NO NO A 27-MAR-19
33 1 YES NO NO A 27-MAR-19
SQL> select * from v$archive_gap;
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
1 28 29
从primary做增量恢复,28号归档日志已应用,查找29号归档日志起始SCN
SQL> select a.FIRST_CHANGE# from v$archived_log a where a.SEQUENCE#=29;
FIRST_CHANGE#
-------------
1450602
做增量备份
BACKUP INCREMENTAL FROM SCN 1450602 database format='/ogg/bk/qdtais1%U';
从primary传到standby
scp qdtais* ht02:/ogg/bk
注册备份片
catalog start with '/ogg/bk';
取消日志应用关闭数据库
alter database recover managed standby database cancel;
恢复增量备份
RMAN> startup force nomount;
RMAN> RESTORE STANDBY CONTROLFILE FROM '/ogg/bk/qdtais122ttgdpd_1_1';
RMAN> ALTER DATABASE MOUNT;
RMAN> RECOVER DATABASE NOREDO;
启动实时应用
alter database recover managed standby database using current logfile disconnect from session;
取消应用打开数据库检查数据在启动实时应用
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database open;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select count(1) from ydks.httest;
COUNT(1)
----------
4995
SQL> select count(1) from ydks.httest1;
COUNT(1)
----------
997
官方文档
https://docs.oracle.com/cd/E11882_01/server.112/e41134/rman.htm#SBYDB4878