ogg通过中间库两次同步

ogg两次同步:从test同步到test1,再同步到test2,用以模拟a库到b库再到c库的同步,其中b库免去抽取的过程,直接投递从a库传到b库的trail文件到c库,免去中间库资源消耗。

 

准备工作:

ggsci>create subdirs
ggsci>add checkpointtable ogg.checkpoint
管理进程mgr
PORT 7809
DYNAMICPORTLIST 7800-8000
–AUTOSTART ER *
AUTORESTART EXTRACT *, RETRIES 5, WAITMINUTES 3
PURGEOLDEXTRACTS /ogg/dirdat/*, usecheckpoints, minkeepdays 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45

一个抽取进程
EXTRACT eora
setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
EXTTRAIL ./dirdat/ea
DISCARDFILE ./dirpt/eora.dsc,APPEND,MEGABYTES 500
TRANLOGOPTIONS ALTARCHIVELOGDEST +fra/sysi/archivelog
TRANLOGOPTIONS ALTARCHIVEDLOGFORMAT %t_%s_%r.dbf
tranlogoptions dblogreader
table test.p_tb1;

ggsci>add extract eora,tranlog,begin now
ggsci>add exttrail ./dirdat/ea,EXTRACT eora megabytes 20

第一个投递进程pump1
EXTRACT pump1
USERID ogg, PASSWORD ogg
RMTHOST 10.10.10.132, MGRPORT 7809
RMTTRAIL /ogg/dirdat/eb
DISCARDFILE ./dirrpt/pump1.dsc,APPEND,MEGABYTES 500
table test.p_tb1;

ggsci>add EXTRACT pump1,exttrailsource ./dirdat/ea
ggsci>ADD RMTTRAIL /ogg/dirdat/eb, EXTRACT pump1

 

 

第一个复制进程rep1

REPLICAT rep1
setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
HandleCollisions
ASSUMETARGETDEFS
reperror default, discard
DISCARDFILE ./dirrpt/rep1.dsc,APPEND,MEGABYTES 20
dynamicresolution
MAP test.p_tb1, target test1.p_tb1;

ggsci>add REPLICAT rep1,EXTTRAIL ./dirdat/eb,checkpointtable ogg.checkpoint

 

 

第二个投递进程pump2

EXTRACT pump2
USERID ogg, PASSWORD ogg
RMTHOST 10.10.10.132, MGRPORT 7809
RMTTRAIL /ogg/dirdat/ec
DISCARDFILE ./dirrpt/pump2.dsc,APPEND,MEGABYTES 500
table test.p_tb1;                                                        –这里要注意,由于trail文件来源于a 库,记录                                                                                    –信息都是a库的,写成b库的将找不到更新

ggsci>add EXTRACT pump2,exttrailsource ./dirdat/eb
ggsci>ADD RMTTRAIL /ogg/dirdat/ec, EXTRACT pump2

 

 

第二个复制进程rep2

REPLICAT rep2
setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
HandleCollisions
ASSUMETARGETDEFS
reperror default, discard
DISCARDFILE ./dirrpt/rep2.dsc,APPEND,MEGABYTES 20
dynamicresolution
MAP test.p_tb1, target test2.p_tb1;                  –这里要注意,由于trail文件来源于a库,记录信息                                                                               –都是a库的,写成b库的将找不到更新

ggsci>add REPLICAT rep2,EXTTRAIL ./dirdat/ec,checkpointtable ogg.checkpoint