目的端配置大致分为如下三个步骤:配置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到mysql的同步

    说明:这篇文章将介绍如何配置oracle到mysql的ogg同步 源端:ip-192.168.56.11 数据库类型-oracle 11.2.0.4目标端:ip-192.168.56.71 数据库类型 ...

  9. OGG到OGGAdapter配置详情-从Oracle直接抽取成csv文件

    Oracle Golden Gate是Oracle旗下一款支持异构平台之间高级复制技术,是Oracle力推一种HA高可用产品,简称“OGG”,可以实现Active-Active 双业务中心架构 1.1 ...

随机推荐

  1. Linux下shell脚本中信号捕获和函数练习脚本之ping一个网段

    该脚本主要的目的是练习在Linux bash脚本中捕获信号,顺便练习一下函数的使用,还有就是终止一个正在运行的程序后,该程序打开的文件的后续处理问题等等!脚本功能:  ping一个网段内的IP,检测哪 ...

  2. xcode

    1: info.plist IOS之Info.plist文件简介 http://www.apkbus.com/android-130240-1-1.html 在Xcode项目中读取plist文件 ht ...

  3. 【hdu2815-Mod Tree】高次同余方程-拓展BadyStepGaintStep

    http://acm.hdu.edu.cn/showproblem.php?pid=2815 题意:裸题... 关于拓展BSGS的详细解释我写了一篇博文:http://www.cnblogs.com/ ...

  4. Android测试分析3

    一个基本的测试用例-- 如果是在eclipse中开发,那么需要在AndroidManifest.xml中加入如下两段代码:    <uses-library android:name=" ...

  5. Google技术专家的建议:各种SdkVersion如何选择?

    原文链接: https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkver ...

  6. (转)keytools命令

    结合网络资源,对keytool使用总结,以备后用: Keytool是一个Java数据证书的管理工具 ,Keytool将密钥(key)和证书(certificates)存在一个称为keystore的文件 ...

  7. collection系列用法-deque双向队列

    deque双向队列 Deque可以从两端添加和删除元素.常用的结构,是它的简化版本. Deque支持序列的常用操作,现在举一个简单例子,你会发现其实跟平成的list没啥区别: import colle ...

  8. Java基础知识总结之IO流

    理解Java的IO流 流(Stream)的概念:程序与数据来源之间的桥梁 流的分类 按流的方向来分(从程序所在的内存的角度来看): 输入流:把外部输入读入当前程序所在内. 输出流:把当前程序所在内存的 ...

  9. esp8266 终于装上固件了!半个月了!开始进军简单粗暴的lua语言!!

    第一次测试2017-10-2720:33:33 感谢这位大神的汇总资料太详细了 http://www.cnblogs.com/yangfengwu/p/7524326.html --first tes ...

  10. js 基本包装类型 String

    为了操作基本类型值,ECMAScript提供了三个特殊的引用类型: Boolean , Number , String 举例: var s1 = "some text"; var ...