网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

如何进行ogg的字符分析

今天就跟大家聊聊有关如何进行ogg的字符分析,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

我们提供的服务有:成都做网站、成都网站建设、成都外贸网站建设、微信公众号开发、网站优化、网站认证、闵行ssl等。为上千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的闵行网站制作公司

我们所熟知oracle的字符集一旦创建完毕后最好不要修改,关于oracle goldengate的字符集问题还是需要注意的,因为如果目标端和源端字符集不一致,而有些字符无法在目标端表示ogg可能无法保证数据一致性。

源库字符集:
SQL> select value from v$nls_parameters where parameter='NLS_CHARACTERSET';

VALUE
----------------------------------------------------------------
AL32UTF8

如果这里小鱼在源端设置SETENV(NLS_LANG=“AMERICAN_AMERICA.ZHS16GBK”)去指定源端客户端的字符集
GGSCI (dg01) 21> view params exiaoyu

extract exiaoyu
SETENV (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
SETENV (ORACLE_SID="xiaoyu")
userid ogg,password ogg
dynamicresolution
gettruncates
report at 2:00
reportrollover at 3:00
warnlongtrans 3h,checkinterval 10m
exttrail ./dirdat/dd
table xiaoyu.*;
table xiaoyugg.*;

来看看对应的extract进程的报告,发现此时ogg发觉源端客户端的NLS_LANG变量和源端数据库字符集不一致,从而选择源端数据库字符集,并没有根据extract进程参数中的SETENV指定。
GGSCI (dg01) 52> view report exiaoyu

** Running with the following parameters **
***********************************************************************

2013-06-04 04:50:27 INFO OGG-03035 Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
extract exiaoyu
SETENV (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
Set environment variable (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
SETENV (ORACLE_SID="xiaoyu")
Set environment variable (ORACLE_SID=xiaoyu)
userid ogg,password ***

2013-06-04 04:50:28 INFO OGG-03500 WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of AL32UTF8.

[oracle@ogg 11.2]$ oggerr 3500
03500, 00000, "WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of {0}"
// *{0}: nls_charset (String)
// *Cause: The NLS_LANG environment variable is not set to the same as the
// database character set. Oracle GoldenGate is using the database
// character set.
// *Action: None
看来源端设置NLS_LANG跟oracle database的字符集不一致时,ogg还是会选择oracle database的字符集,而忽略掉extract的进程参数SETEVN NLS_LANG


接下来测试目标端:
这里也指定SETENV(NLS_LANG=”AMERICAN_AMERICA.ZHS16GBK”)
GGSCI (ogg.single) 15> view params rxiaoyu

replicat rxiaoyu
SETENV (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
SETENV (ORACLE_SID="xiaoyu")
userid ogg,password ogg
assumetargetdefs
gettruncates
report at 2:00
reportrollover at 3:00
discardfile ./dirrpt/discard_rxiaoyu.dsc,append,megabytes 100
map xiaoyu.xiaoyu10,target xiaoyu.xiaoyu10,filter(@getenv("transaction","csn")>1074454806);
map xiaoyu.*,target xiaoyu.*;
map xiaoyugg.*,target ogg.*;


观察目标端的replicat进程,发现ogg选择了进程参数中SETENV(NLS_LANG=“AMERICAN_AMERICA.ZHS16GBK”)
GGSCI (ogg.single) 17> view report rxiaoyu
。。。
2013-06-05 03:14:14 WARNING OGG-03504 NLS_LANG character set ZHS16GBK on the target is different from the source database character set AL32UTF8. Replication may not be valid if the source data has an incompatible character for the target NLS_LANG character set


此时ogg给出的提示需要在replicat进程中正确设置SETENV NLS_LANG变量,这里源端传递的是AL32UTF8字符集,目标端通过replicat进程参数SETENV NLS_LANG指定的是ZHS16GBK,而ogg也采用了replicat进程的参数,并没有选择源端的字符集。
[oracle@ogg 11.2]$ oggerr 3504
03504, 00000, "NLS_LANG character set {0} on the target is different from the source database character set {1}. Replication may not be valid if the source data has an incompatible character for the target NLS_LANG character set."
// *{0}: nls_lang_charset (String)
// *{1}: src_db_charset (String)
// *Cause: The NLS_LANG environment variable on the target is set to a
// different character set than the character set of the source
// database.
// *Action: Set the NLS_LANG environment variable on the target to the
// character set of the source database that is shown in the message.
// You can use the SETENV parameter in the Replicat parameter file to
// set it for the Replicat session.


而ogg报出的3504警告是为了提醒目标端字符集和源端不一致,可能会引起replicat进程异常,这里ogg也推荐在replicat进程中设置NLS_LANG使目标端和源端一致。


那么对于字符集对ogg的影响就是源端和目标端,如果源端和目标端database字符集一直,这里在进程中直接采用一致的SETENV NLS_LANG都等于缺省的数据库字符集即可,而对于源端和目标端字符集不一致的,则需要在目标端手动指定replicat进程参数SETENV NLS_LANG等于源端字符集,当然对于最后在数据库中数据行小鱼认为还是需要再次转化成目标端oracle database的字符集。(ogg也是一个同步复制产品,其技术原理依然不能脱离oracle database)

看完上述内容,你们对如何进行ogg的字符分析有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。


名称栏目:如何进行ogg的字符分析
文章起源:http://bjjierui.cn/article/jpiijo.html

其他资讯