您好,登錄后才能下訂單哦!
Oracle 19C OGG基礎運維-08Error code [942]
問題:
源端:刪除dept_bak表
目標端:在數據同步時找不到dept_bak表,進程ABENDING,同步中斷。
錯誤日志如下:
Fatal error executing DDL replication: error [Error code [942], ORA-00942: table or view does not exist], no error handler present.
目標端詳細日志如下:
[oracle@cjcos02 ogg]$ tail -f ggserr.log
2020-04-10T20:48:13.291+0800 INFO OGG-00484 Oracle GoldenGate Delivery for Oracle, rep_01.prm: Executing DDL operation.
2020-04-10T20:48:13.919+0800 ERROR OGG-00519 Oracle GoldenGate Delivery for Oracle, rep_01.prm: Fatal error executing DDL replication: error [Error code [942], ORA-00942: table or view does not exist], no error handler present.
2020-04-10T20:48:20.064+0800 INFO OGG-02333 Oracle GoldenGate Delivery for Oracle, rep_01.prm: Reading /ogg/dirdat/dp000000004, current RBA 10,276, 0 records, m_file_seqno = 4, m_file_rba = 11,586.
2020-04-10T20:48:20.065+0800 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rep_01.prm: PROCESS ABENDING.
查看進程狀態
GGSCI (cjcos02) 16> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT ABENDED REP_01 00:03:15 00:22:09
重啟進程問題依舊存在
GGSCI (cjcos02) 17> stop rep_01
REPLICAT REP_01 is already stopped.
GGSCI (cjcos02) 17> start rep_01
GGSCI (cjcos02) 16> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT ABENDED REP_01 00:03:15 00:22:09
問題原因:
一開始源端extract進程和目標端replicat進程參數文件中沒有通過*來匹配所有表,而是指定了固定的表。
例如:
---extract
TABLE cjcpdb.cjc.emp;
TABLE cjcpdb.cjc.dept;
TABLE cjcpdb.cjc.bonus;
TABLE cjcpdb.cjc.salgrade;
TABLE cjcpdb.cjc.dummy;
---replicat
MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
再此期間在源端創建了一張測試表dept_bak;
源端:
create table dept_bak as select * from dept;
由于之前的配置,這個操作不會同步到目標端。
后來,將源端extract進程和目標端replicat進程參數文件修改為通過*來匹配用戶下所有表。
例如:
---extract
TABLE cjcpdb.cjc.*;
---replicat
MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
重啟extract和relicat進程后,發現源端比目標端多了一張測試表dept_bak,
在源端手動刪除這張表,由于目標端沒有這張表,drop命令在同步到目標端時發生錯誤提示找不到表,最終導致目標端恢復進程replicat掛起。
解決方案:目標端修改參數,跳過942錯誤
GGSCI (cjcos02) 19> edit param rep_01
GGSCI (cjcos02) 20> view param rep_01
replicat rep_01
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid ogg@chenpdb,password oracle
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/replzl.dsc,append,megabytes 50
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 942 IGNORE
MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
---MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
---MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
---MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
---MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
---MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
重啟replicat進程后恢復正常
GGSCI (cjcos02) 23> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP_01 00:00:00 00:00:02
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。