程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> Track 造成Goldengate abended的那條record,goldengateabended

Track 造成Goldengate abended的那條record,goldengateabended

編輯:Oracle教程

Track 造成Goldengate abended的那條record,goldengateabended


Email收到了這樣的報錯:

2016-12-07 02:52:22  WARNING OGG-01004  Aborted grouped transaction on 'MSP.USER_ACTIVITY_LIFETIME_AGG', Database error 1403 (OCI Error ORA-01403: no data found, SQL <UPDATE "MSP"."USER_ACTIVITY_LIFETIME_AGG" x SET x."USER_ACTIVITY_LIFETIME_ID" = :a0,x."NIKE_PLUS_USER_ID" = :a1,x."ACTIVITY_NUM" = :a3,x."FUEL_TOTAL" = :a4,x."STEP_TOTAL" = :a5,x."CALORIE_TOTAL" = :a6,x."DURATION_TOTAL" = :a7,x."DISTANCE_TOTAL" = :a8,x."WALK_TOTAL" = :a9,x."FUEL_ACTIVITY_NUM" = :a10,x."FUEL_DAILY_AVG" = :a11,x."BEST_ACTIVE_HOUR_START" = :a12,x."BEST_ACTIVE_MINUTE_START" = :a13,x."BEST_ACTIVE_HOUR_END" = :a14,x."BEST_ACTIVE_MINUTE_END" = :a15,x."FUEL_BEST_ACTIVE_HOUR" = :a16,x."FUEL_BEST_DAY" = :a17,x."FUEL_BEST_DAY_AMT" = :a18,x."FUEL_BEST_WEEK" = :a19,x."FUEL_BEST_WEEK_AMT" = :a20,x."FUEL_BEST_MONTH" = :a21,x."FUEL_BEST_MONTH_AMT" = :a22,x."CREATE_DATE" = :a23,x."UPDATE_DATE" = :a24,x."FUEL_BEST_HOUR_AMT" = :a25,x."CURRENT_STREAK" = :a27,x."CURRENT_STREAK_START_DATE" = :a28,x."MISS_STREAK" = :a29,x."MISS_STREAK_START_DATE" = :a30,x."LONGEST_STREAK" = :a31,x."LONGEST_STREAK_START_DATE" = :a32,x."LONGEST_MISS_STREAK" = :a33,x."LONGEST_MISS_STREAK_START_DATE" = :a34,x."DEVICE_ID" = :a35,x."FUEL_BEST_SUNDAY" = :a36,x."FUEL_BEST_SUNDAY_AMT" = :a37,x."FUEL_BEST_MONDAY" = :a38,x."FUEL_BEST_MONDAY_AMT" = :a39,x."FUEL_BEST_TUESDAY" = :a40,x."FUEL_BEST_TUESDAY_AMT" = :a41,x."FUEL_BEST_WEDNESDAY" = :a42,x."FUEL_BEST_WEDNESDAY_AMT" = :a43,x."FUEL_BEST_THURSDAY" = :a44,x."FUEL_BEST_THURSDAY_AMT" = :a45,x."FUEL_BEST_FRIDAY" = :a46,x."FUEL_BEST_FRIDAY_AMT" = :a47,x."FUEL_BEST_SATURDAY" = :a48,x."FUEL_BEST_SATURDAY_AMT" = :a49,x."ACTIVE_PERCENTAGE" = :a50,x."FUEL_BEST_YEAR" = :a51,x."FUEL_BEST_YEAR_AMT" = :a52,x."SUPER_GOAL_CNT" = :a53,x."TAG_IT_STREAK_CAREER" = :a54,x."TAG_IT_STREAK_CURRENT" = :a55,x."TAG_IT_TOTAL" = :a56,x."TAG_NOT_IT_TOTAL" = :a57,x."TAG_STREAK_CAREER" = :a58,x."TAG_STREAK_CURRENT" = :a59,x."ESP_SCORE_TOTAL" = :a60,x."ACTIVE_TIME_TOTAL" = :a61,x."STEP_CNT" = :a62,x."STEP_CNT_AVG" = :a63,x."STEP_WEEK_AVG" = :a64,x."STEP_CNT_MAX" = :a65,x."STEP_DATE_LONGEST" = :a66,x."FUEL_BEST_CURRENT_WEEK" = :a67,x."FUEL_BEST_CURRENT_WEEK_AMT" = :a68,x."START_DATE" = :a69,x."SMALL_HOURS_COUNT" = :a70,x."LATE_NIGHT_COUNT" = :a71,x."BRIGHT_AND_EARLY_COUNT" = :a72,x."MORNING_COUNT" = :a73,x."EARLY_MORNING_COUNT" = :a74,x."LATE_MORNING_COUNT" = :a75,x."DAYTIME_COUNT" = :a76,x."EARLY_AFTERNOON_COUNT" = :a77,x."LATE_AFTERNOON_COUNT" = :a78,x."EVENING_COUNT" = :a79,x."EARLY_EVENING_COUNT" = :a80,x."EARLY_NIGHT_COUNT" = :a81,x."MOST_CALORIES_BURNED" = :a82,x."LONGEST_ACTIVITY_DURATION" = :a83,x."FUEL_BEST_SESSION" = :a84,x."WORKOUTOFDAY_TOTAL" = :a85,x."SOCIAL_SHARE_TOTAL" = :a86,x."FUEL_BEST_SESSION_DATE" = :a87,x."LAST_ACTIVITY_TZ_OFFSET" = :a88,x."LAST_ACTIVITY_DST_OFFSET" = :a89,x."CALORIE_BEST_WEEK" = :a90,x."CALORIE_BEST_WEEK_AMT" = :a91,x."LONGEST_ACTIVITY_DURATION_DATE" = :a92,x."DURATION_BEST_WEEK" = :a93,x."DURATION_BEST_WEEK_AMT" = :a94,x."INTENSITY_BEST_AMT" = :a95,x."INTENSITY_BEST" = :a96,x."FUEL_SUNDAY_TOTAL" = :a97,x."FUEL_SUNDAY_TOTAL_COUNT" = :a98,x."FUEL_MONDAY_TOTAL" = :a99,x."FUEL_MONDAY_TOTAL_COUNT" = :a100,x."FUEL_TUESDAY_TOTAL" = :a101,x."FUEL_TUESDAY_TOTAL_COUNT" = :a102,x."FUEL_WEDNESDAY_TOTAL" = :a103,x."FUEL_WEDNESDAY_TOTAL_COUNT" = :a104,x."FUEL_THURSDAY_TOTAL" = :a105,x."FUEL_THURSDAY_TOTAL_COUNT" = :a106,x."FUEL_FRIDAY_TOTAL" = :a107,x."FUEL_FRIDAY_TOTAL_COUNT" = :a108,x."FUEL_SATURDAY_TOTAL" = :a109,x."FUEL_SATURDAY_TOTAL_COUNT" = :a110,x."STARS_BEST_DAY_AMT" = :a111,x."STARS_BEST_DAY_DATE" = :a112,x."MOST_FUEL_IN_SESSION" = :a113,x."MOST_FUEL_IN_SESSION_DATE" = :a114 WHERE x."UPM_USER_ID" = :b0 AND x."ACTIVITY_TYPE_ID" = :b1>).

2016-12-07 02:52:28  WARNING OGG-01154  SQL error 1403 mapping MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG OCI Error ORA-01403: no data found, SQL <UPDATE "MSP"."USER_ACTIVITY_LIFETIME_AGG" x SET x."USER_ACTIVITY_LIFETIME_ID" = :a0,x."NIKE_PLUS_USER_ID" = :a1,x."ACTIVITY_NUM" = :a3,x."FUEL_TOTAL" = :a4,x."STEP_TOTAL" = :a5,x."CALORIE_TOTAL" = :a6,x."DURATION_TOTAL" = :a7,x."DISTANCE_TOTAL" = :a8,x."WALK_TOTAL" = :a9,x."FUEL_ACTIVITY_NUM" = :a10,x."FUEL_DAILY_AVG" = :a11,x."BEST_ACTIVE_HOUR_START" = :a12,x."BEST_ACTIVE_MINUTE_START" = :a13,x."BEST_ACTIVE_HOUR_END" = :a14,x."BEST_ACTIVE_MINUTE_END" = :a15,x."FUEL_BEST_ACTIVE_HOUR" = :a16,x."FUEL_BEST_DAY" = :a17,x."FUEL_BEST_DAY_AMT" = :a18,x."FUEL_BEST_WEEK" = :a19,x."FUEL_BEST_WEEK_AMT" = :a20,x."FUEL_BEST_MONTH" = :a21,x."FUEL_BEST_MONTH_AMT" = :a22,x."CREATE_DATE" = :a23,x."UPDATE_DATE" = :a24,x."FUEL_BEST_HOUR_AMT" = :a25,x."CURRENT_STREAK" = :a27,x."CURRENT_STREAK_START_DATE" = :a28,x."MISS_STREAK" = :a29,x."MISS_STREAK_START_DATE" = :a30,x."LONGEST_STREAK" = :a31,x."LONGEST_STREAK_START_DATE" = :a32,x."LONGEST_MISS_STREAK" = :a33,x."LONGEST_MISS_STREAK_START_DATE" = :a34,x."DEVICE_ID" = :a35,x."FUEL_BEST_SUNDAY" = :a36,x."FUEL_BEST_SUNDAY_AMT" = :a37,x."FUEL_BEST_MONDAY" = :a38,x."FUEL_BEST_MONDAY_AMT" = :a39,x."FUEL_BEST_TUESDAY" = :a40,x."FUEL_BEST_TUESDAY_AMT" = :a41,x."FUEL_BEST_WEDNESDAY" = :a42,x."FUEL_BEST_WEDNESDAY_AMT" = :a43,x."FUEL_BEST_THURSDAY" = :a44,x."FUEL_BEST_THURSDAY_AMT" = :a45,x."FUEL_BEST_FRIDAY" = :a46,x."FUEL_BEST_FRIDAY_AMT" = :a47,x."FUEL_BEST_SATURDAY" = :a48,x."FUEL_BEST_SATURDAY_AMT" = :a49,x."ACTIVE_PERCENTAGE" = :a50,x."FUEL_BEST_YEAR" = :a51,x."FUEL_BEST_YEAR_AMT" = :a52,x."SUPER_GOAL_CNT" = :a53,x."TAG_IT_STREAK_CAREER" = :a54,x."TAG_IT_STREAK_CURRENT" = :a55,x."TAG_IT_TOTAL" = :a56,x."TAG_NOT_IT_TOTAL" = :a57,x."TAG_STREAK_CAREER" = :a58,x."TAG_STREAK_CURRENT" = :a59,x."ESP_SCORE_TOTAL" = :a60,x."ACTIVE_TIME_TOTAL" = :a61,x."STEP_CNT" = :a62,x."STEP_CNT_AVG" = :a63,x."STEP_WEEK_AVG" = :a64,x."STEP_CNT_MAX" = :a65,x."STEP_DATE_LONGEST" = :a66,x."FUEL_BEST_CURRENT_WEEK" = :a67,x."FUEL_BEST_CURRENT_WEEK_AMT" = :a68,x."START_DATE" = :a69,x."SMALL_HOURS_COUNT" = :a70,x."LATE_NIGHT_COUNT" = :a71,x."BRIGHT_AND_EARLY_COUNT" = :a72,x."MORNING_COUNT" = :a73,x."EARLY_MORNING_COUNT" = :a74,x."LATE_MORNING_COUNT" = :a75,x."DAYTIME_COUNT" = :a76,x."EARLY_AFTERNOON_COUNT" = :a77,x."LATE_AFTERNOON_COUNT" = :a78,x."EVENING_COUNT" = :a79,x."EARLY_EVENING_COUNT" = :a80,x."EARLY_NIGHT_COUNT" = :a81,x."MOST_CALORIES_BURNED" = :a82,x."LONGEST_ACTIVITY_DURATION" = :a83,x."FUEL_BEST_SESSION" = :a84,x."WORKOUTOFDAY_TOTAL" = :a85,x."SOCIAL_SHARE_TOTAL" = :a86,x."FUEL_BEST_SESSION_DATE" = :a87,x."LAST_ACTIVITY_TZ_OFFSET" = :a88,x."LAST_ACTIVITY_DST_OFFSET" = :a89,x."CALORIE_BEST_WEEK" = :a90,x."CALORIE_BEST_WEEK_AMT" = :a91,x."LONGEST_ACTIVITY_DURATION_DATE" = :a92,x."DURATION_BEST_WEEK" = :a93,x."DURATION_BEST_WEEK_AMT" = :a94,x."INTENSITY_BEST_AMT" = :a95,x."INTENSITY_BEST" = :a96,x."FUEL_SUNDAY_TOTAL" = :a97,x."FUEL_SUNDAY_TOTAL_COUNT" = :a98,x."FUEL_MONDAY_TOTAL" = :a99,x."FUEL_MONDAY_TOTAL_COUNT" = :a100,x."FUEL_TUESDAY_TOTAL" = :a101,x."FUEL_TUESDAY_TOTAL_COUNT" = :a102,x."FUEL_WEDNESDAY_TOTAL" = :a103,x."FUEL_WEDNESDAY_TOTAL_COUNT" = :a104,x."FUEL_THURSDAY_TOTAL" = :a105,x."FUEL_THURSDAY_TOTAL_COUNT" = :a106,x."FUEL_FRIDAY_TOTAL" = :a107,x."FUEL_FRIDAY_TOTAL_COUNT" = :a108,x."FUEL_SATURDAY_TOTAL" = :a109,x."FUEL_SATURDAY_TOTAL_COUNT" = :a110,x."STARS_BEST_DAY_AMT" = :a111,x."STARS_BEST_DAY_DATE" = :a112,x."MOST_FUEL_IN_SESSION" = :a113,x."MOST_FUEL_IN_SESSION_DATE" = :a114 WHERE x."UPM_USER_ID" = :b0 AND x."ACTIVITY_TYPE_ID" = :b1>.

