溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

goldengate 重新或者添加同步部分表

發(fā)布時(shí)間:2020-07-14 13:52:26 來(lái)源:網(wǎng)絡(luò) 閱讀:1578 作者:春秋小記 欄目:關(guān)系型數(shù)據(jù)庫(kù)


1.檢查主鍵,檢查要同步的表時(shí)候有主鍵,如果沒(méi)有則添加主鍵;

2.添加表的附加日志:

dblogin userid goldengate, password goldengate

add trandata chunqiu.app_sta_flow_list

如果是在備庫(kù)上進(jìn)行抽取,可以連接主庫(kù)后添加:

dblogin userid @chunqiu_primary, password goldengate

添加需要抽取的表:

map chunqiu.app_sta_flow_list

3.停止應(yīng)用進(jìn)程

3.使用expdp指定scn導(dǎo)出需要的表:

參考:https://blog.51cto.com/1937519/2177360 

            https://blog.51cto.com/1937519/2177352

或者快速入門(mén):

select sysdate,dbms_flashback.get_system_change_number || '' from dual;

expdp system directory=orabackup dumpfile=chunqiu_%U.dmp parallel=3 logfile=chunqiu.log tables=chunqiu.app_sta_flow_list ,chunqiu.t_sta_flow_detail ,chuqniu.T_BI_CUSTOMER, CLUSTER=no flashback_scn=8089801183405 exclude=trigger

4.impdp導(dǎo)入數(shù)據(jù)到目標(biāo)數(shù)據(jù)庫(kù);

5.編輯應(yīng)用進(jìn)程,添加如下映射

如果使用的11g的ogg,需要使用雙引號(hào)"transaction","csn",如果使用的是12c的ogg使用單引號(hào):

goldengate12c后的寫(xiě)法:

map chunqiu.app_sta_flow_list ,       target chunqiu.app_sta_flow_list  ,  filter (@GETENV ('transaction', 'csn') > 8089801183405 );

goldengate 11g及之前的寫(xiě)法:

map chunqiu.app_sta_flow_list ,       target chunqiu.app_sta_flow_list  ,  filter (@GETENV ("transaction", "csn") > 8089801183405 );

出錯(cuò)參考:

如果在goldengate 12C中寫(xiě)成goldengate11G之前的格式:

map chunqiu.app_sta_flow_list ,       target chunqiu.app_sta_flow_list  ,  filter (@GETENV ("transaction", "csn") > 8089801183405 );

則進(jìn)程會(huì)報(bào)錯(cuò),報(bào)錯(cuò)信息如下:
2018-09-27 17:59:20  INFO    OGG-01298  Column function diagnostic message: could not find column "transaction".

2018-09-27 17:59:20  ERROR   OGG-00375  Error in FILTER clause.


6.啟動(dòng)應(yīng)用進(jìn)程,等應(yīng)用進(jìn)程追平后,關(guān)掉就用進(jìn)程,去掉過(guò)濾參數(shù):

map chunqiu.app_sta_flow_list ,       target chunqiu.app_sta_flow_list ;

啟動(dòng)應(yīng)用進(jìn)程。


最后只想說(shuō)明一點(diǎn):

goldengate出錯(cuò),不要懷疑人生,也不要懷疑goldengate,好好的生活,出錯(cuò)就看日志。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI