replicat进程报错,信息如下:

2014-03-15 13:31:29  WARNING OGG-00869  OCI Error ORA-01407: cannot update ("ERP"."TB_GOS_ACCOUNT_O_LOTINVEN"."INVBALQTY") to NULL (status = 1407). UPDATE "ERP"."TB_GOS_ACCOUNT_O_LOTINVEN" SET "LASTMODIFYTIME" = :a1,"INVBALQTY" = :a2 WHERE "PK" = :b0.
2014-03-15 13:31:29  WARNING OGG-01004  Aborted grouped transaction on 'ERP.TB_GOS_ACCOUNT_O_LOTINVEN', Database error 1407 (OCI Error ORA-01407: cannot update ("ERP"."TB_GOS_ACCOUNT_O_LOTINVEN"."INVBALQTY") to NULL (status = 1407). UPDATE "ERP"."TB_GOS_ACCOUNT_O_LOTINVEN" SET "LASTMODIFYTIME" = :a1,"INVBALQTY" = :a2 WHERE "PK" = :b0).
2014-03-15 13:31:29  WARNING OGG-01003  Repositioning to rba 347439 in seqno 19401.
2014-03-15 13:31:29  WARNING OGG-01154  SQL error 1407 mapping HBQERP.TB_GOS_ACCOUNT_O_LOTINVEN to ERP.TB_GOS_ACCOUNT_O_LOTINVEN OCI Error ORA-01407: cannot update ("ERP"."TB_GOS_ACCOUNT_O_LOTINVEN"."INVBALQTY") to NULL (status = 1407). UPDATE "ERP"."TB_GOS_ACCOUNT_O_LOTINVEN" SET "LASTMODIFYTIME" = :a1,"INVBALQTY" = :a2 WHERE "PK" = :b0.
2014-03-15 13:31:29  WARNING OGG-01003  Repositioning to rba 347439 in seqno 19401.

其中,表TB_GOS_ACCOUNT_O_LOTINVEN中字段INVBALQTY为not null,并且设有default value;而上面的SQL是将TB_GOS_ACCOUNT_O_LOTINVEN"."INVBALQTY"字段 更新为NULL。


   查看trail 文件信息:发现捕获字段有PK、LASTMODIFYTIME、INVBALQTY三个字段的信息,但是INVBALQTY 字段捕获到的信息没值,为空。

   

   看了表的属性后,追查到做了数据变更的源SQL语句,更新INVBALQTY 字段为0,当时猜想这里的0应该跟字段上属性default value 设置有关。

   其实这是ogg 11R2 的CDR(Conflict Detection and Resolution,当前环境OGG的版本是11.2.0.1)参数设置问题导致的,加上参数NOCOMPRESSUPDATES,使当前更新的SQL完整捕获到列INVBALQTY的值。问题得以解决。原参数文件配置中已添加过NOCOMPRESSDELETES。 以下是CDR的参数要求:

The extract capture for CDR should include the following


Force extract to capture the before p_w_picpath using GETBEFORECOLS in the TABLE parameter.

Use NOCOMPRESSDELETES and NOCOMPRESSUPDATES in the extract parameter file so that to have extract write a full record in a trail instead of the changed columns only.

   

其它的可以参考ogg的相关资料做进一步了解,在此不复述。