GoldenGate --file to replicat 初始化Oracle資料到MySQL

來源:互聯網
上載者:User

將Oracle的資料初始化到mysql,使用oracle to mysl 工具將oracle的資料類型映射成mysql的資料類型,並作相應的修改,使mysql可容納oracle的欄位長度,本文執行初始資料,並沒有做複製,只是導資料過去,而且源端的oracle資料庫是靜止的,如果非靜止就需要配置抽取進程和應用進程

1.編輯mgr參數
source

 edit param mgr

PORT 7819
DYNAMICPORTLIST 7820-7840
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 2, RESETMINUTES 10
--PURGEOLDEXTRACTS /data/goldengate/dirdat/*, USECHECKPOINTS, MINKEEPDAYS 3
--purgeddlhistory minkeepdays 7, maxkeepdays 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45

target

 edit param mgr

 

PORT 7819
DYNAMICPORTLIST 7820-7840
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 2, RESETMINUTES 10
--PURGEOLDEXTRACTS /data/goldengate/dirdat/*, USECHECKPOINTS, MINKEEPDAYS 3
--purgeddlhistory minkeepdays 7, maxkeepdays 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45


2.啟動mgr
source
start mgr
info all
target
start mgr
info all

 

3.編輯初始化進程

初始化的進程不需要啟動


source

edit param extinit
 
 
SOURCEISTABLE
setenv (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
userid goldengate, password goldengate
RMTHOST 10.58.8.26,MGRPORT 7819
RMTFILE /data/goldengate/rmtfile 5000,MEGABYTES 1024
scott.*;

target

edit param repinit
SPECIALRUN
END RUNTIME
setenv (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
DBOPTIONS HOST 127.0.0.1, CONNECTIONPORT 3306
TARGETDB testdb,userid root,password root_password

EXTFILE /data/goldengate/rmtfile
assumetargetdefs
MAP scott.*, TARGET testdb.*;

---此處可能出現問題,可以先使用dblogin 測試使用者是否可以登入mysql資料庫,可能會報/tmp/scok的錯誤,是由於手工編譯安裝mysql,tmp下沒有這個檔案,在tmp創檔案並ln 到真正的安裝目錄的sock檔案

 

4.啟動初始化
source
cd /data/goldengate/
/data/goldengate/extract paramfile dirprm/extinit.prm reportfile dirrpt/extinit.rpt

target
cd /data/goldengate/
/data/goldengate/replicat paramfile dirprm/repinit.prm reportfile dirrpt/repinit.rpt

聯繫我們

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