1. Nls_lang parameter composition
The Nls_lang parameter consists of the following sections:
Nls_lang=<language>_<territory>.<clients characterset>
The meaning of each part of the Nls_lang is as follows:
Language specify:
Language used by-oracle messages
-month and day display in date
Territory specified
-Currency and number formats
-area and the habit of calculating week and date
CHARACTERSET:
-Control the character set used by the client application
Typically set or equal to the client (such as Windows) code page
or set to UTF8 for Unicode applications
To view the code page for the current system on Windows, you can use the CHCP command:
E:\>chcp
Active code page: 936
Code page 936, which is the Chinese character set GBK, at Microsoft's official site, we can get specific coding rules about the 936 code page, please refer to the following links:
Http://www.microsoft.com/globaldev/reference/dbcs/936.htm
2. How to view Nls_lang
Windows use:
Echo%nls_lang%
Such as:
E:\>echo%nls_lang%
American_america. Zhs16gbk
UNIX Uses:
Env|grep Nls_lang
Such as:
/opt/oracle>env|grep Nls_lang
Nls_lang=american_china. Zhs16gbk
Windows client settings, you can change Nls_lang in the registry, where the specific key value is:
Hkey_local_machine\software\oracle\homexx\
XX refers to the system number when multiple oracle_home are present.
3. View the database's current character set parameter settings
SELECT * from V$nls_parameters;
4. View database available character Set parameter settings
SELECT * from V$nls_valid_values;
5. Method of setting up client Nls_lang
Windows:
# Common Chinese Character set
Set Nls_lang=simplified Chinese_china. Zhs16gbk
# Common Unicode character sets
Set Nls_lang=american_america. Al32utf8
Can be permanently set by modifying registry key values
Hkey_local_machine\software\oracle\homexx\nls_lang
Unix:
# Common Unicode character sets
Export Nls_lang=american_america. Al32utf8
# Common Chinese Character set
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 Bash_profile settings take effect
source. bash_profile