测试原理,停掉源端和目标端的OGG, 在源端进行DML操作,然后切换日志。然后开启源端和目标端的OGG。看看是否会同步数据到目标端。另外查看源端的ext进程日志,看里面的提示。
结论: OGG 在停掉后,进行大批量的DML操作,然后多次切换日志后。再次开启OGG,会从OGG中断时候的归档日志开始抽取数据。
测试过程如下:
停掉mgr 和其他的进程
GGSCI (test.us.oracle.com) 107> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED EXT1 00:00:00 00:00:08
EXTRACT STOPPED PUMDB1 00:00:00 00:00:10
GGSCI (test02) 118> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
REPLICAT STOPPED REPDB1 00:00:00 00:00:07
GGSCI (test02) 119>
查看当前归档日志
SYS@test>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archive_log
Oldest online log sequence 324
Next log sequence to archive 327
Current log sequence 327
SYS@test>select count(*) from bb.object1;
COUNT(*)
----------
0
1 row selected.
现在向bb.object1表增加数据,增加完毕后,切换几次日志。日志从327切换到363
SYS@test>insert into bb.object1 select * from dba_objects;
87175 rows created.
SYS@test>commit;
Commit complete.
SYS@test>alter system switch logfile;
System altered.
SYS@test>
SYS@test>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archive_log
Oldest online log sequence 360
Next log sequence to archive 363
Current log sequence 363
SYS@test>
启动源端和目标端的MGR及进程
GGSCI (test.us.oracle.com) 111> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:01:50 00:00:08
EXTRACT RUNNING PUMDB1 00:00:00 00:04:42
GGSCI (test02) 121> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPDB1 00:00:00 00:00:06
GGSCI (test02) 122>
查看源端的 ext1的报告。 可以看到ext抽取进程,从归档日志327开始进行抽取了
Database Language and Character Set:
NLS_LANG = ".AL32UTF8"
NLS_LANGUAGE = "AMERICAN"
NLS_TERRITORY = "AMERICA"
NLS_CHARACTERSET = "AL32UTF8"
2018-06-06 16:19:11 INFO OGG-01513 Positioning to Sequence 327, RBA 719376, SCN 0.2848195.
2018-06-06 16:19:12 INFO OGG-01516 Positioned to Sequence 327, RBA 719376, SCN 0.2848195, Jun 6, 2018 4:14:48 PM.
2018-06-06 16:19:12 INFO OGG-01055 Recovery initialization completed for target file /u01/ogg/dirdat/ex000002, at RBA 27260043.
2018-06-06 16:19:12 INFO OGG-01478 Output file /u01/ogg/dirdat/ex is using format RELEASE 11.2.
2018-06-06 16:19:12 INFO OGG-01026 Rolling over remote file /u01/ogg/dirdat/ex000002.
2018-06-06 16:19:12 INFO OGG-01053 Recovery completed for target file /u01/ogg/dirdat/ex000003, at RBA 1112.
2018-06-06 16:19:12 INFO OGG-01057 Recovery completed for all targets.
***********************************************************************
** Run Time Messages **
***********************************************************************
查看目标端的数据,已经同步过来了
SYS@orcl>select count(*) from bb.object1;
COUNT(*)
----------
87175
SYS@orcl>
结论, ext抽取进程,会从归档日志中进行抽取,是因为有个bra地址和scn ,当ext进程中断后,下次再启动的时候,会从bra地址和SCN地址进行继续抽取数据。
END
参考:https://www.csdn.net/tags/MtTaEg3sNzg4OTk0LWJsb2cO0O0O.html