Oracle 11g Dataguard SwitchOver 主备日志不一致

Oracle 11g Dataguard 做SwitchOver后,发现主备最大日志号不一致。

但主库日志切换后alter system switch logfile;数据还能同步到备库。

Primary:查询主库的最大日志
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
SQL> select max(sequence#)  from v$archived_log;
 
MAX(SEQUENCE#)
--------------
           707
 
SQL> select max(sequence#) from v$archived_log where applied='YES';
 
MAX(SEQUENCE#)
--------------
           707

 

 

standby1:查询备库的最大日志
 
SQL> select max(sequence#)  from v$archived_log;
 
MAX(SEQUENCE#)
--------------
           160
 
SQL> select max(sequence#) from v$archived_log where applied='YES';
 
MAX(SEQUENCE#)
--------------
           160
          


使用如下语句查询出的主库日志与备库一致。

SQL> select sequence#  from v$archived_log
  2  where recid = (select max(recid) from v$archived_log)   and applied = 'YES';
 
 SEQUENCE#
----------
       160
 
SQL> select sequence#
  2    from v$archived_log
  3   where recid = (select max(recid) from v$archived_log);
 
 SEQUENCE#
----------
       160          

你可能感兴趣的:(oracle,sql,database,System)