2016-12-07 02:52:28  ERROR   OGG-01296  Error mapping from MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG.

2016-12-07 02:52:28  ERROR   OGG-01668  PROCESS ABENDING.

 

 

大致的看一下就是因為要update的數據沒找到,然後abended了

平時這種報錯看得太多了,加個HC參數(handlecollision) 然後等lag追上了或者等幾分鐘把HC參數注掉就是了

今天這個case也不例外

 

但是自己想去挖掘是哪條/哪幾條記錄造成update的no data found

 

先來看看HC參數的影響,

使用HANDLECOLLISIONS的幾個場景:

1.    target丟失delete記錄(missing delete),忽略該問題並不記錄到discardfile

2.    target丟失update記錄(missing update)

  •    更新的鍵值是主鍵=》 update轉換成INSERT ,默認情況下插入記錄不完整
  •    更新的鍵值是非主鍵=》 忽略該問題並不記錄到discardfile

3.    重復插入已存在的主鍵值到target表中,這將被replicat轉換為UPDATE現有主鍵值的行的其他非主鍵列

另:該參數僅處理數據本身的Insert/Delete沖突,如果出現兩端映射或其它結構性問題Replicat進程依然會abend,不能被忽略

 

此外對於主鍵的更新操作,若在target使用HANDLECOLLISIONS且該update丟失,在會轉換為INSERT該主鍵的操作,注意默認情況下插入的記錄不完整,FETCHOPTIONS FETCHPKUPDATECOLS將捕獲完整的redo image鏡像到trail中,這保證把primary key的更新通過HANDLECOLLISIONS轉換為對target的一個完整記錄的插入。

 

