GoldenGate實現oracle和sqlserver雙向資料同步

dawn009發表於2014-11-26
本文記錄了配置oracle和sqlserver資料同步的關鍵步驟,只為備忘!
 
測試環境:
oracle10.2.0.1
sqlserver2005(SQLServer2005SP3-KB955706-x86-CHS.exe)

oracle->sqlserver同步:
oracle和sqlserver中分別建一張測試表(表必須有主鍵)
oracle:create table n (id number(10) primary key)
sqlserver:create table n (id int primary key)
oracle:
ggsci>edit param mgr
port 7809
ggsci>dblogin userid ggs,password ggs
ggsci>add trandata test.n
ggsci>edit param eiexaa
extract eiexaa
userid ggs,password ggs
exttrail ./dirdat/dd
table test.n;
ggsci>edit param epmpaa
extract epmpaa
passthru
rmthost 192.168.126.131,mgrport 7809
rmttrail ./dirdat/dd
table test.n;
ggsci>add extract eiexaa,tranlog,begin now
ggsci>add exttrail ./dirdat/dd,extract eiexaa,megabytes 5
ggsci>add extract epmpaa,exttrailsource ./dirdat/dd
ggsci>add rmttrail ./dirdat/dd,extract epmpaa,megabytes 5
sqlserver:
ggsci>edit param mgr
port 7809
ggsci>sourcedb ggsdb dblogin userid ggs,password ggs
(ggsdb為系統DSN名)
ggsci>edit param rorabb
replicat rorabb
sourcedb ggsdb userid ggs,password ggs
handlecollisions
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/rorabb.dsc,PURGE
map test.n, target n;
ggsdb資料庫建立ggs_checkpoint表
ggsci>add replicat rorabb,checkpointtable ggs_checkpoint,exttrail ./dirdat/dd
 
sqlserver->oracle同步:
oracle和sqlserver中分別建一張測試表(表必須有主鍵)
oracle:create table m (id number(10) primary key)
sqlserver:create table m (id int primary key)
sqlserver:
ggsci>sourcedb ggsdb dblogin userid ggs,password ggs
ggsci>add trandata m
ggsci>edit param eiexbb
extract eiexbb
sourcedb ggsdb userid ggs,password ggs
exttrail ./dirdat/bb
TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT
table m;
ggsci>edit param epmpbb
extract epmpbb
passthru
rmthost 192.168.126.1,mgrport 7809
rmttrail ./dirdat/bb
table m;
ggsci>add extract eiexbb,tranlog,begin now
ggsci>add exttrail ./dirdat/bb,extract eiexbb,megabytes 5
ggsci>add extract epmpbb,exttrailsource ./dirdat/bb
ggsci>add rmttrail ./dirdat/bb,extract epmpbb,megabytes 5
oracle:
ggsci>dblogin userid ggs,password ggs
ggsci>edit param roradd
replicat roradd
userid ggs,password ggs
handlecollisions
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/roradd.dsc,PURGE
MAP dbo.m, TARGET test.m;
ggs使用者下建立ggs_checkpoint表
ggsci>add replicat roradd,checkpointtable ggs.ggs_checkpoint,exttrail ./dirdat/bb
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29119536/viewspace-1346855/,如需轉載,請註明出處,否則將追究法律責任。

相關文章