OGG主从表结构不同步,出现OGG-01296错误
Posted williamzheng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OGG主从表结构不同步,出现OGG-01296错误相关的知识,希望对你有一定的参考价值。
一、Cause
ogg日志出现以下报错
2019-09-10 16:36:55 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, repwh2.prm: Repositioning to rba 1720271212 in seqno 1521.
2019-09-10 16:36:55 ERROR OGG-01296 Oracle GoldenGate Delivery for Oracle, repwh2.prm: Error mapping from UPCENTER.FUND_BOND_INVEST_PORT_NEW to UPCENTER.FUND_BOND_INVEST_PORT_NEW.
2019-09-10 16:36:55 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, repwh2.prm: PROCESS ABENDING.
由于表没有添加主键或修改主键或者没有添加补充日志或者导入大量clob字段等等原因,在ogg日志里看到有表同步报错,此时需要在ogg源端里过滤不同步的表,然后解决掉问题或者手工同步表到目标端,再在目标端里取消过滤
二、解决办法
2.1过滤不同步的表
GGSCI (ogg2) 2> edit params repwh2
replicat repwh2
ASSUMETARGETDEFS
dynamicresolution
ALLOWNOOPUPDATES
userid ggs,password mEkxcl9DN
discardfile /u01/gglog/repwh_discard.txt,append,megabytes 500
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP
TABLEEXCLUDE UPCENTER.HK_SSTEN_DEAL1
TABLEEXCLUDE UPCENTER.STK_INDU_NAME_TEMP #过滤不同步的表,重启进程
map upcenter.*,target upcenter.*;
GGSCI (ogg2) 2> start repwh2
2.2将主库的数据导入到从库
源端导出
expdp 用户名/密码 dumpfile=FUND_RETRUN_RANK.dump tables=FUND_RETRUN_RANK logfile=FUND_RETRUN_RANK.log directory=tong PARALLEL=8
目标端导入
impdp 用户名/密码 tables=FUND_RETRUN_RANK dumpfile=FUND_RETRUN_RANK.dump directory=tong logfile=FUND_RETRUN_RANK.log TABLE_EXISTS_ACTION=REPLACE
2.3在从库OGG进程放行过滤的表
GGSCI (ogg2) 2> edit params repwh2
replicat repwh2
ASSUMETARGETDEFS
dynamicresolution
ALLOWNOOPUPDATES
userid ggs,password mEkxcl9DN
discardfile /u01/gglog/repwh_discard.txt,append,megabytes 500
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP
TABLEEXCLUDE UPCENTER.HK_SSTEN_DEAL1
TABLEEXCLUDE UPCENTER.STK_INDU_NAME_TEMP #将这行去掉
map upcenter.*,target upcenter.*;
以上是关于OGG主从表结构不同步,出现OGG-01296错误的主要内容,如果未能解决你的问题,请参考以下文章