因為自己一開始遇到這報錯,也就先加個HC參數把進程啟起來再說了。

事後深入分析嘛---->如下:

 

看了HC關於update的說法,先看看表主鍵

 

SQL> select a.constraint_name,  a.column_name

  2   from dba_cons_columns a, dba_constraints b

  3   where a.constraint_name = b.constraint_name

 and b.constraint_type = 'P'

and a.table_name = 'USER_ACTIVITY_LIFETIME_AGG'  4    5  ;

 

no rows selected

沒有主鍵!!!

那麼就是說加了HC之後就忽略這個報錯也不記到discard file裡面去了。

那麼就是說有數據丟失了!那幾條數據也就不管了!(關於數據丟失的話其實得看數據庫的數據要求嚴格與否!因為這裡的庫是個報表庫,定期也有數據的refresh,所以對數據的精確度要求沒太高)

看看一開始因為什麼數據不存在造成的abended

 

之前自己都是在logdump裡面亂看的,完全找不到很明確的record

經過一番的分析,進程abended的時候會記ggserr.log 也會去記discard file或者report file呀

應該去report、discard file裡面找找有價值的信息

先把abended以後的info r4f_sp信息貼出來

2016-12-07 02:52:28  WARNING OGG-01154  SQL error 1403 mapping MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG OCI Error ORA-01403: no data found,

