Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze the characters of ogg

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about how to carry out ogg character analysis, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Once we are familiar with the character set of oracle, it is best not to modify it. We should pay attention to the character set of oracle goldengate, because if the character set of the target side is inconsistent with that of the source side, and some characters cannot represent ogg on the target side, we may not be able to guarantee data consistency.

Source database character set:

SQL > select value from v$nls_parameters where parameter='NLS_CHARACTERSET'

VALUE

AL32UTF8

If Xiaoyu sets SETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") on the source side to specify the character set of the source side client

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.*

Let's take a look at the report of the corresponding extract process. It is found that ogg finds that the NLS_LANG variable of the source client is inconsistent with the character set of the source database, so it chooses the character set of the source database, which is not specified according to the SETENV in the parameters of the extract process.

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

It seems that when the source setting of NLS_LANG is inconsistent with the character set of oracle database, ogg will still choose the character set of oracle database and ignore the process parameter SETEVN NLS_LANG of extract.

Next, test the target side:

SETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") is also specified here

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.*

Observing the replicat process on the target side, it is found that ogg selects SETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") in the process parameters.

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

At this point, the prompt given by ogg needs to set the SETENV NLS_LANG variable correctly in the replicat process. Here, the source side passes the AL32UTF8 character set, the target side specifies ZHS16GBK through the replicat process parameter SETENV NLS_LANG, and ogg also uses the parameters of the replicat process, and the source character set is not selected.

[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.

The 3504 warning reported by ogg is to remind the destination side of the inconsistency between the character set and the source side, which may cause exceptions in the replicat process. Here, ogg also recommends setting NLS_LANG in the replicat process to make the destination side consistent with the source side.

Then the influence of the character set on the ogg is the source side and the target side. If the source side and target side database character sets have always been, here a consistent SETENV NLS_LANG is equal to the default database character set directly in the process, while if the source side and target side character sets are inconsistent, you need to manually specify that the replicat process parameter SETENV NLS_LANG equals the source side character set on the target side. Of course, for the final data rows in the database, Xiaoyu thinks that it still needs to be converted to the character set of the target side oracle database again. (ogg is also a synchronous replication product, and its technical principle can not be separated from oracle database.)

After reading the above, do you have any further understanding of how to analyze ogg characters? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report