故障現象;
目標端 replicat 進程,由於所在主機操作系統故障導致宕機,導致abend。並報錯如下;
2018-02-14 10:01:52 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, caicprod.prm: REPLICAT CAICPROD started.
2018-02-14 10:01:55 ERROR OGG-01705 Oracle GoldenGate Delivery for Oracle, caicprod.prm: Input checkpoint c 92166617 for input trail file './dirdat/nc011276' is greater than the size of the file (92075909). Please consult Oracle Knowledge Management Doc ID 1138409.1. for instructions.
2018-02-14 10:01:55 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, caicprod.prm: PROCESS ABENDING.
2018-02-14 10:04:19 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info all.
2018-02-14 10:04:27 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info CAICPROD.
原因爲; 由於宕機導致cache中的數據無法寫入到 trail文件中。從而導致checkpoint的值 比trail文件中的值大,也就是說checkpoint記錄的值更新於trail文件中的。
解決辦法;
如果ogg版本11.2,並且配置了 checkpoint table 的情況下,使用replicat進程的新參數;FILTERDUPTRANSACTIONS 解決。
1).OGG版本低於11.2.1.0.1:
無法使用此參數,因爲低於此版本的checkpointtable中並不包含所需信息。處理方式需要參照後面的datapump進程的處理方式.2).OGG版本介於11.2.1.0.1到11.2.1.0.7的:
升級到11.2.1.0.7以上版本並使用filterduptransactions參數啓動Replicat進程:
start replicat <rep name> filterduptransactions
3).OGG版本高於11.2.1.0.7的:
直接使用該參數啓動rep進程:
可參考mos文檔;OGG Replicat Checkpoint RBA Is Larger than Local Trail Size- Ogg v11.2 (文檔 ID 1536741.1)start replicat <rep name> filterduptransactions
如果非11.2版本,則需要手工找到 replicat 開始的rba地址。方法如下;
參考;OGG Extract / Replicat Checkpoint RBA Is Larger than Local Trail Size (文檔 ID 1138409.1)
2018-02-14 10:01:51 INFO OGG-01815 Oracle GoldenGate Delivery for Oracle, caicprod.prm: Virtual Memory Facilities for: COM
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/oraogg/ggs/dirtmp.
2018-02-14 10:01:52 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, caicprod.prm: REPLICAT CAICPROD started.
2018-02-14 10:01:55 ERROR OGG-01705 Oracle GoldenGate Delivery for Oracle, caicprod.prm: Input checkpoint c 92166617 for input trail file './dirdat/nc011276' is greater than the size of the file (92075909). Please consult Oracle Knowledge Management Doc ID 1138409.1. for instructions.
2018-02-14 10:01:55 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, caicprod.prm: PROCESS ABENDING.
2018-02-14 10:04:19 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info all.
2018-02-14 10:04:27 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info CAICPROD.
GGSCI (drcadb02) 4> info CAICPROD
REPLICAT CAICPROD Last Started 2018-02-14 10:01 Status ABENDED
Checkpoint Lag 00:00:05 (updated 70:48:48 ago)
Log Read Checkpoint File ./dirdat/nc011276
2018-02-11 11:15:33.295366 RBA 92166617
A=92166617
drcadb02:/oraogg/ggs$ cd ./dirdat
drcadb02:/oraogg/ggs/dirdat$ ls -l nc011276
-rw-r----- 1 oracle oinstall 92075909 Feb 12 21:54 nc011276
drcadb02:/oraogg/ggs$ ./logdump
Oracle GoldenGate Log File Dump Utility for Oracle
Version 11.2.1.0.20 18227972 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_140304.2209
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
Logdump 439 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 440 >ghdr on
Logdump 441 >n
2018/02/11 11:08:33.039.123 FileHeader Len 1364 RBA 0
Name: *FileHeader*
3000 01c6 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1...
0003 3200 0004 2000 0000 3300 0008 02f2 8b1a 885c | ..2... ...3........\
f713 3400 0021 001f 7572 693a 6361 6462 7465 7374 | ..4..!..uri:cadbtest
3032 3a3a 6f72 616f 6767 3a44 5045 4341 5f42 4a35 | 02::oraogg:DPECA_BJ5
0000 2535 0000 2100 1f75 7269 3a63 6164 6274 6573 | ..%5..!..uri:cadbtes
7430 323a 3a6f 7261 6f67 673a 4558 5443 415f 424a | t02::oraogg:EXTCA_BJ
3600 0013 0011 2e2f 6469 7264 6174 2f6e 6330 3131 | 6....../dirdat/nc011
Logdump 442 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 497 (x01f1) IO Time : 2018/02/11 11:07:14.272.036
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x01) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 4072 AuditPos : 784132544
Continued : N (x00) RecCount : 1 (x01)
2018/02/11 11:07:14.272.036 Insert Len 497 RBA 1372
Name: CAICCPI.T_CPI_APQ_ITEMKIND
After Image: Partition 4 G m
0000 0015 0000 0011 3130 3033 3231 3332 3333 3530 | ........100321323350
3235 3435 3600 0100 1a00 0000 1651 4249 3035 3232 | 25456........QBI0522
3031 3833 3231 3333 3530 3235 3435 3600 0200 0700 | 018321335025456.....
0000 0331 4142 0003 0018 0000 0014 b5da c8fd d5df | ...1AB..............
d4f0 c8ce cfd5 b2bb bcc6 c3e2 c5e2 0004 000a 0000 | ....................
0000 0000 0000 0000 0005 000a ffff 0000 0000 0000 | ....................
0000 0006 000a ffff 0000 0000 0000 0000 0007 000a | ....................
Logdump 443 >
B=1372
Logdump 443 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 486 (x01e6) IO Time : 2018/02/11 11:07:14.272.036
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x01) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 4072 AuditPos : 784132544
Continued : N (x00) RecCount : 1 (x01)
2018/02/11 11:07:14.272.036 Insert Len 486 RBA 1974
Name: CAICCPI.T_CPI_APQ_ITEMKIND
After Image: Partition 4 G m
0000 0015 0000 0011 3130 3033 3231 3332 3333 3530 | ........100321323350
3235 3435 3600 0100 1a00 0000 1651 4249 3035 3232 | 25456........QBI0522
3031 3833 3231 3333 3530 3235 3435 3600 0200 0600 | 018321335025456.....
0000 0232 4200 0300 1000 0000 0cb5 dac8 fdd5 dfd4 | ...2B...............
f0c8 cecf d500 0400 0a00 0000 0000 0000 0166 8400 | .................f..
0500 0aff ff00 0000 0000 0000 0000 0600 0aff ff00 | ....................
0000 0000 0000 0000 0700 0aff ff00 0000 0000 0000 | ....................
Logdump 444 >
./logdump
Logdump 444 >
Logdump 444 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 445 >ghdr on
Logdump 446 >
Logdump 446 >filter include AuditRBA 4072
Logdump 447 >filter include filename CAICCPI.T_CPI_APQ_ITEMKIND
Logdump 448 >filter match all
Logdump 449 >n
Scanned 10000 records, RBA 5829989, 2018/02/11 11:07:45.446.535
Scanned 20000 records, RBA 12364411, 2018/02/11 11:08:17.288.653
Scanned 30000 records, RBA 18234514, 2018/02/11 11:08:48.344.633
Scanned 40000 records, RBA 23290942, 2018/02/11 11:09:14.315.733
Scanned 50000 records, RBA 28793534, 2018/02/11 11:09:46.374.363
Scanned 60000 records, RBA 34022574, 2018/02/11 11:10:13.352.322
Scanned 70000 records, RBA 39925961, 2018/02/11 11:10:46.399.288
Scanned 80000 records, RBA 45433700, 2018/02/11 11:11:19.450.877
Scanned 90000 records, RBA 50817666, 2018/02/11 11:11:56.342.068
Scanned 100000 records, RBA 56086540, 2018/02/11 11:12:33.404.729
Scanned 110000 records, RBA 62035038, 2018/02/11 11:13:04.355.495
Scanned 120000 records, RBA 67646120, 2018/02/11 11:13:42.305.675
Scanned 130000 records, RBA 73478756, 2018/02/11 11:14:15.996.907
Scanned 140000 records, RBA 79329190, 2018/02/11 11:14:30.440.489
Scanned 150000 records, RBA 85063737, 2018/02/11 11:14:59.295.190
Scanned 160000 records, RBA 90324832, 2018/02/11 11:15:28.778.118
Filtering suppressed 162826 records
Logdump 450 >
Input checkpoint position 92166617 for input trail file './dirdat/nc011276' is greater than the size of the file (92075909).
drcadb02:/oraogg/ggs/dirdat$ ls -l nc011276
-rw-r----- 1 oracle oinstall 92075909 Feb 12 21:54 nc011276
A=92166617
B=1372
C=5829989
A+B-C=92166617+1372-5829989=86338000
Logdump 450 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 451 >ghdr on
Logdump 452 >pos 86338000
Bad record found at RBA 86338000, format 5.50 Header token) <<<<< Bad record 放棄。
7375 7265 | sure
=======================================
GGSCI (drcadb02) 4> info CAICPROD
REPLICAT CAICPROD Last Started 2018-02-14 10:01 Status ABENDED
Checkpoint Lag 00:00:05 (updated 70:48:48 ago)
Log Read Checkpoint File ./dirdat/nc011276
2018-02-11 11:15:33.295366 RBA 92166617
A=92166617
Input checkpoint position 92166617 for input trail file './dirdat/nc011276' is greater than the size of the file (92075909).
drcadb02:/oraogg/ggs/dirdat$ ls -l nc011276
-rw-r----- 1 oracle oinstall 92075909 Feb 12 21:54 nc011276
B=92075909
Logdump 453 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 454 >ghdr on
Logdump 455 >n
2018/02/11 11:08:33.039.123 FileHeader Len 1364 RBA 0
Name: *FileHeader*
3000 01c6 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1...
0003 3200 0004 2000 0000 3300 0008 02f2 8b1a 885c | ..2... ...3........\
f713 3400 0021 001f 7572 693a 6361 6462 7465 7374 | ..4..!..uri:cadbtest
3032 3a3a 6f72 616f 6767 3a44 5045 4341 5f42 4a35 | 02::oraogg:DPECA_BJ5
0000 2535 0000 2100 1f75 7269 3a63 6164 6274 6573 | ..%5..!..uri:cadbtes
7430 323a 3a6f 7261 6f67 673a 4558 5443 415f 424a | t02::oraogg:EXTCA_BJ
3600 0013 0011 2e2f 6469 7264 6174 2f6e 6330 3131 | 6....../dirdat/nc011
Logdump 456 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 497 (x01f1) IO Time : 2018/02/11 11:07:14.272.036
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x01) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 4072 AuditPos : 784132544
Continued : N (x00) RecCount : 1 (x01)
2018/02/11 11:07:14.272.036 Insert Len 497 RBA 1372
Name: CAICCPI.T_CPI_APQ_ITEMKIND
After Image: Partition 4 G m
0000 0015 0000 0011 3130 3033 3231 3332 3333 3530 | ........100321323350
3235 3435 3600 0100 1a00 0000 1651 4249 3035 3232 | 25456........QBI0522
3031 3833 3231 3333 3530 3235 3435 3600 0200 0700 | 018321335025456.....
0000 0331 4142 0003 0018 0000 0014 b5da c8fd d5df | ...1AB..............
d4f0 c8ce cfd5 b2bb bcc6 c3e2 c5e2 0004 000a 0000 | ....................
0000 0000 0000 0000 0005 000a ffff 0000 0000 0000 | ....................
0000 0006 000a ffff 0000 0000 0000 0000 0007 000a | ....................
Logdump 457 >
C=1372
A=92166617
B=92075909
C=1372
a-b+c=92166617-92075909+1372=92080
drcadb02:/oraogg/ggs$ ./logdump
Oracle GoldenGate Log File Dump Utility for Oracle
Version 11.2.1.0.20 18227972 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_140304.2209
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
Logdump 457 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 458 >detail data
Logdump 459 >fileheader detail
Logdump 460 >ghdr on
Logdump 462 >pos 92082
Reading forward from RBA 92082
Logdump 463 >n
Bad record found at RBA 92082, format 5.50 Header token) <<<<< Bad record 放棄。
0000 0001 | ....
Logdump 464 >exit
drcadb02:/oraogg/ggs$
======================= 3 ======================
GGSCI (drcadb02) 4> info CAICPROD
REPLICAT CAICPROD Last Started 2018-02-14 10:01 Status ABENDED
Checkpoint Lag 00:00:05 (updated 70:48:48 ago)
Log Read Checkpoint File ./dirdat/nc011276
2018-02-11 11:15:33.295366 RBA 92166617
A=92166617
drcadb02:/oraogg/ggs/dirdat$ ls -l nc011276
-rw-r----- 1 oracle oinstall 92075909 Feb 12 21:54 nc011276
drcadb02:/oraogg/ggs$ ls -l ./dirdat/nc011277
-rw-r----- 1 oracle oinstall 99998763 Feb 12 21:55 ./dirdat/nc011277
Logdump 468 >open /oraogg/ggs/dirdat/nc011276
Current LogTrail is /oraogg/ggs/dirdat/nc011276
Logdump 469 >ghdr on
Logdump 470 >count
LogTrail /oraogg/ggs/dirdat/nc011276 has 162826 records
Total Data Bytes 74592080
Avg Bytes/Record 458
Delete 17544
Insert 105570
FieldComp 29673
GGSPKUpdate 558
SequenceValue 278
LargeObject 9202
Others 1
Before Images 17544
After Images 145281
Average of 22982 Transactions
Bytes/Trans ..... 340
Records/Trans ... 7
Files/Trans ..... 2
Logdump 471 >
Logdump 471 >skip 162825 >>> has 162826 records -1
Logdump 472 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 126 (x007e) IO Time : 2018/02/11 11:15:33.265.188
IOType : 15 (x0f) OrigNode : 255 (xff)
TransInd : . (x02) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 3574 AuditPos : 461454592
Continued : N (x00) RecCount : 1 (x01)
2018/02/11 11:15:33.265.188 FieldComp Len 126 RBA 92075686
Name: CAICPROD.PRPJFTIME
After Image: Partition 4 G e
0000 0019 0000 0015 3230 3532 3032 3031 3834 3330 | ........205202018430
3130 3330 3031 3436 3600 0100 1900 0000 1536 3035 | 103001466........605
3230 3230 3138 3433 3031 3033 3030 3132 3133 0002 | 202018430103001213..
0005 0000 0001 5400 0300 0500 0000 0131 0005 0015 | ......T........1....
0000 3230 3138 2d30 322d 3131 3a31 313a 3136 3a35 | ..2018-02-11:11:16:5
3000 0600 1500 0032 3031 382d 3032 2d31 313a 3131 | 0......2018-02-11:11
3a31 363a 3531 | :16:51
Logdump 473 >n <<< 輸入n後,沒有顯示出 下一個操作的內容。 這個方法也不行。
Logdump 474 >
以上3個方法,必須以找到 rba地址,並使用logdmp驗證爲 good record ,纔算有效。