2016-12-07 02:52:28  WARNING OGG-01003  Repositioning to rba 709137304 in seqno 6889.

===================================

GGSCI (ora-bi-p-5.va2.b2c.nike.com) 6> info R4F_SP

REPLICAT   R4F_SP    Last Started 2016-12-03 18:16   Status ABENDED

Checkpoint Lag       00:00:08 (updated 00:05:57 ago)

Log Read Checkpoint  File /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006889

                     2016-12-07 02:52:20.002353  RBA 709137304

=========================================

GGSCI (ora-bi-p-5.va2.b2c.nike.com) 29> sh ls -lrt /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4*

.......(省略)

-rw-r-----. 1 ggadmin oinstall 1023999438 Dec  7 01:04 /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006888

-rw-r-----. 1 ggadmin oinstall  820886242 Dec  7 03:11 /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006889

==========================================

去report file找找信息:

***********************************************************************

*                   ** Run Time Statistics **                         *

***********************************************************************

 

Last record for the last committed transaction is the following:

___________________________________________________________________

Trail name :  /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006889

Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)

UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)

RecLength  :  1619 (x0653)    IO Time    : 2016-12-07 02:52:20.002353 

IOType     :    15  (x0f)     OrigNode   :   255  (xff)

TransInd   :     .  (x02)     FormatType :     R  (x52)

SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)

AuditRBA   :      55760       AuditPos   : 2023822924

Continued  :     N  (x00)     RecCount   :     1  (x01)

 

2016-12-07 02:52:20.002353 FieldComp          Len  1619 RBA 709135576

Name: MSP.USER_ACTIVITY_LIFETIME_AGG

___________________________________________________________________

 

Reading /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006889, current RBA 709153355, 11861808 records

 

Report at 2016-12-07 02:52:28 (activity since 2016-12-07 00:01:00)

 

From Table MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG:

       #                   inserts:      6112

       #                   updates:    450184

       #                   deletes:         0

       #                  discards:         1       因為process abended所以會記到discard file了(在未啟用HC的情況下)(所以要求我們平時正常運行的goldengate一定不要加上HC參數,實在緊急處理數據問題、abended問題再去用,用完也記得及時注釋掉)

 

 

Last log location read:

     FILE:      /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4006889

     SEQNO:     6889

     RBA:       709153355(最後一次log讀到這裡,待會可以用logdump看看這個RBA的位置)

     TIMESTAMP: 2016-12-07 02:52:20.002360

     EOF:       NO

     READERR:   0

 

2016-12-07 02:52:28  ERROR   OGG-01668  PROCESS ABENDING.

 

好的,report file就如上的有用的信息。那麼接下來可以看看discard file看看是哪條記錄!!!!

ggadmin@ora-bi-p-5:DCBIPRD5:/gg/app/ggadmin/product/12.1.2.1.0/dirrpt$less r4f_sp1.dsc

Oracle GoldenGate Delivery for Oracle process started, group R4F_SP discard file opened: 2016-12-03 18:16:22.461903

Current time: 2016-12-07 02:52:28

Discarded record from action ABEND on error 1403

 

