What is NLS_LANG Parameter?
It is an environment parameter to specify the local behavior for the oracle software. The formatting of the date, number, time and currency parameter are changes depending on the regions, country. This parameter sets the language and territory used by the application and the oracle database server. NLS_LANG is a local environment variable for the UNIX platforms like Solaris, AIX and Linux. For windows it has to be set in registry or it can be set locally also.
Format of NLS_LANG=<language>_<territory>.<character set> where each part of this parameter controls the operation of a globalization support features.
- Language: It determines the languages used for Oracle messages, day, and month names. For each language there are unique names like AMERICAN, FRENCH, JAPANEESE etc. By default value is AMERICAN
- Territory: it determines the conventions for default date, monetary and numeric formats. As like language each territory has its own names which is derived from the corresponding languages. Example: AMERICA, FRANCE, JAPAN
- Character Set: It specifies the character set used by the client application and it is correlated with the user terminal character set or Operating system character set.
It is important that you have to specify underscore (‘_’) for territory and dot (‘.’) for character set as the preceding character. Otherwise entire string will be considered as the language name.
Below motioned query will give you the valid and oracle recognizable NLS parameter values.
select * from V$NLS_VALID_VALUES;
How to set and see the NLS_LANG in windows?
- Session level setting from command prompt
- Set the variables permanently
Go to Desktop -> My Computer -> Properties -> Advanced System Settings -> Environment variables
For 10g 11g: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<oracle_home_name>
How to set and see the NLS_LANG in Unix Solaris AIX Linux?
To see the current values
$ env|grep NLS
$ echo $NLS_LANG