1. 程式人生 > >OGG學習筆記03

OGG學習筆記03

最終 time arch ould delet ons tab datapump 所在

OGG學習筆記03-單向復制簡單故障處理

環境:參考:OGG學習筆記02-單向復制配置實例
實驗目的:了解OGG簡單故障的基本處理思路。

1. 故障現象
故障現象:啟動OGG源端的extract進程,data pump進程,一段時間後發現進程均被終止。

GGSCI (oradb30) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     ABENDED     LPJY1       00:00:00      47:39:54    
EXTRACT     ABENDED     LXJY1       00:00:00      47:40:00    


GGSCI (oradb30) 2> start extract lxjy1

Sending START request to MANAGER ...
EXTRACT LXJY1 starting


GGSCI (oradb30) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     ABENDED     LPJY1       00:00:00      47:40:50    
EXTRACT     RUNNING     LXJY1       00:00:00      47:40:55    


GGSCI (oradb30) 4> start extract lpjy1

Sending START request to MANAGER ...
EXTRACT LPJY1 starting


GGSCI (oradb30) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     LPJY1       00:00:00      47:40:58    
EXTRACT     RUNNING     LXJY1       00:00:00      47:41:04    


GGSCI (oradb30) 6> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     ABENDED     LPJY1       00:00:00      47:41:15    
EXTRACT     RUNNING     LXJY1       00:00:00      47:41:21    


GGSCI (oradb30) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     ABENDED     LPJY1       00:00:00      47:41:19    
EXTRACT     RUNNING     LXJY1       00:00:00      47:41:25    


GGSCI (oradb30) 8> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     ABENDED     LPJY1       00:00:00      47:41:41    
EXTRACT     ABENDED     LXJY1       00:00:00      47:41:47    

2. 查看日誌
查看ogg日誌ggserr.log, 排查進程被終止的原因。

[[email protected] ogg]$ cd $GG_HOME
[[email protected] ogg]$ tail -200f ggserr.log
發現datapump進程lpjy1是因為連接不到目標OGG而終止;extract進程lxjy1是因為無法找到歸檔日誌sequence 160 thread 1而終止。

2017-01-19 14:51:46  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, lpjy1.prm:  EXTRACT LPJY1 started.
2017-01-19 14:51:49  ERROR   OGG-01224  Oracle GoldenGate Capture for Oracle, lpjy1.prm:  TCP/IP error 113 (No route to host).
2017-01-19 14:51:49  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, lpjy1.prm:  PROCESS ABENDING.
2017-01-19 14:52:28  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, lxjy1.prm:  Could not find archived log for sequence 160 thread 1 under default destinations SQL <SELECT  name    FROM v$archived_log   WHERE sequence# = :ora_seq_no AND         thread# = :ora_thread AND         resetlogs_id = :ora_resetlog_id AND         archived = ‘YES‘ AND         deleted = ‘NO‘ AND         name not like ‘+%‘         AND standby_dest = ‘NO‘ >, error retrieving redo file name for sequence 160, archived = 1, use_alternate = 0Not able to establish initial position for sequence 160, rba 7758352.
2017-01-19 14:52:28  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, lxjy1.prm:  PROCESS ABENDING.

排查原因發現是歸檔日誌被RMAN備份策略備份完成後刪除了,既然有備份,那麽下一步只需要從備份集中恢復日誌中提示的sequence 160及其之後的日誌即可。
這裏,也說明配置OGG最好建議是歸檔模式,否則在這種目標端沒有及時獲取到源端在線日誌的情況下,就沒有辦法繼續應用了。

3. 解決問題
對於lxjy1進程(Extract),只需要從RMAN備份集中恢復sequence 160及其之後的歸檔日誌:

$ rman target /
RMAN> restore archivelog from logseq 160;

然後再啟動lxjy1進程。

對於lpjy1進程(Data Pump),只需要確認已經啟動目標端OGG所在主機,網通,然後啟動目標端數據庫和目標OGG,並啟動目標OGG的mgr進程,replicat進程即可。

最終確認源端和目標端ogg所有進程均正常running:
源端OGG:

GGSCI (oradb30) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     LPJY1       00:00:00      00:00:03    
EXTRACT     RUNNING     LXJY1       00:00:00      00:00:00    

目標端OGG:

GGSCI (oradb31) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    RUNNING     RJY1        00:00:00      00:00:01    

OGG學習筆記基礎篇:

  • OGG學習筆記01-基礎概述
  • OGG學習筆記02-單向復制配置實例
  • OGG學習筆記03-單向復制簡單故障處理
  • OGG學習筆記04-OGG復制部署快速參考

OGG學習筆記03