Oracle goldengate extracts data from the online log before extracting data from the archived log. This can be verified through the following method.
1. Insert test data to the master database
SQL> insert into gg1.dept values (81, '1', '1 ');
1 row created.
SQL> commit;
Commit complete.
SQL> alter system switch logfile;
System altered.
SQL> insert into gg1.dept values (82, '2', '2 ');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into gg1.dept values (83, '3', '3 ');
1 row created.
SQL> commit;
Commit complete.
SQL> alter system switch logfile;
System altered.
SQL> insert into gg1.dept values (84, '4', '4 ');
1 row created.
SQL> commit;
Commit complete.
Execute alter system switch logfile multiple times here;
The key here is that we will delete the archive logs corresponding to 82 and 83. If the online logs corresponding to 82 and 83 are not overwritten, the extract process of goldengate will not stop abnormally, the extract process selects the online log.
2. Here we overwrite the online log and delete the archive logs of 82 and 83.
3. Check the goldengate status. The extract process is aborted abnormally.
GGSCI (slav2) 1> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
Extract running D1PUMP 00:00:00 00:00:02
Extract abended EXT1 00:03:10 00:02:29
GGSCI (slav2) 2> info ext1
EXTRACT EXT1 Last Started 2013-01-21 Status ABENDED
Checkpoint Lag 00:03:10 (updated 00:02:33 ago)
Log Read Checkpoint Oracle Redo Logs
22:11:50 Seqno 28, RBA 67584
[Oracle @ slav2 ggs] $ vi ggserr. log
22:14:59 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr. prm: EXTRACT EXT1 starting.
22:14:59 INFO OGG-00992 Oracle GoldenGate Capture for Oracle, ext1.prm: EXTRACT EXT1 starting.
22:15:00 WARNING OGG-01423 Oracle GoldenGate Capture for Oracle, ext1.prm: No valid default archive log destination directory found for thread 1.
22:15:00 INFO OGG-01513 Oracle GoldenGate Capture for Oracle, ext1.prm: Positioning to Sequence 28, RBA 67088.
22:15:00 INFO OGG-01516 Oracle GoldenGate Capture for Oracle, ext1.prm: Positioned to Sequence 28, RBA 67088, Jan 21,201 3 10:11:50 PM.
22:15:00 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, ext1.prm: EXTRACT EXT1 started.
22:15:00 INFO OGG-01055 Oracle GoldenGate Capture for Oracle, ext1.prm: Recovery initialization completed for target file/u01/app/ggs/dirdat/lt000004, at RBA 1672.
22:15:00 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, ext1.prm: Output file/u01/app/ggs/dirdat/lt is using format RELEASE 10.4/11.1.
22:15:00 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, ext1.prm: Rolling over remote file/u01/app/ggs/dirdat/lt000004.
22:15:00 INFO OGG-01053 Oracle GoldenGate Capture for Oracle, ext1.prm: Recovery completed for target file/u01/app/ggs/dirdat/lt42005, at RBA 968.
22:15:00 INFO OGG-01057 Oracle GoldenGate Capture for Oracle, ext1.prm: Recovery completed for all targets.
22:15:00 INFO OGG-01517 Oracle GoldenGate Capture for Oracle, ext1.prm: Position of first record processed Sequence 28, RBA 67088, SCN 0.610617, Jan 21,201 3 10:11:50 PM.