时间:2021-07-01 10:21:17 帮助过:31人阅读
前几天被问到ogg源端EXTRACT进程trail文件由于某种原因丢失(删除)。 手工模拟下源端抽取进程丢失一个trail文件 模拟 trail 文件丢失 插入数据SQL BEGIN 2 FOR i IN 2001..3000 loop 3 INSERT INTO test1 VALUES i,'a',sysdate; 4 commit; 5 END loop; 6 EN
前几天被问到ogg源端EXTRACT进程trail文件由于某种原因丢失(删除)。
手工模拟下源端抽取进程丢失一个trail文件
插入数据 SQL> BEGIN 2 FOR i IN 2001..3000 loop 3 INSERT INTO test1 VALUES (i,'a',sysdate); 4 commit; 5 END loop; 6 END; 7 / PL/SQL PROCEDURE successfully completed. SQL> BEGIN 2 FOR i IN 3001..4000 loop 3 INSERT INTO test1 VALUES (i,'a',sysdate); 4 commit; 5 END loop; 6 END; 7 / PL/SQL PROCEDURE successfully completed. GGSCI (enmotech) 60> shell ls -lh ./dirdat/et000000 -rw-r----- 1 oracle oinstall 475K Nov 23 22:29 ./dirdat/et000000
停止rpee插入数据,让dump传输过来数据不应用
GGSCI (enmotech) 61> stop RPEE Sending STOP request TO REPLICAT RPEE ... Request processed. 再次插入数据 SQL> BEGIN 2 FOR i IN 4001..5000 loop 3 INSERT INTO test1 VALUES (i,'a',sysdate); 4 commit; 5 END loop; 6 END; 7 / PL/SQL PROCEDURE successfully completed.
停止ddump并插入数据
GGSCI (enmotech) 62> stop ddump Sending STOP request TO EXTRACT DDUMP ... Request processed. SQL> BEGIN 2 FOR i IN 5001..6000 loop 3 INSERT INTO test1 VALUES (i,'a',sysdate); 4 commit; 5 END loop; 6 END; 7 / PL/SQL PROCEDURE successfully completed.
插入数据让ext抽取但是ddump不传输
GGSCI (enmotech) 63> info * EXTRACT DDUMP Last Started 2014-11-23 22:25 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:16 ago) Log Read Checkpoint File ./dirdat/ee000068 2014-11-23 22:30:43.000000 RBA 807686 EXTRACT EXT1 Last Started 2014-11-23 21:45 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:03 ago) Log Read Checkpoint Oracle Redo Logs 2014-11-23 22:30:57 Seqno 744, RBA 18682368 SCN 2.4426980 (8594361572) EXTRACT E_SQL Last Started 2014-06-10 21:18 Status STOPPED Checkpoint Lag 00:00:00 (updated 3984:54:27 ago) Log Read Checkpoint Oracle Redo Logs 2014-06-10 21:35:53 Seqno 486, RBA 21800448 SCN 2.2362686 (8592297278) REPLICAT RPEE Last Started 2014-11-23 22:26 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:42 ago) Log Read Checkpoint File ./dirdat/et000000 2014-11-23 22:29:24.000220 RBA 486152 这里抽取的Seqno为68 这里为了让抽取进程的trial文件前滚一个号,停止ext使用etrollover前滚一个 GGSCI (enmotech) 66> alter ext1 etrollover 2014-11-23 22:32:42 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically. EXTRACT altered. GGSCI (enmotech) 68> info ext1 detail EXTRACT EXT1 Initialized 2014-11-23 21:45 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:26 ago) Log Read Checkpoint Oracle Redo Logs 2014-11-23 22:32:29 Seqno 744, RBA 18685952 SCN 2.4427012 (8594361604) Target Extract Trails: Remote Trail Name Seqno RBA Max MB ./dirdat/ee 69 0 100
看到这里 Seqno 为 69 ,并插入数据让 seqno 69 trail有数据
SQL> begin 2 for i in 6001..7000 loop 3 insert into test1 values (i,'a',sysdate); 4 commit; 5 end loop; 6 end; 7 / begin for i in 7001..8000 loop insert into test1 values (i,'a',sysdate); commit; end loop; end; / PL/SQL procedure successfully completed. SQL> SQL> SQL> 2 3 4 5 6 7 PL/SQL procedure successfully completed.
在次让抽取进程的trial文件前滚一个号
GGSCI (enmotech) 75> stop ext1 Sending STOP request to EXTRACT EXT1 ... Request processed. GGSCI (enmotech) 76> alter ext1 etrollover 2014-11-23 23:25:14 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically. EXTRACT altered. GGSCI (enmotech) 77> start ext1 Sending START request to MANAGER ... EXTRACT EXT1 starting GGSCI (enmotech) 78> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT STOPPED DDUMP 00:00:00 00:55:13 EXTRACT RUNNING EXT1 00:00:00 00:00:07 EXTRACT STOPPED E_SQL 00:00:00 3985:49:24 插入数据让 seqno 70 有数 SQL> begin 2 for i in 8001..9000 loop 3 insert into test1 values (i,'a',sysdate); 4 commit; 5 end loop; 6 end; 7 / PL/SQL procedure successfully completed.
以上插入数据就汇总如下
SQL> !ls -l total 2088 -rw-r----- 1 oracle oinstall 1195 Nov 23 21:45 ee000067 -rw-r----- 1 oracle oinstall 969391 Nov 23 22:30 ee000068 -rw-r----- 1 oracle oinstall 324413 Nov 23 23:24 ee000069 -rw-r----- 1 oracle oinstall 162703 Nov 23 23:25 ee000070 -rw-rw-rw- 1 oracle oinstall 2216 Jun 10 21:20 es000000 -rw-r----- 1 oracle oinstall 647858 Nov 23 22:30 et000000 删除 ee000069 这个文件 也就是 6001-8000的数据不能传输 SQL> !mv ee000069 ee000069.bak
GGSCI (enmotech) 81> info DDUMP detail EXTRACT DDUMP Last Started 2014-11-23 23:26 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:04 ago) Log Read Checkpoint File ./dirdat/ee000068 2014-11-23 22:30:57.000000 RBA 969391 Target Extract Trails: Remote Trail Name Seqno RBA Max MB ./dirdat/et 1 162801 100 Extract Source Begin End ./dirdat/ee000068 2014-11-23 22:30 2014-11-23 22:30 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:30 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:23 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:23 ./dirdat/ee000000 * Initialized * 2014-11-23 22:23 ./dirdat/ee000000 * Initialized * First Record Current directory /u01/ogg1 Report file /u01/ogg1/dirrpt/DDUMP.rpt Parameter file /u01/ogg1/dirprm/ddump.prm Checkpoint file /u01/ogg1/dirchk/DDUMP.cpe Process file /u01/ogg1/dirpcs/DDUMP.pce Stdout file /u01/ogg1/dirout/DDUMP.out Error log /u01/ogg1/ggserr.log
启动ddump,让5001..6000数据过去
GGSCI (enmotech) 79> start DDUMP Sending START request to MANAGER ... EXTRACT DDUMP starting GGSCI (enmotech) 80> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DDUMP 00:55:27 00:00:07 EXTRACT RUNNING EXT1 00:00:00 00:00:02 EXTRACT STOPPED E_SQL 00:00:00 3985:49:41 REPLICAT STOPPED RPEE 00:00:00 00:55:56 GGSCI (enmotech) 81> info DDUMP detail EXTRACT DDUMP Last Started 2014-11-23 23:26 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:04 ago) Log Read Checkpoint File ./dirdat/ee000068 2014-11-23 22:30:57.000000 RBA 969391 Target Extract Trails: Remote Trail Name Seqno RBA Max MB ./dirdat/et 1 162801 100 Extract Source Begin End ./dirdat/ee000068 2014-11-23 22:30 2014-11-23 22:30 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:30 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:23 ./dirdat/ee000068 2014-11-23 22:23 2014-11-23 22:23 ./dirdat/ee000000 * Initialized * 2014-11-23 22:23 ./dirdat/ee000000 * Initialized * First Record Current directory /u01/ogg1 Report file /u01/ogg1/dirrpt/DDUMP.rpt Parameter file /u01/ogg1/dirprm/ddump.prm Checkpoint file /u01/ogg1/dirchk/DDUMP.cpe Process file /u01/ogg1/dirpcs/DDUMP.pce Stdout file /u01/ogg1/dirout/DDUMP.out Error log /u01/ogg1/ggserr.log
启动rpee让 4001-6000 的数据应用
GGSCI (enmotech) 82> start rpee Sending START request to MANAGER ... REPLICAT RPEE starting GGSCI (enmotech) 84> info rpee REPLICAT RPEE Last Started 2014-11-23 23:31 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:03 ago) Log Read Checkpoint File ./dirdat/et000001 2014-11-23 22:30:57.000382 RBA 162801 SQL> select max(id) from ogg2.test1; MAX(ID) ---------- 6000
这里也只能应用到6000,因为6001-8000数据所在的trial文件丢失。为了让抽取进程重新抽取,查找scn
查找REPLICAT进程的scn
GGSCI (enmotech) 86> info rpee showch REPLICAT RPEE LAST Started 2014-11-23 23:31 STATUS RUNNING Checkpoint Lag 00:00:00 (updated 00:00:01 ago) Log READ Checkpoint File ./dirdat/et000001 2014-11-23 22:30:57.000382 RBA 162801 CURRENT Checkpoint Detail: READ Checkpoint #1 GGS Log Trail Startup Checkpoint (starting POSITION IN the DATA SOURCE): SEQUENCE #: 0 RBA: 486152 TIMESTAMP: 2014-11-23 22:29:24.000220 EXTRACT Trail: ./dirdat/et CURRENT Checkpoint (POSITION OF LAST record READ IN the DATA SOURCE): SEQUENCE #: 1 RBA: 162801 TIMESTAMP: 2014-11-23 22:30:57.000382 EXTRACT Trail: ./dirdat/et Header: Version = 2 Record SOURCE = A TYPE = 1 # INPUT Checkpoints = 1 # Output Checkpoints = 0 File Information: Block SIZE = 2048 MAX Blocks = 100 Record LENGTH = 2048 CURRENT Offset = 0 Configuration: DATA SOURCE = 0 TRANSACTION Integrity = -1 Task TYPE = 0 DATABASE Checkpoint: Checkpoint TABLE = goldengate.CHKtable KEY = 462138021 (0x1b8baaa5) CREATE TIME = 2014-11-23 22:26:48 STATUS: START TIME = 2014-11-23 23:31:13 LAST UPDATE TIME = 2014-11-23 23:35:20 Stop STATUS = A LAST RESULT = 400 SQL> SELECT GROUP_NAME,LOG_CSN,LOG_XID,LOG_CMPLT_CSN FROM goldengate.CHKtable 2 ; GROUP_NA LOG_CSN LOG_XID LOG_CMPLT_CSNSN -------- --------------------- ----- --------------- RPEE 8594361572 8594359565
可以看到REPLICAT进程的最后一个scn是8594361572,下面用logdump查看下
╭─oracle@enmotech /u01/ogg1 ╰─? ./logdump Oracle GoldenGate Log File Dump Utility for Oracle Version 11.2.1.0.6_03 16934271 17205864 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. Logdump 13 >open ./dirdat/et000001 Current LogTrail is /u01/ogg1/dirdat/et000001 Logdump 14 >ghdr on Logdump 15 >detail data Logdump 16 >usertoken detail Logdump 17 >ggstoken detail Logdump 18 >fileheader detail Logdump 19 >n 查看文件头的开始scn、停止scn 2014/11/23 23:26:10.718.566 FileHeader Len 1028 RBA 0 Name: *FileHeader* 3000 01bf 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1... 0003 3200 0004 2000 0000 3300 0008 02f2 2ebb c0f2 | ..2... ...3......... 8f66 3400 001e 001c 7572 693a 656e 6d6f 7465 6368 | .f4.....uri:enmotech 3a3a 7530 313a 6f67 6731 3a44 4455 4d50 3500 0021 | ::u01:ogg1:DDUMP5..! 3500 001d 001b 7572 693a 656e 6d6f 7465 6368 3a3a | 5.....uri:enmotech:: 7530 313a 6f67 6731 3a45 5854 3136 0000 1300 112e | u01:ogg1:EXT16...... 2f64 6972 6461 742f 6574 3030 3030 3031 3700 0001 | /dirdat/et0000017... GroupID x30 '0' TrailInfo Info x00 Length 447 3000 01bf 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1... 0003 3200 0004 2000 0000 3300 0008 02f2 2ebb c0f2 | ..2... ...3......... 8f66 3400 001e 001c 7572 693a 656e 6d6f 7465 6368 | .f4.....uri:enmotech 3a3a 7530 313a 6f67 6731 3a44 4455 4d50 3500 0021 | ::u01:ogg1:DDUMP5..! 3500 001d 001b 7572 693a 656e 6d6f 7465 6368 3a3a | 5.....uri:enmotech:: 7530 313a 6f67 6731 3a45 5854 3136 0000 1300 112e | u01:ogg1:EXT16...... 2f64 6972 6461 742f 6574 3030 3030 3031 3700 0001 | /dirdat/et0000017... 0138 0000 0400 0000 0139 ff00 0800 0000 0000 0000 | .8.......9.......... 003a 0000 810a 3835 3934 3335 3935 3534 0000 0000 | .:....8594359554.... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 3bff 0081 0000 | ..............;..... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 003c 0000 0802 f22e bafa 999b 893d | .......<...........= ff00 0800 0000 00 | ....... TokenID x30 '0' Signature Info x00 Length 8 4747 0d0a 544c 0a0d | GG..TL.. TokenID x31 '1' Compatibility Info x00 Length 2 0003 | .. TokenID x32 '2' Charset Info x00 Length 4 2000 0000 | ... TokenID x33 '3' CreationTime Info x00 Length 8 02f2 2ebb c0f2 8f66 | .......f TokenID x34 '4' URI Info x00 Length 30 001c 7572 693a 656e 6d6f 7465 6368 3a3a 7530 313a | ..uri:enmotech::u01: 6f67 6731 3a44 4455 4d50 | ogg1:DDUMP TokenID x35 '5' URIHistory Info x00 Length 33 3500 001d 001b 7572 693a 656e 6d6f 7465 6368 3a3a | 5.....uri:enmotech:: 7530 313a 6f67 6731 3a45 5854 31 | u01:ogg1:EXT1 TokenID x36 '6' Filename Info x00 Length 19 0011 2e2f 6469 7264 6174 2f65 7430 3030 3030 31 | .../dirdat/et000001 TokenID x37 '7' MultiPart Info x00 Length 1 01 | . TokenID x38 '8' Seqno Info x00 Length 4 0000 0001 | .... TokenID x39 '9' FileSize Info xff Length 8 0000 0000 0000 0000 | ........ TokenID x3a ':' FirstCSN Info x00 Length 129 0a38 3539 3433 3539 3535 3400 0000 0000 0000 0000 | .8594359554......... --开始scn 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 00 | ......... TokenID x3b ';' LastCSN Info xff Length 129 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... --结束没有 说明没写完 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | .................... 0000 0000 0000 0000 00 | ......... TokenID x3c '<' FirstIOTime Info x00 Length 8 02f2 2eba fa99 9b89 | ........ TokenID x3d '=' LastIOTime Info xff Length 8 0000 0000 0000 0000 | ........ GroupID x31 '1' MachineInfo Info x00 Length 107 3100 006b 3000 0007 0005 4c69 6e75 7831 0000 0a00 | 1..k0.....Linux1.... 0865 6e6d 6f74 6563 6832 0000 1a00 1832 2e36 2e33 | .enmotech2.....2.6.3 392d 3430 302e 3231 352e 3130 2e65 6c35 7565 6b33 | 9-400.215.10.el5uek3 0000 2400 2223 3120 534d 5020 5475 6520 5365 7020 | ..$."#1 SMP Tue Sep 3920 3232 3a35 313a 3436 2050 4454 2032 3031 3434 | 9 22:51:46 PDT 20144 0000 0800 0678 38 | .....x8 TokenID x30 '0' Sysname Info x00 Length 7 0005 4c69 6e75 78 | ..Linux TokenID x31 '1' Nodename Info x00 Length 10 0008 656e 6d6f 7465 6368 | ..enmotech TokenID x32 '2' Release Info x00 Length 26 0018 322e 362e 3339 2d34 3030 2e32 3135 2e31 302e | ..2.6.39-400.215.10. 656c 3575 656b | el5uek TokenID x33 '3' Version Info x00 Length 36 0022 2331 2053 4d50 2054 7565 2053 6570 2039 2032 | ."#1 SMP Tue Sep 9 2 323a 3531 3a34 3620 5044 5420 3230 3134 | 2:51:46 PDT 2014 TokenID x34 '4' Hardware Info x00 Length 8 0006 7838 365f 3634 | ..x86_64 GroupID x32 '2' DatabaseInfo Info x00 Length 351 3200 015f 3000 0002 0007 3100 0006 0004 4f52 434c | 2.._0.....1.....ORCL 3200 0006 0004 6f72 636c 3300 0004 0000 1389 3400 | 2.....orcl3.......4. 0002 000b 3500 0002 0002 3600 00e7 00e5 4f72 6163 | ....5.....6.....Orac 6c65 2044 6174 6162 6173 6520 3131 6720 456e 7465 | le Database 11g Ente 7270 7269 7365 2045 6469 7469 6f6e 2052 656c 6561 | rprise Edition Relea 7365 2031 312e 322e 302e 332e 3020 2d20 3634 6269 | se 11.2.0.3.0 - 64bi 7420 5072 6f64 7563 7469 6f6e 0a50 4c2f 5351 4c20 | t Production.PL/SQL 5265 6c65 6173 6520 3131 2e32 2e30 2e33 2e30 202d | Release 11.2.0.3.0 - 2050 726f 6475 6374 696f 6e0a 434f 5245 0931 312e | Production.CORE.11. 322e 302e 332e 3009 5072 6f64 7563 7469 6f6e 0a54 | 2.0.3.0.Production.T 4e53 2066 6f72 204c 696e 7578 3a20 5665 7273 696f | NS for Linux: Versio 6e20 3131 2e32 2e30 2e33 2e30 202d 2050 726f 6475 | n 11.2.0.3.0 - Produ 6374 696f 6e0a 4e4c 5352 544c 2056 6572 7369 6f6e | ction.NLSRTL Version 2031 312e 322e 302e 332e 3020 2d20 5072 6f64 7563 | 11.2.0.3.0 - Produc 7469 6f6e 0a37 0000 0440 0000 0038 0000 0c00 0a31 | tion.7...@...8.....1 312e 322e 302e 332e 3039 0000 0400 0000 013a 0000 | 1.2.0.3.09.......:.. 0200 003b 0000 0400 0000 013c 0000 1400 0000 1014 | ...;.......<........ 1414 1414 1414 1414 1414 14 | ........... TokenID x30 '0' Vendor Info x00 Length 2 0007 | .. TokenID x31 '1' Name Info x00 Length 6 0004 4f52 434c | ..ORCL TokenID x32 '2' Instance Info x00 Length 6 0004 6f72 636c | ..orcl TokenID x33 '3' Charset Info x00 Length 4 0000 1389 | .... TokenID x34 '4' MajorVersion Info x00 Length 2 000b | .. TokenID x35 '5' MinorVersion Info x00 Length 2 0002 | .. TokenID x36 '6' VerString Info x00 Length 231 00e5 4f72 6163 6c65 2044 6174 6162 6173 6520 3131 | ..Oracle Database 11 6720 456e 7465 7270 7269 7365 2045 6469 7469 6f6e | g Enterprise Edition 2052 656c 6561 7365 2031 312e 322e 302e 332e 3020 | Release 11.2.0.3.0 2d20 3634 6269 7420 5072 6f64 7563 7469 6f6e 0a50 | - 64bit Production.P 4c2f 5351 4c20 5265 6c65 6173 6520 3131 2e32 2e30 | L/SQL Release 11.2.0 2e33 2e30 202d 2050 726f 6475 6374 696f 6e0a 434f | .3.0 - Production.CO 5245 0931 312e 322e 302e 332e 3009 5072 6f64 7563 | RE.11.2.0.3.0.Produc 7469 6f6e 0a54 4e53 2066 6f72 204c 696e 7578 3a20 | tion.TNS for Linux: 5665 7273 696f 6e20 3131 2e32 2e30 2e33 2e30 202d | Version 11.2.0.3.0 - 2050 726f 6475 6374 696f 6e0a 4e4c 5352 544c 2056 | Production.NLSRTL V 6572 7369 6f6e 2031 312e 322e 302e 332e 3020 2d20 | ersion 11.2.0.3.0 - 5072 6f64 7563 7469 6f6e 0a | Production. TokenID x37 '7' ClientCharset Info x00 Length 4 4000 0000 | @... TokenID x38 '8' ClientVerString Info x00 Length 12 000a 3131 2e32 2e30 2e33 2e30 | ..11.2.0.3.0 TokenID x39 '9' ClientNCharset Info x00 Length 4 0000 0001 | .... TokenID x3a ':' DbLocale Info x00 Length 2 0000 | .. TokenID x3b ';' DbNCharset Info x00 Length 4 0000 0001 | .... TokenID x3c '<' DbObjNameMetadata Info x00 Length 20 0000 0010 1414 1414 1414 1414 1414 1414 1114 1414 | .................... GroupID x33 '3' ProducerInfo Info x00 Length 95 3300 005f 3000 0006 0004 4558 5431 3100 0002 0003 | 3.._0.....EXT11..... 3200 0002 000b 3300 0002 0002 3400 0002 0001 3500 | 2.....3.....4.....5. 0002 0000 3600 0002 0006 3700 002d 002b 5665 7273 | ....6.....7..-.+Vers 696f 6e20 3131 2e32 2e31 2e30 2e36 5f30 3320 3136 | ion 11.2.1.0.6_03 16 3933 3432 3731 2031 3732 3035 3836 34 | 934271 17205864 TokenID x30 '0' Name Info x00 Length 6 0004 4558 5431 | ..EXT1 TokenID x31 '1' DataSource Info x00 Length 2 0003 | .. TokenID x32 '2' MajorVersion Info x00 Length 2 000b | .. TokenID x33 '3' MinorVersion Info x00 Length 2 0002 | .. TokenID x34 '4' MaintLevel Info x00 Length 2 0001 | .. TokenID x35 '5' BugFixLevel Info x00 Length 2 0000 | .. TokenID x36 '6' BuildNumber Info x00 Length 2 0006 | .. TokenID x37 '7' VerString Info x00 Length 45 002b 5665 7273 696f 6e20 3131 2e32 2e31 2e30 2e36 | .+Version 11.2.1.0.6 5f30 3320 3136 3933 3432 3731 2031 3732 3035 3836 | _03 16934271 1720586 345f 4642 4f | 4_FBO GroupID x34 '4' ContinunityInfo Info x00 Length 8 3400 0008 3000 0004 | 4...0... TokenID x30 '0' RecoveryMode Info x00 Length 4 0000 0001 | .... Logdump 20 > Logdump 39 >count --统计下记录数,以便跳到最好一条记录 LogTrail /u01/ogg1/dirdat/et000001 has 1002 records Total Data Bytes 47028 Avg Bytes/Record 46 Insert 1000 RestartOK 1 Others 1 After Images 1001 Average of 1002 Transactions Bytes/Trans ..... 94 Records/Trans ... 1 Files/Trans ..... 1 Partition 0 RestartOK 1 After Images 1 *FileHeader* Partition 0 Total Data Bytes 1028 Avg Bytes/Record 1028 Others 1 OGG1.TEST1 Partition 4 Total Data Bytes 46000 Avg Bytes/Record 46 Insert 1000 After Images 1000 Logdump 40 > Logdump 41 >n ___________________________________________________________________ Hdr-Ind : E (x45) Partition : . (x04) UndoFlag : . (x00) BeforeAfter: A (x41) RecLength : 46 (x002e) IO Time : 2014/11/23 22:30:57.000.382 IOType : 5 (x05) OrigNode : 255 (xff) TransInd : . (x03) FormatType : R (x52) SyskeyLen : 0 (x00) Incomplete : . (x00) AuditRBA : 744 AuditPos : 18681552 Continued : N (x00) RecCount : 1 (x01) 2014/11/23 22:30:57.000.382 Insert Len 46 RBA 162639 Name: OGG1.TEST1 After Image: Partition 4 G s 0000 0008 0000 0004 3630 3030 0001 0005 0000 0001 | ........6000........ 6100 0200 1500 0032 3031 342d 3131 2d32 333a 3232 | a......2014-11-23:22 3a33 303a 3537 | :30:57 Column 0 (x0000), Len 8 (x0008) 0000 0004 3630 3030 | ....6000 Column 1 (x0001), Len 5 (x0005) 0000 0001 61 | ....a Column 2 (x0002), Len 21 (x0015) 0000 3230 3134 2d31 312d 3233 3a32 323a 3330 3a35 | ..2014-11-23:22:30:5 37 | 7 GGS tokens: TokenID x52 'R' ORAROWID Info x00 Length 20 4141 4145 536b 4141 4a41 4141 626a 6c41 454d 0001 | AAAESkAAJAAAbjlAEM.. TokenID x4c 'L' LOGCSN Info x00 Length 10 3835 3934 3336 3135 3732 | 8594361572 --最后一个事物的scn好 TokenID x36 '6' TRANID Info x00 Length 9 3332 2e32 342e 3234 38 | 32.24.248 rpee的检查点信息 Log Read Checkpoint File ./dirdat/et000001 2014-11-23 22:30:57.000382 RBA 162801 AuditRBA : 744 AuditPos : 18681552 TokenID x4c 'L' LOGCSN Info x00 Length 10 3835 3934 3336 3135 3732 | 8594361572
这里找到scn号为8594361572
GGSCI (enmotech) 2> stop ddump Sending STOP request to EXTRACT DDUMP ... Request processed. GGSCI (enmotech) 3> stop ext1 Sending STOP request to EXTRACT EXT1 ... Request processed. GGSCI (enmotech) 6> info ext1 detail EXTRACT EXT1 Initialized 2014-11-23 23:25 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:15 ago) Log Read Checkpoint Oracle Redo Logs 2014-11-23 23:46:48 Seqno 744, RBA 24420864 SCN 2.4435992 (8594370584) Target Extract Trails: Remote Trail Name Seqno RBA Max MB ./dirdat/ee 71 0 100 GGSCI (enmotech) 4> alter ext1 etrollover --进程新开始trail文件号 2014-11-23 23:47:12 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically. EXTRACT altered. GGSCI (enmotech) 8> ALTER EXTRACT ext1 ,SCN 8594361572 --更改进程抽取scn号 EXTRACT altered. GGSCI (enmotech) 9> info ext1 EXTRACT EXT1 Initialized 2014-11-23 23:48 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:04 ago) Log Read Checkpoint Oracle Redo Logs First Record Seqno 0, RBA 0 SCN 2.4426980 (8594361572) GGSCI (enmotech) 10> start ext1 Sending START request to MANAGER ... EXTRACT EXT1 starting 2014-11-23 23:49:00 INFO OGG-01052 Oracle GoldenGate Capture for Oracle, ext1.prm: No recovery is required for target file ./dirdat/ee000071, at RBA 0 (file not opened). 2014-11-23 23:49:00 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, ext1.prm: Output file ./dirdat/ee is using format RELEASE 11.2. 2014-11-23 23:49:00 INFO OGG-01517 Oracle GoldenGate Capture for Oracle, ext1.prm: Position of first record processed Sequence 744, RBA 18680848, SCN 2.4426977, Nov 23, 2014 10:30:57 PM. 2014-11-23 23:49:00 WARNING OGG-00869 Oracle GoldenGate Capture for Oracle, ext1.prm: No unique key is defined for table 'TEST1'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key. GGSCI (enmotech) 12> alter ddump etrollover --让trail seq 前滚 2014-11-23 23:50:33 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically. EXTRACT altered. GGSCI (enmotech) 14> alter ddump ,EXTSEQNO 71,EXTRBA 0 更改抽取的位置 EXTRACT altered. GGSCI (enmotech) 15> info ddump EXTRACT DDUMP Initialized 2014-11-23 23:51 Status STOPPED Checkpoint Lag 00:00:00 (updated 00:00:06 ago) Log Read Checkpoint File ./dirdat/ee000071 First Record RBA 0 GGSCI (enmotech) 17> info ddump EXTRACT DDUMP Last Started 2014-11-23 23:52 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:03 ago) Log Read Checkpoint File ./dirdat/ee000071 2014-11-23 23:25:32.000000 RBA 486118 GGSCI (enmotech) 16> 2014-11-23 23:52:16 INFO OGG-01052 Oracle GoldenGate Capture for Oracle, ddump.prm: No recovery is required for target file ./dirdat/et000002, at RBA 0 (file not opened). 2014-11-23 23:52:16 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, ddump.prm: Output file ./dirdat/et is using format RELEASE 11.2. 2014-11-23 23:52:16 INFO OGG-01669 Oracle GoldenGate Collector for Oracle: Opening ./dirdat/et000002 (byte -1, current EOF 0). GGSCI (enmotech) 25> alter rpee , EXTSEQNO 2 ,EXTRBA 0 --更改抽取的位置 REPLICAT altered. GGSCI (enmotech) 26> start rpee,aftercsn 8594361572 --指定scn开始 Sending START request to MANAGER ... REPLICAT RPEE starting 2014-11-23 23:55:21 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, rpee.prm: REPLICAT RPEE started. 2014-11-23 23:55:21 INFO OGG-01373 Oracle GoldenGate Delivery for Oracle, rpee.prm: User requested start after CSN 8594361572. 2014-11-23 23:55:21 INFO OGG-01374 Oracle GoldenGate Delivery for Oracle, rpee.prm: Transaction delivery commencing at position Seqno 2, RBA 1036, Transaction ID 31.32.234, CSN 8594364094, 0 transaction(s) skipped. 2014-11-23 23:55:21 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, rpee.prm: No unique key is defined for table 'TEST1'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
验证
SQL> SELECT COUNT(*) FROM ogg2.test1 WHERE id>6000; COUNT(*) ---------- 3000 SQL> SELECT COUNT(*) FROM ogg1.test1 WHERE id>6000; COUNT(*) ---------- 3000 SQL> SELECT COUNT(*) FROM ogg1.test1 WHERE id>1000; COUNT(*) ---------- 8000 SQL> SELECT COUNT(*) FROM ogg2.test1 WHERE id>1000; COUNT(*) ---------- 8000
原文地址:goldegate_source_trail_missing, 感谢原作者分享。