漢壽ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話(huà)聯(lián)系或者加微信:028-86922220(備注:SSL證書(shū)合作)期待與您的合作!
有時(shí)候ogg兩端數(shù)據(jù)不一致,且數(shù)據(jù)量較大,手工修改比較復(fù)雜的情況下,我們需要對(duì)這些表進(jìn)行初始化。初始化的大概思路是:
停止兩端OGG
如果業(yè)務(wù)不可以停很長(zhǎng)時(shí)間,就需要配置目標(biāo)端進(jìn)程,暫停這些問(wèn)題表的同步。待新數(shù)據(jù)導(dǎo)入后,再次停啟進(jìn)程
源端通過(guò)SCN號(hào)備份問(wèn)題表,傳送到目標(biāo)端還原
修改目標(biāo)端進(jìn)程配置,從SCN開(kāi)始恢復(fù)
開(kāi)啟OGG進(jìn)程
源端簡(jiǎn)陋配置:
GGSCI (db1) 9> infoall
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXTFPZX 00:00:00 00:00:05
GGSCI (db1) 10>view params EXTFPZX
extract extfpzx
useridogg,password ogg
rmthost192.168.25.101,mgrport 7809
rmttrail /u01/goldengate/dirdat/fp
ddl include mappedobjname db_fpzx.*;
table db_fpzx.*;
目標(biāo)端簡(jiǎn)陋配置:
GGSCI (db2) 6> infoall
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPFPZX 00:00:00 00:00:01
GGSCI (db2) 7>view params REPFPZX
REPLICAT repfpzx
USERID ogg,PASSWORDogg
discardfile/u01/goldengate/discard/rep2_discard.dsc, append, megabytes 10
DDL INCLUDE MAPPED
DDLERROR DEFAULTIGNORE RETRYOP
ASSUMETARGETDEFS
map db_fpzx.*,target db_fpzx.*;
我們對(duì)db_fpzx.liuliu這張表進(jìn)行初始化
SQL> select *from liuliu;
ID | AGE | NAME | EEE | WWW |
1 | liu | liuliu222 | ||
2 | liu | liuliu222 | ||
3 | liu | 123 | liuliu333 | |
4 | liu | liuliu444 | ||
5 | liu | liuliu555 | ||
6 | liu | liuliu666 | ||
7 | liu | liuliu222 | ||
8 | shshshs | liuliu222 | ||
9 | liu | liuliu222 |
9 rowsselected.
我們將目標(biāo)端中的數(shù)據(jù)刪除,再在源端插入幾條數(shù)據(jù),是不會(huì)報(bào)錯(cuò)的,但是此時(shí)兩端數(shù)據(jù)已經(jīng)不一致了,需要對(duì)目標(biāo)端進(jìn)行初始化。一般來(lái)說(shuō)初始化是在你不知道丟失哪些數(shù)據(jù)的情況下進(jìn)行,如果差個(gè)兩三條你知道的數(shù)據(jù),直接在目標(biāo)端進(jìn)行插入或修改更快。
SQL> delete from liuliu;
9 rows deleted.
SQL> commit;
Commit complete.
SQL> select *from liuliu;
no rows selected
1、停止兩端OGG進(jìn)程
源端查詢(xún)SCN號(hào):
SQL> selectdbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
729295
2、要求實(shí)時(shí)性的處理
在數(shù)據(jù)實(shí)時(shí)性要求較高的系統(tǒng),首先確定問(wèn)題表,然后只在目標(biāo)端配置文件中將問(wèn)題表剔除:
MAPEXCLUDE DB_FPZX.LIULIU;
然后啟動(dòng)進(jìn)程即可。
3、源端通過(guò)SCN號(hào)備份問(wèn)題表,傳送到目標(biāo)端還原
備份
exp db_fpzx/fpzx file=/u01/backup/db_fpzx20161129.dmp tables=(liuliu) log=/u01/backup/db_fpzx20161129.log flashback_scn=729295
傳輸
scp db_fpzx20161129.dmp oracle@192.168.25.101:/u01/backup
還原
imp system/oracle file=/u01/backup/db_fpzx20161129.dmp fromuser=db_fpzx touser=db_fpzx tables=liuliu ignore=y
4、修改目標(biāo)端進(jìn)程配置,從SCN開(kāi)始還原
GGSCI (db2) 44> edit params REPFPZX
REPLICAT repfpzx
USERID ogg,PASSWORD ogg
discardfile /u01/goldengate/discard/rep2_discard.dsc, append, megabytes 10
DDL INCLUDE MAPPED
DDLERROR DEFAULT IGNORE RETRYOP
ASSUMETARGETDEFS
map db_fpzx.liuliu, target db_fpzx.liuliu, filter(@GETENV("transaction","csn") >729295);
map db_fpzx.*,target db_fpzx.*;
~
~5、啟動(dòng)OGG,查詢(xún)兩端狀態(tài)
本文題目:OGG單表初始化操作步驟
分享URL:http://jinyejixie.com/article10/iehcgo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站設(shè)計(jì)、用戶(hù)體驗(yàn)、企業(yè)網(wǎng)站制作、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站營(yíng)銷(xiāo)
聲明:本網(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)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)