OCI Error ORA-01403: no data found, SQL <UPDATE "MSP"."USER_ACTIVITY_LIFETIME_AGG" x SET x."USER_ACTIVITY_LIFETIME_ID" = :a0,x."NIKE_PLUS_USER_ID" = :a1,x."ACTIVITY_NUM" = :a3,x."FUEL_TOTAL" = :a4,x."STEP_TOTAL" = :a5,x."CALORIE_TOTAL" = :a6,x."DURATION_TOTAL" = :a7,x."DISTANCE_TOTAL" = :a8,x."WALK_TOTAL" = :a9,x."FUEL_ACTIVITY_NUM" = :a10,x."FUEL_DAILY_AVG" = :a11,x."BEST_ACTIVE_HOUR_START" = :a12,x."BEST_ACTIVE_MINUTE_START" = :a13,x."BEST_ACTIVE_HOUR_END" = :a14,x."BEST_ACTIVE_MINUTE_END" = :a15,x."FUEL_BEST_ACTIVE_HOUR" = :a16,x."FUEL_BEST_DAY" = :a17,x."FUEL_BEST_DAY_AMT" = :a18,x."FUEL_BEST_WEEK" = :a19,x."FUEL_BEST_WEEK_AMT" = :a20,x."FUEL_BEST_MONTH" = :a21,x."FUEL_BEST_MONTH_AMT" = :a22,x."CREATE_DATE" = :a23,x."UPDATE_DATE" = :a24,x."FUEL_BEST_HOUR_AMT" = :a25,x."CURRENT_STREAK" = :a27,x."CURRENT_STREAK_START_DATE" = :a28,x."MISS_STREAK" = :a29,x."MISS_STREAK_START_DATE" = :a30,x."LONGEST_STREAK" = :a31,x."LONGEST_STREAK_START_DATE" = :a32,x."LONGEST_MISS_STREAK" = :a33,x."LONGEST_MISS_STREAK_STAR

Aborting transaction on /gg/app/ggadmin/product/12.1.2.1.0/dirdat/replicate/pdsp/r4 beginning at seqno 6889 rba 709137304

                         error at seqno 6889 rba 709153355(這個RBA跟之前看report file時候log讀到最後一個位置的RBA一樣,已經很明顯的說明了這個位置開始的記錄必定是造成process abended的記錄,不要暫時不要著急,慢慢來)

 

Problem replicating MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG

Record not found

Mapping problem with compressed update record (target format)...

*

USER_ACTIVITY_LIFETIME_ID = fa873844-39c5-4b9f-bee1-9dcbe76ece4e

000000: 66 61 38 37 33 38 34 34 2d 33 39 63 35 2d 34 62 |fa873844-39c5-4b|

000010: 39 66 2d 62 65 65 31 2d 39 64 63 62 65 37 36 65 |9f-bee1-9dcbe76e|

000020: 63 65 34 65                                     |ce4e            |

 

NIKE_PLUS_USER_ID = 430995F13A1119D6E05330690C0ADA3B

000000: 34 33 30 39 39 35 46 31 33 41 31 31 31 39 44 36 |430995F13A1119D6|

000010: 45 30 35 33 33 30 36 39 30 43 30 41 44 41 33 42 |E05330690C0ADA3B|

 

UPM_USER_ID = 430995F13A1019D6E05330690C0ADA3B

000000: 34 33 30 39 39 35 46 31 33 41 31 30 31 39 44 36 |430995F13A1019D6|

000010: 45 30 35 33 33 30 36 39 30 43 30 41 44 41 33 42 |E05330690C0ADA3B|

後面的列的信息就不貼了,因為這張表有一百多列

 

看完這裡,我就去查查記錄在源庫PDSP和目標庫BI的數據信息

BI:目標庫無記錄

SQL> select USER_ACTIVITY_LIFETIME_ID,NIKE_PLUS_USER_ID from msp.USER_ACTIVITY_LIFETIME_AGG where UPM_USER_ID ='430995F13A1019D6E05330690C0ADA3B';

no rows selected

PDSP:源庫有三條紀錄

