ORA-16047: DGID mismatch between destination setting and target database

2008081036發表於2015-07-14
搭完DG後發現日誌輸不過來,檢視日誌:

alert日誌:
Thread 1 advanced to log sequence 3769 (LGWR switch)
  Current log# 4 seq# 3769 mem# 0: /oradata/tpakvdata/redo04.log
Tue Jul 14 11:47:00 2015
ARC3: Archivelog destination LOG_ARCHIVE_DEST_2 disabled: Data Guard configuration identifier mismatch

然後在主庫上查詢v$ARCHIVE_DEST檢視:

SQL> select dest_name, status, error from v$archive_dest WHERE DEST_ID = 2;

DEST_NAME
--------------------------------------------------------------------------------
STATUS    ERROR
--------- -----------------------------------------------------------------
LOG_ARCHIVE_DEST_2
DISABLED 
 ORA-16047: DGID mismatch between destination setting and target
          database


在網上查詢後,需要重點檢查如下引數:
log_archive_config
fal_client
fal_server
log_archive_dest_2 
log_archive_dest_state_2 

經過檢查,如上的引數設定在內容上是沒有問題的,有可能就是格式的問題了(比如大小寫等),於是,我重置了主庫的log_archive_dest_2 引數:
alter system set LOG_ARCHIVE_DEST_2='SERVICE=tpakvdg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tpakvdg';


然後再查詢v$ARCHIVE_DEST檢視,發現狀態已變成DEFERRED  

SQL> select DEST_ID,DEST_NAME,STATUS,BINDING,ERROR from v$ARCHIVE_DEST where status<>'INACTIVE';

   DEST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS    BINDING
--------- ---------
ERROR
-----------------------------------------------------------------
         1
LOG_ARCHIVE_DEST_1
VALID     OPTIONAL



   DEST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS    BINDING
--------- ---------
ERROR
-----------------------------------------------------------------
         2
LOG_ARCHIVE_DEST_2
DEFERRED  OPTIONAL


再檢視引數log_archive_dest_state_2 ,還是顯示enable:
SQL> show parameter log_archive_dest_state_2 

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2             string      ENABLE

於是,試著重置log_archive_dest_state_2 引數:
SQL> alter system set LOG_ARCHIVE_DEST_STATE_2=defer scope=both;

System altered.

SQL> select dest_name, status, error from v$archive_dest WHERE DEST_ID = 2;

DEST_NAME
--------------------------------------------------------------------------------
STATUS    ERROR
--------- -----------------------------------------------------------------
LOG_ARCHIVE_DEST_2
DEFERRED


SQL> 
SQL> 
SQL> alter system set LOG_ARCHIVE_DEST_STATE_2=enable scope=both;

System altered.

SQL> 
SQL> select dest_name, status, error from v$archive_dest WHERE DEST_ID = 2;

DEST_NAME
--------------------------------------------------------------------------------
STATUS    ERROR
--------- -----------------------------------------------------------------
LOG_ARCHIVE_DEST_2
VALID

可以看到,狀態終於變成valid了,再檢視alert日誌:
Tue Jul 14 15:05:56 2015
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
Tue Jul 14 15:05:56 2015
Archived Log entry 4032 added for thread 1 sequence 3772 ID 0x33cbbb6a dest 1:
LNS: Standby redo logfile selected for thread 1 sequence 3773 for destination LOG_ARCHIVE_DEST_2
Tue Jul 14 15:05:56 2015
ARC0: Standby redo logfile selected for thread 1 sequence 3772 for destination LOG_ARCHIVE_DEST_2

已經可以成功傳輸日誌檔案。看來檢視v$archive_dest中的status才是傳輸路徑的真正狀態,如果光看LOG_ARCHIVE_DEST_STATE_2的設定很有可能會被誤導。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25465866/viewspace-1732925/,如需轉載,請註明出處,否則將追究法律責任。

相關文章