oracle時間格式記錄異常導致OGG複製程式報錯

sky_dizzy001發表於2014-02-11
1. GoldenGate程式RSC00022出現ABENDED現象:
REPLICAT    ABENDED     RSC00022    00:00:06      03:52:53

2. 經檢查discardfile檔案發現問題出在以下update語句報錯:
2011-11-10 14:29:17  WARNING OGG-00869  OCI Error ORA-01850: hour must be between 0 and 23 (status = 1850), SQL _SB_YZPZ" SET "PZ_XH" = :a1,"NSRNBM" = :a2,"PZZL_DM" = :a3,"GLWSH_XH" = :a4,"LSNSR_DM" = :a5,"ZSDLFS_DM" = :a6,"SB_RQ" = :a7,"SBFS_D
M" = :a8,"SBSX_DM" = :a9,"RJ_XH" = :a10,"ZZZLJSRY>.
Problem replicating DB_SBZS.T_SCYW to DB_SC.T_SCYW
Mapping problem with compressed key update record (target format)...
*
SB_RQ = 2001-06-11 35:00:00
SBFS_DM = 10
SBSX_DM = 0
RJ_XH = 0
ZZZLJSRY_DM = NULL

3. 如上所示SB_RQ的時間格式有問題SB_RQ = 2001-06-11 35:00:00,導致報錯ORA-01850: hour must be between 0 and 23
經檢查源表,發現該表PZ_XH = 2004010022368370的記錄確實有問題:
SQL> select to_char(PZ_XH),TO_CHAR(SB_RQ,'yyyymmdd hh:mi:ss') from DB_SBZS.T_SCYW
  2   where pz_xh='2007090146478387' or pz_xh='2004010022368370';


TO_CHAR(PZ_XH)                           TO_CHAR(SB_RQ,'YYYYMMDDHH:MI:S
---------------------------------------- ------------------------------
2004010022368370                         00000000 00:00:00
2007090146478387                         20070903 12:00:00

SQL> select SB_RQ from DB_SBZS.T_SCYW where pz_xh='2007090146478387' or pz_xh='2004010022368370';

SB_RQ
-----------
2001-6-11
2007-9-3
     
4.解決思路:源SB_RQ = 2001-06-11 35:00:00的記錄更新為正常後,目標端應用程式即可恢復正常
start  replicat RSX00028 skiptransaction ----跳過出錯記錄
delete   DB_SC.T_SCYW    where  pz_xh='2007090146478387'; ----刪除本地記錄
insert into    DB_SC.T_SCYW select * from   DB_SBZS.T_SCYW@DB_LINK where  pz_xh='2007090146478387'; ----重新插回記錄

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29468144/viewspace-1079332/,如需轉載,請註明出處,否則將追究法律責任。

相關文章