Oracle技術之使用goldengate同步mysql

來源:互聯網
上載者:User

一、source端

add extract extl,vam,begin now

ADD EXTTRAIL F:oggmysqldirdatrl, EXTRACT EXTL

edit params extl

extract extl

sourcedb test@localhost:3306,userid root,password xifenfei

exttrail F:oggmysqldirdatrl

dynamicresolution

gettruncates

table test.t_1;

add EXTRACT pump1, EXTTRAILSOURCE F:oggmysqldirdatrl, BEGIN now

add rmttrail /ogg/mysql/dirdat/rl extract pump1

edit params pump1

extract pump1

rmthost 192.168.1.111,mgrport 7808

rmttrail /ogg/mysql/dirdat/rl

PASSTHRU

gettruncates

table test.t_1;

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

二、target端

edit params ./GLOBALS

dblogin sourcedb test@localhost:3306,userid root,password xifenfei

CHECKPOINTTABLE ogg.chkpoint

ADD CHECKPOINTTABLE ogg.chkpoint

add replicat repl exttrail /ogg/mysql/dirdat/rl,begin now,checkpointtable ogg.chkpoint

edit params repl

replicat repl

DBOPTIONS HOST 127.0.0.1, CONNECTIONPORT 3306

TARGETDB test,userid root,password xifenfei

assumetargetdefs

reperror default,discard

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

gettruncates

map TEST.T_1, target "test.t_1";

三、說明

本執行個體是win 中的mysql同步到linux中的mysql

有個注意點:

1、add extract extl,vam,begin now 不像oracle中的tranlog

2、注意各個參數中schema.tablename大小寫問題

1)win中不區分,全部使用小寫會自動轉換為大寫

2)在replicate參數中,因為map是從win中的data pump中得到,所以map後面的schema.tablename需要大寫

3)在replicate參數中,因為table是linux中的對應linux中的資料庫名和表名(mysql是以檔案形式儲存,一般均為小寫),所以map後面的schema.tablename需要小寫+雙引號,防止轉為大寫

3、注意mysql資料庫編碼

四、與oracle不同之處

1、登入

dblogin sourcedb dbname@localhost:3306,userid root,password xifenfei

2、Extract中訪問mysql

sourcedb dbname@localhost:3306,userid root,password xifenfei

3、Replicat中訪問mysql

DBOPTIONS HOST 127.0.0.1, CONNECTIONPORT 3306

TARGETDB dbname,userid root,password xifenfei

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.