如何进行OGG中showsynatx测试的分析,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
测试showsynatx: 首先明确 showsynatx是replicat的参数
1、源端和目标分别建表:
源: SENDER@hyyk> create table tb20(id int primary key, name varchar2(20));
目标: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.*;
目标
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、目标插入一行:
insert into tb20 values(1,'a');
commit;
3、源端插入一行(已经配置好复制链路,且加trandata):
insert into tb20 values(1,'a');
commit;
目标进程会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、修改目标参数
edit param rep2
加:
NoBinaryChars
NoDynSQL
ShowSyntax
(OGG12c可以只加ShowSyntax)
然后对abend的进程执行:
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、测试正常的情况
ggsci>alter rep2_s1, begin now
源端:
insert into tb20 values(2,'b');
commit;
目标端
然后:
./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之后 复制进程才会复制
RECEIVER@ogg> select * from tb20;
ID NAME
---------- --------------------
2 b
1 a
(如果不是执行./replicat paramfile dirprm/rep_s1.prm,直接start rep_s1,也可以执行过去,只不过不显示SQL了)
看完上述内容,你们掌握如何进行OGG中showsynatx测试的分析的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!