ORACLE DATAGUARD中手工处理日志v$archive_GAP的方法

 从9i以后,oracle dataguard 备库一般都不需要手工处理丢失的日志,FAL自动会帮我们处理,下面通过个案例来讲下手工处理丢失的日志的方法:

1.在备库查询有哪些日志丢失,没应用到备库

 SQL> select * from V$ARCHIVE_GAP;
  THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
     1     9873    9876

我们可以看到9873到9876这四个归档日志丢失,

2.我们在主库找到这四个归档日志传送到备库归档目录下;

3.备库注册

alter database register logfile '/oracle/app/oracle/archive/1_9873_629923600.arc';
system alerted
alter database register logfile '/oracle/app/oracle/archive/1_9874_629923600.arc';
system alerted
alter database register logfile '/oracle/app/oracle/archive/1_9875_629923600.arc';
system alerted
alter database register logfile '/oracle/app/oracle/archive/1_9876_629923600.arc';
system alerted

4.检查数据库日志看是否应用

Thu Apr 8 15:55:17 2010
Media Recovery Log /oracle/app/oracle/archive/1_9873_629923600.arc
Media Recovery Log /oracle/app/oracle/archive/1_9874_629923600.arc
Media Recovery Log /oracle/app/oracle/archive/1_9875_629923600.arc
Media Recovery Log /oracle/app/oracle/archive/1_9876_629923600.arc

或者查询视图

v$archived_log的applied字段

5、检查备库是否还有日志GAP

SQL> select * from V$ARCHIVE_GAP;

出现没有行选择,则表示不存在归档日志丢失问题。