In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "the basic principles of the Oracle character set". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn the basic principles of the Oracle character set.
First, three concepts:
1. Oracle database server character set:
Select * from v$nls_parameters where parameter='NLS_CHARACTERSET'
two。 Client operating system character set:
/ etc/sysconfig/i18n Settings
LANG= "zh_CN.GB2312" (specifies the character set of the current operating system)
SUPPORTED= "zh_CN.GB2312" (specifies the character set supported by the current operating system)
SYSFONT= "lat0-sun16" (specifies the font of the current operating system)
3. Client NLS_LANG parameter: this parameter is used to indicate to Oracle the character set of the client operating system.
Second, the basic principles of Oracle character set conversion:
Set the NLS_LANG of the client to the character set of the client operating system
If the database character set is equal to NLS_LANG, no conversion is made when the database and the client transfer characters
If the two are not equal, they need to be converted between different character sets, and can be converted correctly only if the client operating system character set is a subset of the database character set, otherwise garbled will occur.
III. Best practices
Insertion process:
The coding of the word "China" in the client operating system character set ZHS16GBK is "d6magentic d0magee b9magfa". Due to the difference between the NLS_LANG and database character sets, Oracle will convert the character encoding of "China" in the character set ZHS16GBK, that is, to convert the code of "China" in the character set ZHS16GBK into the code of "China" in the character set "AL32UTF8".
Read process:
The code read in the database is "e4recoery b8pjedree9bd". Because the NLS_LANG character set is different from the database character set, the client converts the character code transmitted from the database. The code of "China" in the AL32UTF8 character set on the database side is converted into the code of "China" in the character set ZHS16GBK of the client operating system, which is converted into the code of "China" in the character set ZHS16GBK and displayed normally.
After two conversions, it is indeed the most correct and recommended way. NLS_LANG is only related to the character set of the client operating system. If the character set of the client operating system and the character set of the database cannot be converted correctly, the character set of the client terminal should be changed first, instead of simply setting NLS_LANG to be the same as the character set of the database.
At this point, I believe you have a deeper understanding of the basic principles of the Oracle character set. You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.