Goldengate配置oracle to mysql

來源:互聯網
上載者:User

以前oracle to mysql實驗總是有亂碼問題不能解決,後來和同事交流中,他說oracle使用ogg的11g版本,mysql使用ogg的10g版本可以解決亂碼問題,開始我還是懷疑,因為想新的版本都不行,難道老版本就可以解決這個問題嗎?抱著試試看的態度,做了個實驗,盡然成功了,把實驗的相關情況記錄下來

mysql參數配置(cat /etc/my.cnf):

[client]

default-character-set = gbk

[mysqld]

lower_case_table_names=1–表名不區分大小寫(省的在repl進程中因為大小寫問題導致不能捕獲資料)

character-set-server = gbk

表/列編碼:均為gbk

Note:

1、因為mysql是target端,所以對於log-bin/binlog_format參數無要求

2、通過以上設定確保mysql的所有相關編碼均為gbk

系統編碼配置(cat /etc/sysconfig/i18n):

source:

LANG=”zh_CN.GBK”

SUPPORTED=”zh_CN.GBK:zh_CN:zh”

SYSFONT=”latarcyrheb-sun16″

target:

LANG=”zh_CN.GBK”

SYSFONT=”latarcyrheb-sun16″

Note:是的系統編碼和mysql編碼相同

OGG配置過程:

source端:

add extract ext-all,tranlog,begin now

ADD EXTTRAIL /opt/OGG/dirdat/extract/AL, EXTRACT ext-all

edit params ext-all

extract ext-all

SETENV (NLS_LANG =AMERICAN_AMERICA.ZHS16GBK)

userid is1ogg,password passw0rd

exttrail /opt/OGG/dirdat/extract/AL

discardfile /opt/OGG/discard/ext-all.txt, append, megabytes 100

DDL INCLUDE MAPPED OPTYPE alter OBJNAME ECP.TAB*

查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

TABLE ecp.*;

add EXTRACT p-air, EXTTRAILSOURCE /opt/OGG/dirdat/extract/AL, BEGIN now

add rmttrail /opt/OGG/dirdat/rl extract p-air

edit params p-air

extract p-air

SETENV (NLS_LANG =AMERICAN_AMERICA.ZHS16GBK)

userid is1ogg,password passw0rd

RMTHOST 192.168.1.4,MGRPORT 7809,TCPBUFSIZE 100000,TCPFLUSHBYTES 300000

rmttrail /opt/OGG/dirdat/rl

discardfile /opt/OGG/discard/p-air.txt, append, megabytes 100

TABLE ecp.*;

target端:

add replicat repl, exttrail /opt/OGG/dirdat/rl,nodbcheckpoint

edit params repl

replicat repl

DBOPTIONS HOST 127.0.0.1, CONNECTIONPORT 3306

TARGETDB ecp,userid root,password xifenfei

assumetargetdefs

reperror default,discard

discardfile /tmp/mysql.dsc,append,megabytes 100

MAP ECP.TAB_UUM_DEPT, TARGET ecp.tab_uum_dept;

MAP ECP.TAB_UUM_DEPT_LEADER, TARGET ecp.tab_uum_dept_leader;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.