电竞比分网-中国电竞赛事及体育赛事平台

分享

goldengate同步mysql

 wghbeyond 2013-09-24
一、source端
add extract extl,vam,begin now
ADD EXTTRAIL F:\ogg\mysql\dirdat\rl, EXTRACT EXTL

edit params extl
extract extl
sourcedb test@localhost:3306,userid root,password xifenfei
exttrail F:\ogg\mysql\dirdat\rl
dynamicresolution
gettruncates
table test.t_1;

add EXTRACT pump1, EXTTRAILSOURCE F:\ogg\mysql\dirdat\rl, 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;
二、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、注意各個參數(shù)中schema.tablename大小寫問題
1)win中不區(qū)分,全部使用小寫會自動轉(zhuǎn)換為大寫
2)在replicate參數(shù)中,因為map是從win中的data pump中得到,所以map后面的schema.tablename需要大寫
3)在replicate參數(shù)中,因為table是linux中的對應(yīng)linux中的數(shù)據(jù)庫名和表名(mysql是以文件形式存儲,一般均為小寫),所以map后面的schema.tablename需要小寫+雙引號,防止轉(zhuǎn)為大寫
3、注意mysql數(shù)據(jù)庫編碼
四、與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

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多