目的端配置大致分为如下三个步骤:配置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. Android开发学习之路-Android Studio开发小技巧

    上一次发过了一个介绍Studio的,这里再发一个补充下. 我们都知道,Android Studio的功能是非常强大的,也是很智能的.如果有人告诉你学Android开发要用命令行,你可以告诉他Andro ...

  2. 存储过程中的output跟return区别及实例说明

    存储过程return,表示该存储过程执行到当当前return位置,不再向下执行: 存储过程写法:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER ...

  3. backbone框架思路

    Backbone是MVC框架.如何使用这个框架来简化前端过程呢?作为一个初学者,虽然网上有它的官方文档,但是都是讲的一些方法,思路分析的却对初学者来说,看得晕乎乎的.现在就把自己对这个框架的理解记录在 ...

  4. extJs学习基础4 Ext.each的用法

    Ext.onReady(function(){ //案例一 /* var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'] ...

  5. 大数据导致DataReader.Close超时的异常

    公司一个数据抓取的程序,数据量极大,读取数据的用IDataReader的Read方法来进行数据处理,在测试的时候我想跑一部分数据后跳出循环,即break; 然后关闭datareader,但是在执行da ...

  6. DIV布局-高度不同DIV,自动换行并对齐

    最近弄了一个动态添加div框,每个div框内容有多有少,要支持div高度自适应,还要添加的div自动追加,并且换行还要保持每行对齐. 刚开始的效果: 要改啊,搞不定,问了UI高手,终于给出了完美解决方 ...

  7. 2016年2月18日 JAVA基础

    运行JAVA之前,必须将系统环境变量进行配置. 如果是32位的计算机安装的JDK版本必须是32位的,如果是64位的计算机安装的JDK版本必须是64位的,两者不可忽视,以免程序无法正常启动. 具体更改方 ...

  8. H5实现俄罗斯方块(一)

    这几天一直忙于公司的项目,涉及到流程问题,(有时间会写成博客的)...一直没有更新... 为了更加巩固js的基础,自己封装类似于JQuery的操作库来对dom进行操作. 一:前度页面的绘制. < ...

  9. (C# ) 解析XML。

    解析XML有很多方法,之前用专门写的XMLProcess 或XMLHelper 解析类.其实有个较简单的解析就是用Linq查询. 例如有如下XML <?xml version="1.0 ...

  10. Oracle中关于数据库实例名与数据库服务名(转载)

    今天同事,出现了数据库连接失败的问题,一起百度了一下,结果总算解决了,以下是一些转载过来的普及知识. 1.查询数据库名:select name,dbid from v$database;或者命令行:s ...