基础环境请参考:
goldengate for win2003 DML单向复制
http://hunt1574.blog.51cto.com/1390776/1032908


 

1、创建用户:
create user  ggate identified by ggate default tablespace users temporary tablespace temp;
grant connect,resource,dba,unlimited tablespace to ggate;

@marker_setup.sql; ---输入ggate
@ddl_setup.sql; ---输入ggate,INITIALSETUP
@role_setup.sql;
grant GGS_GGSUSER_ROLE to ggate;
@ddl_enable.sql;

2、复制队列:
GGSCI (ogg1) 1> edit param globals
GGSCHEMA ggate

GGSCI (ogg1) 2> add extract ext2,tranlog,begin now
GGSCI (ogg1) 3> add exttrail 'c:\gg\dirdat\r1', extract ext2

GGSCI (ogg1) 4> edit param ext2
extract ext2
userid ggate, password ggate
rmthost 192.168.6.10, mgrport 7809
rmttrail c:\gg\dirdat\r1
dynamicresolution
gettruncates
DDL include all
table ggate.*;

GGSCI (ogg1) 5> stop *
GGSCI (ogg1) 6> stop mgr
GGSCI (ogg1) 7>start mgr
GGSCI (ogg1) 8>start ext2

3、配置同步队列
GGSCI (ogg2) 1> edit param globals
GGSCHEMA ggate

GGSCI (ogg2) 2> ADD replicat rep2 EXTTRAIL c:\gg\dirdat\r1,nodbcheckpoint
GGSCI (ogg2) 3> edit param rep2
replicat rep2
userid ggate,password ggate
assumetargetdefs
reperror default,discard
ddl include all
discardfile c:\gg\rep2_dsc.log,append,megabytes 100
map ggate.*, target ggate.*;

GGSCI (ogg2) 5> stop *
GGSCI (ogg2) 6> stop mgr
GGSCI (ogg2) 7> start mgr
GGSCI (ogg2) 8> start emp2

4、测试:
create table ggstest (ggsid number primary key,name varchar2(20));
在表上执行insert/update/delete/trunacte等操作,验证同步