$export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Nov 27 16:19:03 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select sysdate from dual;
SYSDATE
------------
27-NOV-12
这里LC_ALL没有设置,如果它设置了,上面所有的设置都无效的,系统会读取LC_ALL。
locale -a 查看本地字符集
locale -m 查看所有支持的字符集
在Oracle数据库中查NLS_LANG设置:
代码如下:
SQL> SELECT *
2 FROM DATABASE_PROPERTIES
3 WHERE PROPERTY_NAME IN
4 ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
PROPERTY_NAME PROPERTY_VALUE DESCRIPTION
------------------------------ ------------------------------ --------------------
NLS_LANGUAGE AMERICAN Language
NLS_TERRITORY AMERICA Territory