目的端配置大致分为如下三个步骤:配置mgr,配置checkpoint table,配置应用进程

在目的端先创建一张表,记得带主键:

mysql> create database hr;
Query OK, 1 row affected (0.00 sec)

mysql> use hr
Database changed
mysql> create table ah4(id int ,name varchar(10),primary key(id));
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+--------------+
| Tables_in_hr |
+--------------+
| ah4 |
+--------------+
1 row in set (0.00 sec)

mysql>

1.配置mgr

GGSCI (nosql2) 2> edit params mgr

PORT 7809
DYNAMICPORTLIST 7810-7909
--AUTOSTART ER *
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 3
PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 3
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45

GGSCI (nosql2) 3> start mgr

Manager started.

GGSCI (nosql2) 4> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

2.配置checkpoint table

GGSCI (nosql2) 7> edit  params ./GLOBALS

CHECKPOINTTABLE hr.checkpoint 

添加:

GGSCI (nosql2) 8>  add checkpointtable hr.checkpointtab

Successfully created checkpoint table hr.checkpointtab.

GGSCI (nosql2) 9> info checkpointtable hr.checkpointtab

Checkpoint table hr.checkpointtab created 2014-04-02 16:11:38.

GGSCI (nosql2) 10> 

在相应的mysql数据库中,也可以看到相应的表被添加了:
mysql> show tables;
+---------------+
| Tables_in_hr  |
+---------------+
| ah4           |
| checkpointtab |
+---------------+
2 rows in set (0.00 sec)

3.配置应用进程:

GGSCI (nosql2) 10> edit params rep3 

replicat rep3
sourcedefs /u01/ogg/11.2/dirdef/ah4.prm
SOURCEDB hr,userid root,password 123456
reperror default,discard
discardfile /u01/ogg/11.2/dirrpt/rep4.dsc,append,megabytes 50
map hr.ah4, target hr.ah4;
GGSCI (nosql2) 13> add replicat rep3,exttrail /u01/ogg/11.2/dirdat/xs,checkpointtable hr.checkpointtab
REPLICAT added.

PS:

REPLICAT进程参数配置说明:
ASSUMETARGETDEFS:假定两端数据结构一致使用此参数;
SOURCEDEFS:假定两端数据结构不一致,使用此参数指定源端的数据结构定义文件,该文件需要由GlodenGate工具产生。
MAP:用于指定源端与目标端表的映射关系;
MAPEXCLUDE:用于使用在MAP中使用*匹配时排除掉指定的表;
REPERROR:定义出错以后进程的响应,一般可以定义为两种:
ABEND,即一旦出现错误即停止复制,此为缺省配置;
DISCARD,出现错误后继续复制,只是把错误的数据放到discard文件中。
DISCARDFILE:定义discardfile文件位置,如果处理中油记录出错会写入到此文件中;
SQLEXEC:在进程运行时首先运行一个SQL语句;
GROUPTRANSOPS:将小交易合并成一个大的交易进行提交,减少提交次数,降低系统IO消耗。
MAXTRANSOPS:将大交易拆分,每XX条记录提交一次。

4.测试

在目的端启动rep3进程,在源端启动ext3和push3进程。

在源端的ah4表中插入一条数据,看是否在目的端的ah4表中能看到。

源端进程:

GGSCI (ora11g) 30> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXT1        00:00:00      00:00:03
EXTRACT     RUNNING     EXT2        00:00:00      00:00:07
EXTRACT     RUNNING     EXT3        00:44:09      00:00:06
EXTRACT     RUNNING     PUSH1       00:00:00      00:00:03
EXTRACT     RUNNING     PUSH2       00:00:00      00:00:03
EXTRACT     RUNNING     PUSH3       00:00:00      00:37:40    

GGSCI (ora11g) 31> 

源端插入数据:

SQL> insert into ah4 values(1,'aaaccc');

1 row created.

SQL> commit;

Commit complete.

源端的ogg日志:

