Client Character Set, oracle client Character Set

Source: Internet
Author: User

Client Character Set, oracle client Character Set
This part is supported by oracle globalization. For more information, see the documentation.
First, let's talk about the database character set. When we use dbca to create a database, we will let you choose the database character set. The default setting is based on the operating system's language settings:
[Oracle @ localhost ~] $ Echo $ LANG;
Zh_CN.UTF-8

SQL> select userenv ('language') from dual
2;
USERENV ('language ')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.AL32UTF8
The database character set can also be seen from the alert logs started by oracle:
Database Characterset is AL32UTF8
See the view nls_database_parameters.
Of course, we can modify the database character set (with restrictions. Not recommended ):
The database character set can be modified only when the new character set is the superset of the current character set. For example, UTF8 is the superset of US7ASCII. to modify the database character set, you can use alter database character set UTF8.

Client Character Set Environment
Select * from nls_instance_parameters
It is derived from v $ parameter, which indicates the character set setting of the client, which may be a parameter file, environment variable, or registry.
 
Session Character Set Environment
Select * from nls_session_parameters
The source is v $ nls_parameters, which indicates the session's own settings. It may be the session's environment variable or the alter session is complete. The Character Set set in the session is valid only in this session. After the session ends, it becomes invalid. If the session has no special settings, it will be consistent with nls_instance_parameters.
 
The character set of the client must be the same as that of the server to correctly display non-Ascii characters of the database. If multiple settings exist, NLS takes precedence over the settings: character setting function> alter session> environment variable or registry> parameter file> default database Parameters
The character set must be consistent, but the language settings can be different. We recommend that you use English for language settings. If the character set is zhs16gbk, The nls_lang can be American_America.zhs16gbk.

The following describes the client Character Set settings:
In linux:
[Oracle @ localhost ~] $ Export LANG = zh_CN.UTF-8
Windows:
Registry:
Regedit => HKEY_LOCAL_MACHINE => SOFTWARE => ORACLE-HOME
NLS_LANG: SIMPLIFIED CHINESE_CHINA.ZHS16GBK
NLS_LANG can be divided into three parts:
Language: language SIMPLIFIED CHINESE
Territory: Region CHINA
Character set: character set ZHS16GBK

NLS_LANG = <language >_< territory>. <client character set>
The impact of each parameter:
Language: displays the oracle message, validation, and date name.
Territory: Specifies the default date, number, currency, and other formats
Client character set: Specifies the character set that the Client will use
Select * from v $ nls_valid_values is very useful. You can find that oracle supports all the preceding three parameters.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.