如何進(jìn)行OGG中showsynatx測(cè)試的分析,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。
10年積累的成都做網(wǎng)站、網(wǎng)站建設(shè)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先制作網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有沈河免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
測(cè)試showsynatx: 首先明確 showsynatx是replicat的參數(shù)
1、源端和目標(biāo)分別建表:
源: SENDER@hyyk> create table tb20(id int primary key, name varchar2(20));
目標(biāo):RECEIVER@ogg> create table tb20(id int primary key, name varchar2(20));
源
GGSCI (pc6) 2> edit params ext_s1
extract ext_s1
setenv (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
setenv (ORACLE_SID="hyyk")
userid ogg,password oracle
gettruncates
exttrail /u01/app/oggs/dirdat/ss
table sender.*;
GGSCI (pc6) 3> edit params pump_s1
extract pump_s1
passthru
userid ogg,password oracle
rmthost 192.168.1.80,mgrport 7809
rmttrail /u01/app/oggd/dirdat/sd
--table sender.tab1;
--table sender.tb10;
table sender.*;
目標(biāo)
GGSCI (ogg-80) 5> edit params rep_s1
replicat rep_s1
setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
setenv(ORACLE_SID='ogg')
userid ogg,password oracle
--handlecollisions
ASSUMETARGETDEFS
--SOURCEDEFS /u01/app/oggd/dirdef/test.def
DISCARDFILE ./dirrpt/rorabb.dsc,PURGE
userid ogg,password oracle
map sender.tb20,target receiver.tb20;
2、目標(biāo)插入一行:
insert into tb20 values(1,'a');
commit;
3、源端插入一行(已經(jīng)配置好復(fù)制鏈路,且加trandata):
insert into tb20 values(1,'a');
commit;
目標(biāo)進(jìn)程會(huì)abend;
GGSCI (ogg-80) 11> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING GGS_REP2 00:00:00 00:00:01
REPLICAT ABENDED REP_S1 00:00:07 00:00:00
可以在discard file中找到信息
[oracle@ogg-80 dirrpt]$ cat rorabb.dsc
Oracle GoldenGate Delivery for Oracle process started, group REP_S1 discard file opened: 2018-03-17 11:37:42.169932
Current time: 2018-03-17 11:44:07
Discarded record from action ABEND on error 1
OCI Error ORA-00001: unique constraint (RECEIVER.SYS_C0011463) violated (status = 1), SQL
Aborting transaction on /u01/app/oggd/dirdat/sd beginning at seqno 32 rba 2557
error at seqno 32 rba 2557
Problem replicating SENDER.TB20 to RECEIVER.TB20
Mapping problem with insert record (target format)...
*
ID = 1
000000: 31 |1 |
NAME = a
000000: 61 |a |
*
Process Abending : 2018-03-17 11:44:07
4、修改目標(biāo)參數(shù)
edit param rep2
加:
NoBinaryChars
NoDynSQL
ShowSyntax
(OGG12c可以只加ShowSyntax)
然后對(duì)abend的進(jìn)程執(zhí)行:
cd ogg
./replicat paramfile dirprm/rep_s1.prm
.......
INSERT INTO "RECEIVER"."TB20" ("ID","NAME") VALUES ('1','a')
Statement length: 60
(S)top display, (K)eep displaying (default)
選擇(K)
5、測(cè)試正常的情況
ggsci>alter rep2_s1, begin now
源端:
insert into tb20 values(2,'b');
commit;
目標(biāo)端
然后:
./replicat paramfile dirprm/rep_s1.prm
選擇(K)
INSERT INTO "RECEIVER"."TB20" ("ID","NAME") VALUES ('2','b')
Statement length: 60
(S)top display, (K)eep displaying (default): k
輸入K之后 復(fù)制進(jìn)程才會(huì)復(fù)制
RECEIVER@ogg> select * from tb20;
ID NAME
---------- --------------------
2 b
1 a
(如果不是執(zhí)行./replicat paramfile dirprm/rep_s1.prm,直接start rep_s1,也可以執(zhí)行過(guò)去,只不過(guò)不顯示SQL了)
看完上述內(nèi)容,你們掌握如何進(jìn)行OGG中showsynatx測(cè)試的分析的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!