2014-04-02 16:19:26  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, ext3.prm:  EXTRACT EXT3 started.
2014-04-02 16:19:26  INFO    OGG-01052  Oracle GoldenGate Capture for Oracle, ext3.prm:  No recovery is required for target file /u01/ogg/11.2/dirdat/xs000000, at RBA 0 (file not opened).
2014-04-02 16:19:26  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, ext3.prm:  Output file /u01/ogg/11.2/dirdat/xs is using format RELEASE 11.2.
2014-04-02 16:19:26  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, ext3.prm:  Position of first record processed Sequence 1122, RBA 14423056, SCN 0.20548956, Apr 2, 2014 3:35:22 PM.
2014-04-02 16:19:29  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start push3.
2014-04-02 16:19:29  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host ora11g:52177 (START EXTRACT PUSH3 ).
2014-04-02 16:19:29  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT PUSH3 starting.
2014-04-02 16:19:29  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, push3.prm:  EXTRACT PUSH3 starting.
2014-04-02 16:19:29  INFO    OGG-03035  Oracle GoldenGate Capture for Oracle, push3.prm:  Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
2014-04-02 16:19:29  INFO    OGG-01815  Oracle GoldenGate Capture for Oracle, push3.prm:  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ogg/11.2/dirtmp.
2014-04-02 16:19:29  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, push3.prm:  EXTRACT PUSH3 started.
2014-04-02 16:19:34  INFO    OGG-01226  Oracle GoldenGate Capture for Oracle, push3.prm:  Socket buffer size set to 27985 (flush size 27985).
2014-04-02 16:19:34  INFO    OGG-01052  Oracle GoldenGate Capture for Oracle, push3.prm:  No recovery is required for target file /u01/ogg/11.2/dirdat/xs000000, at RBA 0 (file not opened).
2014-04-02 16:19:34  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, push3.prm:  Output file /u01/ogg/11.2/dirdat/xs is using format RELEASE 11.2.

目的端进程:

GGSCI (nosql2) 21> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REP3        00:00:00      00:00:02    

GGSCI (nosql2) 22> 

目的端数据库:

mysql> select * from ah4;
+----+--------+
| id | name   |
+----+--------+
|  1 | aaaccc |
+----+--------+
1 row in set (0.00 sec)

mysql> 

目的端的ogg日志:

2014-04-02 16:21:55  INFO    OGG-00975  Oracle GoldenGate Manager for MySQL, mgr.prm:  REPLICAT REP3 starting.
2014-04-02 16:21:55  INFO    OGG-00995  Oracle GoldenGate Delivery for MySQL, rep3.prm:  REPLICAT REP3 starting.
2014-04-02 16:21:55  INFO    OGG-03035  Oracle GoldenGate Delivery for MySQL, rep3.prm:  Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
2014-04-02 16:21:55  INFO    OGG-01815  Oracle GoldenGate Delivery for MySQL, rep3.prm:  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/ogg/11.2/dirtmp.
2014-04-02 16:21:55  INFO    OGG-00996  Oracle GoldenGate Delivery for MySQL, rep3.prm:  REPLICAT REP3 started.

2014-04-02 16:22:17  INFO    OGG-00963  Oracle GoldenGate Manager for MySQL, mgr.prm:  Command received from EXTRACT on host ::ffff:192.168.0.164 (START SERVER CPU -1 PRI -1  TIMEOUT 300 PARAMS ).
2014-04-02 16:22:17  INFO    OGG-01677  Oracle GoldenGate Collector for MySQL:  Waiting for connection (started dynamically).
2014-04-02 16:22:17  INFO    OGG-00963  Oracle GoldenGate Manager for MySQL, mgr.prm:  Command received from SERVER on host localhost.localdomain (REPORT 30868 7810).
2014-04-02 16:22:17  INFO    OGG-00974  Oracle GoldenGate Manager for MySQL, mgr.prm:  Manager started collector process (Port 7810).
2014-04-02 16:22:17  INFO    OGG-01228  Oracle GoldenGate Collector for MySQL:  Timeout in 300 seconds.
2014-04-02 16:22:22  INFO    OGG-01229  Oracle GoldenGate Collector for MySQL:  Connected to ::ffff:192.168.0.164:61104.
2014-04-02 16:22:22  INFO    OGG-01669  Oracle GoldenGate Collector for MySQL:  Opening /u01/ogg/11.2/dirdat/xs000000 (byte -1, current EOF 0).
2014-04-02 16:22:53  INFO    OGG-03010  Oracle GoldenGate Delivery for MySQL, rep3.prm:  Performing implicit conversion of column data from character set windows-936 to ISO-8859-1.

