OGG主从表结构不同步,出现OGG-01296错误
2019-09-10 17:00 williamzheng 阅读(3822) 评论(0) 编辑 收藏 举报一、Cause
ogg的err日志出现以下报错
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.
ogg里面查看进程报错如下:
GGSCI (ogg2) 2> view param repwh2
#### 省略部分内容 ####
2019-09-10 16:14:43 WARNING OGG-01004 Aborted grouped transaction on 'UPCENTER.FUND_BOND_INVEST_PORT_NEW', Database error 1403 (OCI Error ORA-01403: no data found, SQL <UPDATE "UPCENTER"."FUND_BOND_INVEST_PORT_NEW" SET "ISVALID" = :a0,"UPDATETIME" = :a1 WHERE "FUND_ID
" = :b0 AND "END_DATE" = :b1 AND "IF_CONV_PAR" = :b2 AND "BOND_CODE" = :b3 AND "BOND_NAME" = :b4>).
2019-09-10 16:14:43 WARNING OGG-01003 Repositioning to rba 1720271212 in seqno 1521.
2019-09-10 16:14:43 WARNING OGG-01154 SQL error 1403 mapping UPCENTER.FUND_BOND_INVEST_PORT_NEW to UPCENTER.FUND_BOND_INVEST_PORT_NEW OCI Error ORA-01403: no data found, SQL <UPDATE "UPCENTER"."FUND_BOND_INVEST_PORT_NEW" SET "ISVALID" = :a0,"UPDATETIME" = :a1 WHERE "F
UND_ID" = :b0 AND "END_DATE" = :b1 AND "IF_CONV_PAR" = :b2 AND "BOND_CODE" = :b3 AND "BOND_NAME" = :b4>.
由于表没有添加主键或修改主键或者没有添加补充日志或者导入大量clob字段等等原因,在ogg日志里看到有表同步报错,此时需要在ogg源端里过滤不同步的表,然后解决掉问题或者手工同步表到目标端,再在目标端里取消过滤
二、解决办法
以下步骤中停止启动ogg进程不是必须步骤,请根据实际业务情况来
2.1先停止主和从的ogg进程
stop repwh2
2.2过滤不同步的表
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.3将主库的数据导入到从库
源端导出
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.4在从库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.*;
2.5启动主和从的ogg进程
GGSCI (ogg2) 2> start repwh2
WilliamZheng©版权所有 转载请注明出处! 觉得对您有帮助请点个赞哟~ 运维架构师群:833329925