加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 襄阳站长网 (https://www.0710zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

ogg异构oracle-mysql

发布时间:2020-12-24 09:00:19 所属栏目:站长百科 来源:网络整理
导读:副标题#e# /* 参数文件里,TABLE参数中有cols和COLSEXCEPT 项 前者用来选择要capture的字段,后者指定要排除的字段 但是官方文档上有一句 Do not exclude key columns,and do not use COLSEXCEPT to exclude columns that contain unsupported data types.

目的端的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:
/home/oracle/app/oracle/ogg/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 /home/oracle/app/oracle/ogg/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.

双向同步需要考虑的是怎么解决循环复制,以及同时更新一张表以谁为基准。
配置过程就不写了,大致和oracle到mysql的单向+mysql到oracle的单向差不多。
需要注意的有如下几点:
1.oracle和mysql的2端,抽取(extract)和应用(replication)应该使用不同的用户
2.为解决禁止循环复制,应该在ext进程配置3个参数,如下:
oracle的extract:

extract ext4
dynamicresolution
userid ggs,password ggs
RANLOGOPTIONS EXCLUDEUSER repggs
GETAPPLOPS
IGNOREREPLICATES
exttrail /home/oracle/app/oracle/ogg/dirdat/dd
table hr.ah6;

mysql的extract:

extract ext5
setenv (MYSQL_HOME="/u01/mysql")
sourcedb [email?protected]:3306,password 123456
tranlogoptions altlogdest /tmp/binlog.index
TRANLOGOPTIONS EXCLUDEUSER reproot
GETAPPLOPS
IGNOREREPLICATES
exttrail /home/oracle/app/oracle/ogg/dirdat/mb
--dynamicresolution
--gettruncates
table sure.ah6;

只复制应用产生的数据,忽略replication产生的数据,以及忽略replication进程的用户。
3. ./GLOBALS 是全局变量,只在replication的时候有用,所以配置的时候需要加上:
GGSCHEMA repggs --这个参数只在oracle里面有
CheckpointTable repggs.checkpointtab --这个参数oracle和mysql里面都有
4.在extract用ggs/root用户,在replication用repggs/reproot用户
5.因为是双向同步,所以同一个表,比如说ah6,在oracle生成的define要传递到mysql去,在mysql生成的define也要传递到oracle去。
所以,建议命名规则是oracle->mysql:ah6_o2m.prm,mysql->oracle:ah6_m2o.prm
6.从oracle复制到mysql的dml操作,需要手工commit,这个还没找到解决的方法(除了把auto_commit改为on)。

(编辑:PHP编程网 - 襄阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!