配置ogg异构oracle-mysql(3)目的端配置的更多相关文章

  1. 配置ogg异构oracle-mysql(2)源端配置

    源端配置大致分为如下三个步骤:配置mgr,配置抽取进程,配置投递进程 在源端先创建一张表,记得带主键: SQL> create table ah4(id int ,name varchar(10 ...

  2. 配置ogg异构mysql-oracle 单向同步

    从mysql到oracle和oracle到mysql差不多.大致步骤如下: 环境是:192.168.0.165 (Mysql ) —> 192.168.0.164 ( Oracle )想将mys ...

  3. 配置ogg异构oracle-mysql 双向同步注意事项

    双向同步需要考虑的是怎么解决循环复制,以及同时更新一张表以谁为基准. 配置过程就不写了,大致和oracle到mysql的单向+mysql到oracle的单向差不多. 需要注意的有如下几点: 1.ora ...

  4. 配置ogg异构oracle-mysql(1)基础环境配置

    一.环境描述: 192.168.0.164 ( Oracle ) —> 192.168.0.165 (Mysql ) 版本: 操作系统:redhat5.8 Oracle:  11.2.0.3 M ...

  5. 配置ogg目录索引-oracle与mysql的双向同步步骤

    以下几篇文章描述了利用ogg对oracle与mysql进行双向同步的配置过程以及注意事项,欢迎参考. 配置ogg异构oracle-mysql(1)基础环境配置 http://www.cnblogs.c ...

  6. MySQL下载安装配置和Navicat for MySQL的安装配置

    MySQL 一.下载 地址:MySQL :: Download MySQL Installer 选择那个几百M的msi文件下载 二.安装 第一步: 安装许可 双击安装文件,在如下图所示界面中勾选&qu ...

  7. Oracle RAC 11g DG Broker配置和测试

    Oracle RAC 11g DG Broker配置和测试 之前在<RHEL6.4 + Oracle 11g DG测试环境快速搭建参考>已经简单说过. 本篇在实验环境中实际配置 环境: R ...

  8. 基于OGG的Oracle与Hadoop集群准实时同步介绍

    版权声明:本文由王亮原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/220 来源:腾云阁 https://www.qclou ...

  9. CentOS系统MySQL双机热备配置

    1  概述 在集成项目中需要应对不同环境下的安装配置,主流操作系统大致可以分为三种:Linux.Windows以及UNIX.其中Linux备受青睐的主要原因有两个: 首先,Linux作为自由软件有两个 ...

随机推荐

  1. 用API网关把API管起来

    最开始只是想找个API网关防止API被恶意请求,找了一圈发现基于Nginx的OpenResty(Lua语言)扩展模块Orange挺好(也找了Kong,但是感觉复杂了点没用),还偷懒用Vagrant结合 ...

  2. wamp多网站配置for window 本地测试 单Ip

    网上有很多WAMP集成环境下单IP多域名虚拟主机配置的文章,自己总结了有用方法记录下来 简单的介绍一下我的系统环境:window xp  和 wamp apache2.2.8 ------------ ...

  3. 每天一个linux命令(54):ping命令

    Linux系统的ping命令是常用的网络命令,它通常用来测试与目标主机的连通性,我们经常会说“ping一下某机器,看是不是开着”.不能打开网页时会说“你先ping网关地址192.168.1.1试试”. ...

  4. JavaScript实现DDoS攻击原理,以及保护措施。

    DDos介绍 最普遍的攻击是对网站进行分布式拒绝服务(DDoS)攻击.在一个典型的DDoS攻击中,攻击者通过发送大量的数据到服务器,占用服务资源.从而达到阻止其他用户的访问. 如果黑客使用JavaSc ...

  5. Jenkins通过FTP上传站点太多文件导致太慢且不稳定,切换为压包上传再解压的思路(asp.net)

    在本地先处理好要上传的站点文件之后,可能会因为一些网页切图导致ftp上传不稳定,中断,或者文件占用的问题. 那么换了一种实现思路,要借助jenkins的工具jenkins-cli.jar. 解决思路: ...

  6. java 获取文件的最后编辑时间

    还是日志的问题,需要把日志文件的一些信息给显示出来,其中就需要显示最后的编辑时间,在网上找的答案... File f = new File(path); SimpleDateFormat sdf = ...

  7. [机器学习]信息&amp;熵&amp;信息增益

    关于对信息.熵.信息增益是信息论里的概念,是对数据处理的量化,这几个概念主要是在决策树里用到的概念,因为在利用特征来分类的时候会对特征选取顺序的选择,这几个概念比较抽象,我也花了好长时间去理解(自己认 ...

  8. poj 3349:Snowflake Snow Snowflakes(哈希查找,求和取余法+拉链法)

    Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 30529   Accep ...

  9. .NET方向高级开发人员面试时应该事先考虑的问题

    (澄清一下,我发帖的目的不是用来专门给人评价这些问题的好坏的,实际上我所在 的公司就考察这些问题.而能够基本上答出来的可以说百里挑一.如果各位觉得这些问题很简单,那么基本上在.NET面试环节就没有什么 ...

  10. JAVA图片相关

    有些图片后缀为jpg,但是实际格式却不是jpg,通过url下载图片字节.然后用ImageIO读取时,出现返回null的情况.出现这种情况,就需要使用webp-imageio.jar.(https:// ...