NLS_LANG参数由以下部分组成:NLS_LANG=<Language>_<Territory>.<Clients Characterset>
export nls_lang=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
export nls_lang=AMERICAN_AMERICA.ZHS16GBK 与select userenv('language') FROM DUAL; 保持一致。
[handtest@tj-zsdt-test ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 24 11:52:42 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
SQL> select * from Chineset;
NAME
--------------
???????
???????
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[handtest@tj-zsdt-test ~]$ echo $NLS_LANG
[handtest@tj-zsdt-test ~]$ echo $NLS
[handtest@tj-zsdt-test ~]$ echo $LANG
en_US.UTF-8
[handtest@tj-zsdt-test ~]$
[handtest@tj-zsdt-test ~]$ export NLS_LANG=AMERICAN_AMERICA.UTF8
[handtest@tj-zsdt-test ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 24 11:53:34 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from Chineset;
NAME
------------------------------------------
中华人民共和国
中华人民共和国
SQL> INSERT INTO Chineset VALUES('中华人民共和国');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from Chineset;
NAME
------------------------------------------
中华人民共和国
中华人民共和国
中华人民共和国
SQL>
SQL> host echo $NLS_LANG
AMERICAN_AMERICA.UTF8
SQL> host echo $LANG
en_US.UTF-8
SQL>
[handtest@tj-zsdt-test ~]$ export nls_lang=AMERICAN_AMERICA.ZHS16GBK
[handtest@tj-zsdt-test ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 24 12:11:37 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from Chineset;
NAME
------------------------------------------
中华人民共和国
中华人民共和国
中华人民共和国
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
[handtest@tj-zsdt-test ~]$ export nls_lang=AMERICAN_AMERICA.ZHS16GBK
[handtest@tj-zsdt-test ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 24 12:15:40 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> INSERT INTO Chineset VALUES('中华人民共和国');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from Chineset;
NAME
------------------------------------------
中华人民共和国
中华人民共和国
中华人民共和国
中华人民共和国
SQL>