久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

如何進行ogg的字符分析

174次閱讀
沒有評論

共計 3707 個字符,預計需要花費 10 分鐘才能閱讀完成。

今天就跟大家聊聊有關如何進行 ogg 的字符分析,可能很多人都不太了解,為了讓大家更加了解,丸趣 TV 小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。

我們所熟知 oracle 的字符集一旦創(chuàng)建完畢后最好不要修改,關于 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 進程的報告,發(fā)現(xiàn)此時 ogg 發(fā)覺源端客戶端的 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 進程,發(fā)現(xiàn) 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 的字符分析有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注丸趣 TV 行業(yè)資訊頻道,感謝大家的支持。

正文完
 
丸趣
版權聲明:本站原創(chuàng)文章,由 丸趣 2023-07-18發(fā)表,共計3707字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發(fā)布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 葫芦岛市| 无为县| 山西省| 连南| 彰化县| 搜索| 建水县| 龙川县| 漾濞| 迁安市| 景洪市| 丰台区| 渑池县| 凉城县| 城固县| 同江市| 大城县| 禹城市| 城市| 怀宁县| 贵州省| 天镇县| 阿图什市| 杨浦区| 永福县| 治多县| 乌鲁木齐县| 石城县| 盐边县| 澄迈县| 仁寿县| 且末县| 云龙县| 麟游县| 靖远县| 施秉县| 鸡西市| 敦化市| 黄陵县| 朝阳县| 绥德县|