GoldenGate单向表DML同步(六)

2014-11-24 14:59:24 · 作者: · 浏览: 4
加checkpoint:
GGSCI (kf2.calvin) 6> add checkpointtable
ERROR: Missing checkpoint table specification ##报错提示没有指定checkpoint表
GGSCI (kf2.calvin) 7> add checkpointtable system.ggchkptable
Successfully created checkpoint table SYSTEM.GGCHKPTABLE.
添加replicate组和参数文件:
GGSCI (kf2.calvin) 10> add replicat rorakk, exttrail ./dirdat/kk, checkpointtable SYSTEM.GGCHKPTABLE
REPLICAT added.
GGSCI (kf2.calvin) 11> edit params rorakk
REPLICAT RORAKK
USERID system, PASSWORD calvin
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
MAP ogguser.TCUSTMER, TARGET ogguser.TCUSTMER;
MAP ogguser.TCUSTORD, TARGET ogguser.TCUSTORD;
启动replicat:
GGSCI (kf2.calvin) 3> start replicat rorakk
Sending START request to MANAGER ...
REPLICAT RORAKK starting
查看replicat报告:
GGSCI (kf2.calvin) 4> view report rorakk
...
Opened trail file ./dirdat/kk000000 at 2013-04-16 14:27:04 ##看到这句说明成功
9. 测试DML数据记录同步情况
源库插入测试数据记录:
SQL> insert into tcustord values('CALV',to_date('2013/04/16','yyyy/mm/dd'),'CHR',111,'100011',5,6);
1 row created.
SQL> commit;
SQL> select * from tcustord;
CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
---- --------- -------- ---------- ------------- -------------- --------------
WILL 30-SEP-94 CAR 144 17520 3 100
JANE 11-NOV-95 PLANE 256 133300 1 100
CALV 16-APR-13 CHR 111 100011 5 6
SQL> insert into tcustmer values('1001','CALV','SHANGHAI','SH');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from tcustmer;
CUST NAME CITY ST
---- ------------------------------ -------------------- --
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
1001 CALV SHANGHAI SH
目标库查看数据记录是否同步:
[oracle@kf2 ogg11]$ sqlplus ogguser/ogguser
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 14:39:46 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tcustord;
CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
---- --------- -------- ---------- ------------- -------------- --------------
WILL 30-SEP-94 CAR 144 17520 3 100
JANE 11-NOV-95 PLANE 256 133300 1 100
CALV 16-APR-13 CHR 111 100011 5 6 ##已同步
SQL> select * from tcustmer;
CUST NAME CITY ST
---- ------------------------------ -------------------- --
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
1001 CALV SHANGHAI SH ##已同步
源库删除数据记录测试:
SQL> delete from tcustord where order_id='111';
1 row deleted.
SQL> commit;
Commit c