本篇內(nèi)容主要講解“Goldengate異構(gòu)數(shù)據(jù)同步的具體方案”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“Goldengate異構(gòu)數(shù)據(jù)同步的具體方案”吧!
創(chuàng)新互聯(lián)主打移動(dòng)網(wǎng)站、成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站改版、網(wǎng)絡(luò)推廣、網(wǎng)站維護(hù)、域名注冊(cè)、等互聯(lián)網(wǎng)信息服務(wù),為各行業(yè)提供服務(wù)。在技術(shù)實(shí)力的保障下,我們?yōu)榭蛻?hù)承諾穩(wěn)定,放心的服務(wù),根據(jù)網(wǎng)站的內(nèi)容與功能再?zèng)Q定采用什么樣的設(shè)計(jì)。最后,要實(shí)現(xiàn)符合網(wǎng)站需求的內(nèi)容、功能與設(shè)計(jì),我們還會(huì)規(guī)劃穩(wěn)定安全的技術(shù)方案做保障。
ORACLE源庫(kù)配置準(zhǔn)備工作:
1)開(kāi)啟附加日志
select supplemental_log_data_min from v$database; SUPPLEME --------------- NO alter database add supplemental log data; select supplemental_log_data_min from v$database; SUPPLEME --------------- YES
2)開(kāi)啟歸檔(已經(jīng)是歸檔模式,省略)
SQL> shutdown immediate SQL> startup mount SQL> alter database archivelog; SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/arch SQL> alter database open;
3)創(chuàng)建OGG同步用戶(hù):
create user goldengate identified by goldengate default tablespace users; grant dba to goldengate;
源庫(kù)操作(oracle端):
1源端刪除抽取,傳輸進(jìn)程:
dblogin userid goldengate, password goldengate
--增加待同步表的附加日志:
add trandata MW_APP. DYT_DATALOSTRECORD
創(chuàng)建抽取進(jìn)程相關(guān)GGLOG日志目錄:
mkdir –p /ogg/gglog/e_MW_APP/
增加新的抽取進(jìn)程:
add extract e_MW_APP, tranlog, begin now add exttrail /ogg/gglog/e_MW_APP/ex, extract e_MW_APP,megabytes 200
2,刪除并增加傳輸進(jìn)程:
add extract p_MW_APP, exttrailsource /ogg/gglog/e_MW_APP/ex add rmttrail /ogg/gglog/MW_APP/re, extract p_MW_APP, megabytes 200
3在源端啟動(dòng)抽取進(jìn)程前,先做以下操作:
alter extract p_MW_APP,begin now --讓傳輸進(jìn)程從此刻開(kāi)始啟動(dòng)傳輸數(shù)據(jù) start e_MW_APP
創(chuàng)建要同步的表的定義(重要)
1. #創(chuàng)建參數(shù)文件
GGSCI (pos300-db01) 10> edit param defgen defsfile ./dirdef/MW_APP.def userid goldengate, password goldengate table MW_APP.*; #生成表定義文件 ./defgen paramfile ./dirprm/defgen.prm #傳至目標(biāo)庫(kù)目錄 scp /ogg/software/dirdef/MW_APP.def root@192.168.1.241:/ogg/software/dirprm
目標(biāo)庫(kù)(MySQL端)
4刪除復(fù)制進(jìn)程和檢查點(diǎn)表:
目標(biāo)庫(kù)為Mysql, 同oracle與oracle之間的同步略有區(qū)別
1)創(chuàng)建用戶(hù)和待同步庫(kù)
mysql> GRANT ALL PRIVILEGES ON `MW_APP`.* TO root@'%' IDENTIFIED BY ‘root’; mysql>create database MW_APP;
2)創(chuàng)建目錄
GGSCI (zoop300) 1> create subdirs Creating subdirectories under current directory /home/mysql Parameter files /goldengate/dirprm: created Report files /goldengate/dirrpt: created Checkpoint files /goldengate/dirchk: created Process status files /goldengate/dirpcs: created SQL script files /goldengate/dirsql: created Database definitions files /goldengate/dirdef: created Extract data files /goldengate/dirdat: created Temporary files /goldengate/dirtmp: created Stdout files /goldengate/dirout: created mkdir –p /ogg/gglog/MW_APP/
3)配置管理進(jìn)程
GGSCI (zoop300) 3> edit params mgr 加入:port 7809 GGSCI (zoop300) 4> start mgr Manager started. GGSCI (zoop300) 3> info mgr Manager is running
4)配置檢查點(diǎn)及全局
GGSCI (zoop300) 4> dblogin sourcedb MW_APP userid root password root GGSCI (zoop300) 5> add checkpointtable MW_APP.checkpoint_table GGSCI (zoop300) 6> edit params ./GLOBALS checkpointtable MW_APP.checkpoint_table
5)配置replicat進(jìn)程
GGSCI (zoop300) 8> add replicat r_MW_APP ,exttrail /ogg/gglog/MW_APP/re,checkpointtable MW_APP.checkpoint_table
編輯replicat進(jìn)程
edit params r_MW_APP
--加入下列參數(shù)
replicat r_MW_APP targetdb MW_APP userid root password root handlecollisions sourcedefs /ogg/software/dirprm/MW_APP.def discardfile /ogg/software/dirrpt/dcr1.dsc,purge map MW_APP.DYT_DATALOSTRECORD,target MW_APP.DYT_DATALOSTRECORD;
啟動(dòng)進(jìn)程:
GGSCI (zoop300) 9> start dcr1
4、測(cè)試數(shù)據(jù)同步
附錄:
--各進(jìn)程配置 -E extract e_MW_APP SETENV (ORACLE_HOME = "/u01/oracle") SETENV (ORACLE_SID = "idoracle") SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK") userid goldengate,password goldengate exttrail /ogg/gglog/e_MW_APP/ex discardfile /ogg/software/dirrpt/e_MW_APP.dsc,append TRANLOGOPTIONS DBLOGREADER dynamicresolution table MW_APP.DYT_DATALOSTRECORD; -P extract p_MW_APP rmthost 192.168.1.241,mgrport 7809 passthru rmttrail /ogg/gglog/MW_APP/re table MW_APP.DYT_DATALOSTRECORD; -R replicat r_MW_APP targetdb MW_APP userid root password root handlecollisions sourcedefs /ogg/software/dirprm/MW_APP.def discardfile /ogg/software/dirrpt/dcr1.dsc,purge map MW_APP.DYT_DATALOSTRECORD,target MW_APP.DYT_DATALOSTRECORD;
到此,相信大家對(duì)“Goldengate異構(gòu)數(shù)據(jù)同步的具體方案”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢(xún),關(guān)注我們,繼續(xù)學(xué)習(xí)!
本文標(biāo)題:Goldengate異構(gòu)數(shù)據(jù)同步的具體方案
分享路徑:http://aaarwkj.com/article40/gjihho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、動(dòng)態(tài)網(wǎng)站、靜態(tài)網(wǎng)站、網(wǎng)站改版、電子商務(wù)、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)