ndby端arch进程来不及将日志写入归档,应该也会写入到另一组的standby redo log中。
下面如果启动程序,进行更新。
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered
在日志中看到应用日志过程:
Mon Oct 19 11:23:53 2015
alter database recover managed standby database using current logfile disconnect from session
Attempt to start background Managed Standby Recovery process (vlifesb)
Mon Oct 19 11:23:53 2015
MRP0 started with pid=28, OS id=15602?
MRP0: Background Managed Standby Recovery process started (vlifesb)
?started logmerger process
Mon Oct 19 11:23:58 2015
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 4 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Log /u01/app/oracle/fast_recovery_area/VLIFESB/archivelog/2015_10_19/o1_mf_1_39_c28rgoqb_.arc
Media Recovery Log /u01/app/oracle/fast_recovery_area/VLIFESB/archivelog/2015_10_19/o1_mf_1_40_c28rgpq1_.arc
Media Recovery Log /u01/app/oracle/fast_recovery_area/VLIFESB/archivelog/2015_10_19/o1_mf_1_41_c28rgtl2_.arc
Media Recovery Waiting for thread 1 sequence 42 (in transit)
Recovery of Online Redo Log: Thread 1 Group 4 Seq 42 Reading mem 0
? Mem# 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_4_c265gc9q_.log
? Mem# 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_4_c265gcfk_.log
Completed: alter database recover managed standby database using current logfile disconnect from session
这个过程中,进行standby recovery操作,先从归档日志中找到没有apply的进行应用。之后应用standby redo log。
此时,apply成功,能够追上Primary。
SQL> select group#, dbid, sequence#, used, archived, status from v$standby_log;
? ? GROUP# DBID? ? ? ? ? ? ? ? ? SEQUENCE#? ? ? USED ARCHIVED STATUS
---------- -------------------- ---------- ---------- -------- ----------
? ? ? ? 4 4207470439? ? ? ? ? ? ? ? ? 42? ? 107520 YES? ? ? ACTIVE
? ? ? ? 5 UNASSIGNED? ? ? ? ? ? ? ? ? ? 0? ? ? ? ? 0 NO? ? ? UNASSIGNED
? ? ? ? 6 UNASSIGNED? ? ? ? ? ? ? ? ? ? 0? ? ? ? ? 0 YES? ? ? UNASSIGNED
SQL> select recid, sequence#, ARCHIVED, APPLIED, DELETED from v$archived_log;
? ? RECID? SEQUENCE# ARCHIVED APPLIED? DELETED
---------- ---------- -------- --------- -------
(篇幅原因,有省略……)
? ? ? ? 15? ? ? ? 36 YES? ? ? YES? ? ? NO
? ? ? ? 16? ? ? ? 37 YES? ? ? YES? ? ? NO
? ? ? ? 17? ? ? ? 38 YES? ? ? YES? ? ? NO
? ? ? ? 18? ? ? ? 39 YES? ? ? YES? ? ? NO
? ? ? ? 19? ? ? ? 40 YES? ? ? YES? ? ? NO
? ? ? ? 20? ? ? ? 41 YES? ? ? IN-MEMORY NO
20 rows selected
4、结论
Standby Redo Log是Standby数据库的online redo log。对于Oracle而言,online redo log和standby redo log都反映了当前最近的一个日志对象。针对数据库角色的不同,应用的操作各走两支。