Oracle environment variable NLS_LANG

Source: Internet
Author: User

What is NLS_LANG?

NLS_LANG is an environment variable used to define the language, region, and Character Set attributes. For non-English character sets, the setting of NLS_LANG is very important.

NLS: 'national Language Support (NLS) 'when we set an nls, we actually specify some expressions specific to its Language when Oracle stores data, for example, if we select "chinese", how to store chinese characters, how to sort by rules, and how to represent the currency, the date format will be set.

NLS_LANG format

NLS_LANG = language_territory.charset

For common values, see Oracle Database Client Globalization Support

Setting of NLS_LANG

In Unix, NLS_LANG is an environment variable. In Windows, NLS_LANG is generally set in the registry.

Settings in Unix

  1. Export NLS_LANG = AMERICAN_AMERICA.WE8ISO8859P1

In WindowsHKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEx\NLS_LANG
If there are multiple oracle products, there may be multiple HOMEx products, such as HOME0 and HOME1.. Generally, there is the registration item NLS_LANG.

In Windows, you can also set NLS_LANG to an environment variable. However, this is rarely done, but it is generally set in the registry.

NLS_LANG in DB

DB also has its own NLS_LANG parameter to identify the language, region, and Character Set of the database. You can use the following SQL statements to check,

  1. SELECT*FROMV $ nls_parameters;
  2. OR
  3. SELECTUSERENV ('Language')FROMDUAL;

The client's NLS_LANG and the DB's NLS_LANG

The NLS_LANG of DB should be consistent with the NLS_LANG in the client environment variables as much as possible.

Setting the NLS_LANG Environment Variable for Oracle Databases provides a way to maintain consistency.

So why do we need to be consistent? This is because if the character set does not match, it is possible that the character conversion error may occur during the conversion between DB and Client. For example, the example in Oracle nls_lang tips.


Refer:

NLS_LANG FAQ

Oracle Database Client Globalization Support
Setting the NLS_LANG Environment Variable for Oracle Databases

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.