We know that,Oracle clientYou can useNLS_LANG ParameterThe setting of the NLS_LANG parameter varies on different system platforms. This article first introduces the composition of the NLS_LANG parameter, and then introduces the settings of the NLS_LANG parameter of the Oracle client on Windows and Unix platforms. Now we will introduce this part.
1. Composition of the NLS_LANG Parameter
The NLS_LANG parameter consists of the following parts: NLS_LANG = <Language >_< Territory>. <Clients Characterset>. The local meanings of NLS_LANG are as follows:
LANGUAGE:
- Oracle message language
- Revealing the month and day in a date
TERRITORY:
- Currency and digital Style
- Region and computing week-date adaptation
CHARACTERSET: the character set used by the client.
View the current system code page on Windows. The chcp call is E:/> chcp. The code page of the action is 936. The code page 936 is even the Chinese Character Set GBK.
2. Check the measures of NLS_LANG.
Windows uses echo % NLS_LANG %, for example:
- E:/>echo %NLS_LANG%
-
- AMERICAN_AMERICA.ZHS16GBK
Unix uses env | grep NLS_LANG, for example:
- /Opt/oracle> Amazon e-paper book env | grep NLS_LANG
-
- NLS_LANG = AMERICAN_CHINA.ZHS16GBK
In Windows client settings, you can modify NLS_LANG in the registration form. The detailed key value is HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOMExx/. xx indicates the system number when multiple ORACLE_HOME exists.
3. view the current character set parameter settings of the database
- SELECT * FROM v$nls_parameters;
Or
- select * from nls_database_parameters
Or
- select userenv(‘language’) from dual;
4. view available Character Set parameter settings in the database
- SELECT * FROM v$nls_valid_values;
5. setting measures for the client NLS_LANG
Windows:
- # Common Chinese character sets
-
- Set NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK
-
- # Common unicode character sets
-
- Set NLS_LANG = american_america.AL32UTF8
You can always set the key value of the traversal correction Registration Form: HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOMExx/NLS_LANG.
Unix:
- # Common unicode character sets
-
- Export NLS_LANG = american_america.AL32UTF8
-
- # Common Chinese character sets
-
- Export NLS_LANG = "Simplified Chinese_china". ZHS16GBK
You can edit the bash_profile file for permanent settings:
- Vi. bash_profile
-
- NLS_LANG = "Simplified Chinese_china". ZHS16GBK export NLS_LANG
-
- # Make the bash_profile settings take effect
-
- Source. bash_profile
This article describes how to set the NLS_LANG parameter of the Oracle client.