• OGG 源端与目标端 约束不一致


    需求:

    请在生产库执行下面的脚本

    --删除主键并新增复合主键             
    alter table XXXXX  drop constraint PK_USERCHNL cascade;
    alter table XXXXX  add constraint PK_USERCHNL primary key (USERCODE, SALECHNL, STR1);
     
    目标端ogg异常:
    2019-04-03 09:54:38  WARNING OGG-01004  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  Aborted grouped transaction on 'XXXXX', Database error 1 (OCI Error ORA-00001: unique constraint (PK_USERCHNL) violated (status = 1). INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "XX"."XXXX" ("USERCODE","SALECHNL","STR1","STR2","STR3","DATE1","DATE2","DATE3") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7)).
    2019-04-03 09:54:38  WARNING OGG-01154  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  SQL error 1 mapping XX.XXXXto LIS.USERCHNL OCI Error ORA-00001: unique constraint (XXX.PK_USERCHNL) violated (status = 1). INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "XX"."XXXX" ("USERCODE","SALECHNL","STR1","STR2","STR3","DATE1","DATE2","DATE3") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7).
    2019-04-03 09:54:38  ERROR   OGG-01296  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  Error mapping from LIS.USERCHNL to XX.XXXXX.
    2019-04-03 09:54:38  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  PROCESS ABENDING.
    2019-04-03 09:57:49  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  OCI Error ORA-00001: unique constraint (XX.PK_USERCHNL) violated (status = 1). INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "XX"."XXXXX" ("USERCODE","SALECHNL","STR1","STR2","STR3","DATE1","DATE2","DATE3") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7).
    2019-04-03 09:57:49  WARNING OGG-01004  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  Aborted grouped transaction on 'XX.XXXX', Database error 1 (OCI Error ORA-00001: unique constraint (XX.PK_USERCHNL) violated (status = 1). INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "XX"."XXXXX" ("USERCODE","SALECHNL","STR1","STR2","STR3","DATE1","DATE2","DATE3") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7)).
    2019-04-03 09:57:49  WARNING OGG-01154  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  SQL error 1 mapping LIS.USERCHNL to XX.XXXXXX OCI Error ORA-00001: unique constraint (XXX.PK_USERCHNL) violated (status = 1). INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "XX"."XXXXX" ("USERCODE","SALECHNL","STR1","STR2","STR3","DATE1","DATE2","DATE3") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7).
    2019-04-03 09:57:49  ERROR   OGG-01296  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  Error mapping from LIS.USERCHNL to XX.XXXXXX.
    2019-04-03 09:57:49  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rep_1b.prm:  PROCESS ABENDING.

    --对比源端与目标端约束是否一致

    select owner, constraint_name, constraint_type, status, validated 
    from dba_constraints 
    where owner='FLORACLE' and TABLE_NAME = 'TBL_BRH_KEY_INDEX'; 

    解决方案:

    在目标端删除多余的约束

  • 相关阅读:
    python 异常类型大全
    HDU6532 Chessboard (最大费用流)
    P2764 最小路径覆盖问题 (最小点覆盖=顶点数-最大匹配)
    P3355 骑士共存问题 (最小割)
    P1251 餐巾计划 (网络流)
    P2765 魔术球问题 (网络流)
    P3381 [模板] 最小费用最大流
    P3376 [模板] 网络最大流
    P3384 [模板] 树链剖分
    BZOJ1009: [HNOI2008]GT考试 (矩阵快速幂 + DP)
  • 原文地址:https://www.cnblogs.com/polestar/p/11264269.html
Copyright © 2020-2023  润新知