如何進(jìn)行ogg的字符分析

今天就跟大家聊聊有關(guān)如何進(jìn)行ogg的字符分析,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

我們提供的服務(wù)有:成都做網(wǎng)站、成都網(wǎng)站建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、閔行ssl等。為上千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的閔行網(wǎng)站制作公司

我們所熟知oracle的字符集一旦創(chuàng)建完畢后最好不要修改,關(guān)于oracle goldengate的字符集問題還是需要注意的,因?yàn)槿绻繕?biāo)端和源端字符集不一致,而有些字符無法在目標(biāo)端表示ogg可能無法保證數(shù)據(jù)一致性。

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

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

如果這里小魚在源端設(shè)置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.*;

來看看對應(yīng)的extract進(jìn)程的報(bào)告,發(fā)現(xiàn)此時ogg發(fā)覺源端客戶端的NLS_LANG變量和源端數(shù)據(jù)庫字符集不一致,從而選擇源端數(shù)據(jù)庫字符集,并沒有根據(jù)extract進(jìn)程參數(shù)中的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
看來源端設(shè)置NLS_LANG跟oracle database的字符集不一致時,ogg還是會選擇oracle database的字符集,而忽略掉extract的進(jìn)程參數(shù)SETEVN NLS_LANG


接下來測試目標(biāo)端:
這里也指定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.*;


觀察目標(biāo)端的replicat進(jìn)程,發(fā)現(xiàn)ogg選擇了進(jìn)程參數(shù)中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進(jìn)程中正確設(shè)置SETENV NLS_LANG變量,這里源端傳遞的是AL32UTF8字符集,目標(biāo)端通過replicat進(jìn)程參數(shù)SETENV NLS_LANG指定的是ZHS16GBK,而ogg也采用了replicat進(jìn)程的參數(shù),并沒有選擇源端的字符集。
[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報(bào)出的3504警告是為了提醒目標(biāo)端字符集和源端不一致,可能會引起replicat進(jìn)程異常,這里ogg也推薦在replicat進(jìn)程中設(shè)置NLS_LANG使目標(biāo)端和源端一致。


那么對于字符集對ogg的影響就是源端和目標(biāo)端,如果源端和目標(biāo)端database字符集一直,這里在進(jìn)程中直接采用一致的SETENV NLS_LANG都等于缺省的數(shù)據(jù)庫字符集即可,而對于源端和目標(biāo)端字符集不一致的,則需要在目標(biāo)端手動指定replicat進(jìn)程參數(shù)SETENV NLS_LANG等于源端字符集,當(dāng)然對于最后在數(shù)據(jù)庫中數(shù)據(jù)行小魚認(rèn)為還是需要再次轉(zhuǎn)化成目標(biāo)端oracle database的字符集。(ogg也是一個同步復(fù)制產(chǎn)品,其技術(shù)原理依然不能脫離oracle database)

看完上述內(nèi)容,你們對如何進(jìn)行ogg的字符分析有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

當(dāng)前名稱:如何進(jìn)行ogg的字符分析
網(wǎng)址分享:http://muchs.cn/article20/jpiijo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、網(wǎng)站維護(hù)、虛擬主機(jī)企業(yè)網(wǎng)站制作、企業(yè)建站電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)