SQL> select USER_ACTIVITY_LIFETIME_ID,NIKE_PLUS_USER_ID from msp.USER_ACTIVITY_LIFETIME_AGG where UPM_USER_ID ='430995F13A1019D6E05330690C0ADA3B';

USER_ACTIVITY_LIFETIME_ID               NIKE_PLUS_USER_ID

---------------------------------------------------------------------------------------------------------------------------

fa873844-39c5-4b9f-bee1-9dcbe76ece4e                              430995F13A1119D6E05330690C0ADA3B

 

d8174109-5a5c-4ef4-a752-d30370b67f7c                               430995F13A1119D6E05330690C0ADA3B

 

2cc196ae-4959-4d3e-a34d-713310aab95e                             430995F13A1119D6E05330690C0ADA3B

 

看到這裡於是明白了,結合這條update語句來看,update語句如下格式

UPDATE "MSP"."USER_ACTIVITY_LIFETIME_AGG"  SET 表的各個列=xxxx    WHERE "UPM_USER_ID" = :b0 AND "ACTIVITY_TYPE_ID" = :b1>.

 

但是UPM_USER_ID ='430995F13A1019D6E05330690C0ADA3B';這個在BI裡面沒記錄呀(當然也可以根據ACTIVITY_TYPE_ID來找,或者兩個一起找,結果一樣的)

 

可以再去logdump裡面看看trail file是不是這樣的:

直接pos 709153355到這個位置來看

 

 

 

 

 

可以看到從709153355這個位置開始後面三條紀錄正好是update所丟失的記錄

所以這次的問題分析的很透徹,就是BI裡面沒這三條記錄從而導致update不到造成abended,那麼該怎麼做呢?

個人覺得可以跳過這三條記錄,然後手工insert這三條記錄進去。(這三條記錄直接往源庫裡面查下,然後轉換成insert語句執行在目標庫即可完事)

跳過的方法無非就是HANDLECOLLISION或者REPORT ERROR,不過report error好就好在會把這三條跳過去的記錄記到discard file!

關於HC和report error的區別在後面另開一篇可以詳細的講下。

 

分析到這裡,也結束了。

自己當時只是加了HC參數去起起來,然後等lag沒了再去把HC注掉。其實這樣在數據嚴格要求的環境下這樣是不行的。

但是這裡要求不太高。定期也有數據重新refresh的操作。

 

這裡再發點加完HC參數起起來之後的信息狀態,也可以佐證之前的分析:

可以看到stats看到的        Total update collisions                            3.00

即說明了是三條記錄,之前也說了加了HC參數有沖突的數據是不會記到discard file的,我去看了,是沒有!

 

GGSCI (ora-bi-p-5.va2.b2c.nike.com) 34> stats R4F_SP

 

Sending STATS request to REPLICAT R4F_SP ...

 

Start of Statistics at 2016-12-07 03:18:16.

 

Replicating from MSP.USER_ACTIVITY_LIFETIME_AGG to MSP.USER_ACTIVITY_LIFETIME_AGG:

 

*** Total statistics since 2016-12-07 03:07:15 ***

        Total inserts                                    719.00

        Total updates                                  54583.00

        Total deletes                                      0.00

        Total discards                                     0.00

        Total operations                               55302.00

        Total update collisions                            3.00

 

*** Daily statistics since 2016-12-07 03:07:15 ***

        Total inserts                                    719.00

        Total updates                                  54583.00

        Total deletes                                      0.00

        Total discards                                     0.00

        Total operations                               55302.00

        Total update collisions                            3.00

 

*** Hourly statistics since 2016-12-07 03:07:15 ***

        Total inserts                                    719.00

        Total updates                                  54583.00

        Total deletes                                      0.00

        Total discards                                     0.00

        Total operations                               55302.00

        Total update collisions                            3.00

 

*** Latest statistics since 2016-12-07 03:07:15 ***

        Total inserts                                    719.00

        Total updates                                  54583.00

        Total deletes                                      0.00

        Total discards                                     0.00

        Total operations                               55302.00

        Total update collisions                            3.00

 

End of Statistics.

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved