Goldengate实验:源端目标端字符集不同

1、Goldengate版本

Oracle GoldenGate Command Interpreter for Oracle 
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100 
Linux, x64, 64bit (optimized), Oracle 10g on Oct? 4 2011 23:50:20

Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.

?

2、源端oracle版本

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production 
With the Partitioning, OLAP and Data Mining options

字符集:AL32UTF8

?

3、目标端oracle版本

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production 
With the Partitioning, OLAP and Data Mining options

字符集:ZHS16GBK

?

4、实验一:参数文件中NLS_LANG参数都与目标端字符集一致

Goldengate参数文件:

GGSCI (node1) 2> view param ext01

extract ext01 
SETENV (ORACLE_SID=ogg) 
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK) 
userid ogguser, password ogguser 
exttrail dirdat/ex 
table SCOTT.emp;

GGSCI (node1) 3> view param rep01

replicat rep01 
setenv (ORACLE_SID=orcl10g) 
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK) 
userid ogguser, password ogguser 
ASSUMETARGETDEFS 
map scott.emp, target scott.emp ;

?

源端:

update emp set ename='外国人都生活在燃料油载砖厂在被风雨剥蚀了往复博联硅矓阿弥陀佛' where empno=7900;

commit;

select * from emp;



?

目标端:

select * from emp;



结论:抽取进程和复制进程参数文件中的NLS_LANG变量都与目标端的字符集一致,同步发生乱码。



实验二:抽取进程和复制进程NLS_LANG与各自数据库字符集一致

Goldengate参数文件:

GGSCI (node1) 2> view param ext01

extract ext01 
SETENV (ORACLE_SID=ogg) 
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8) 
userid ogguser, password ogguser 
exttrail dirdat/ex 
table SCOTT.emp;

GGSCI (node1) 3> view param rep01

replicat rep01 
setenv (ORACLE_SID=orcl10g) 
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK) 
userid ogguser, password ogguser 
ASSUMETARGETDEFS 
map scott.emp, target scott.emp ;

源端:

update emp set ename='外国人都生活在燃料油载砖厂在被风雨剥蚀了往复博联硅矓阿弥陀佛' where empno=7900;

commit;

select * from emp;



目标端:

select * from emp;



结论:抽取进程和复制进程参数文件中的NLS_LANG变量与各自数据库字符集一致,同步发生乱码。



实验三:抽取进程和复制进程NLS_LANG都与源端数据库字符集一致

Goldengate参数文件:

GGSCI (node1) 2> view param ext01

extract ext01 
SETENV (ORACLE_SID=ogg) 
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8) 
userid ogguser, password ogguser 
exttrail dirdat/ex 
table SCOTT.emp;

GGSCI (node1) 3> view param rep01

replicat rep01 
setenv (ORACLE_SID=orcl10g) 
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8) 
userid ogguser, password ogguser 
ASSUMETARGETDEFS 
map scott.emp, target scott.emp ;

源端:

update emp set ename='外国人都生活在燃料油载砖厂在被风雨剥蚀了往复博联硅矓阿弥陀佛' where empno=7900;

commit;

select * from emp;



目标端:

select * from emp;



结论:抽取进程和复制进程参数文件中的NLS_LANG变量与源端数据库字符集一致,同步正常,不乱码。

?

5、结论

本实验只针对源端字符集为AL32UTF8 与 目标端ZHS16GBK的情况,只有在抽取进程和复制进程参数文件中的NLS_LANG变量与源端数据库字符集一致,才不发生乱码。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/196700/viewspace-773335/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/196700/viewspace-773335/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值