设为首页 加入收藏

TOP

使用GoldenGate 实现Oracle for Oracle 单向数据同步(三)
2015-11-10 12:16:28 来源: 作者: 【 】 浏览:3
Tags:使用 GoldenGate 实现 Oracle for 单向 数据 同步
ystem.ggschkpt)...
?
Successfully created checkpoint table system.ggschkpt.
?
GGSCI (localhost.localdomain) 3>


添加Replicat


GGSCI (localhost.localdomain) 3> ADD REPLICAT RORAKK, EXTTRAIL ./dirdat/KK
REPLICAT added.


创建Replicat的参数文件


GGSCI (localhost.localdomain) 4> EDIT PARAMS RORAKK
?
?
--
-- Change Delivery parameter file to apply
-- TCUSTMER and TCUSTORD Changes
--
REPLICAT RORAKK
USERID system, PASSWORD oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
MAP scott.tcustmer, TARGET scott.tcustmer;
MAP scott.tcustord, TARGET scott.tcustord;


启动Replicat


GGSCI (localhost.localdomain) 5> start replicat rorakk
?
Sending START request to MANAGER ...
REPLICAT RORAKK starting


验证结果


GGSCI (localhost.localdomain) 6> info replicat rorakk
?
REPLICAT? RORAKK? ? Last Started 2015-08-22 15:49? Status RUNNING
Checkpoint Lag? ? ? 00:00:00 (updated 00:00:08 ago)
Log Read Checkpoint? File ./dirdat/KK000000
? ? ? ? ? ? ? ? ? ? First Record? RBA 1050


验证数据同步


在源数据库,执行如下脚本,对两个表进行insert、update、delete操作


[oracle@localhost ogg]$ sqlplus scott/tiger
?
SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 11 17:58:17 2015
?
Copyright (c) 1982, 2009, Oracle.? All rights reserved.
?
?
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
?
SQL> @/u01/app/ogg/demo_ora_misc.sql


查看源表中的数据


SQL> select count(*) from tcustmer;
?
? COUNT(*)
----------
? ? 5
?
SQL> select count(*) from tcustord;
?
? COUNT(*)
----------
? ? 3


查看目的表的数据


SQL> select count(*) from tcustmer;
?
? COUNT(*)
----------
? ? 5
?
SQL> select count(*) from tcustord;
?
? COUNT(*)
----------
? ? 3


数据已同步


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Sqoop数据导出导入命令 下一篇Oracle GoldenGate 介绍及安装配..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: