linux操作系统环境变量LANG和NLS_LANG的区别
例如:
export lang=zh_cn.gb2312
export nls_lang=american_america.zhs16gbk
$export lang=zh_cn.gb2312
$date
2012年 11月 27日 星期二 16:20:35 cst
显示是中文界面。
$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
显示的是英文环境,但只对oracle程序生效。
linux系统中关于环境变量的lang设置主要有下列项目:
[root@blliu tmp]# locale
lang=zh_cn.gb2312
lc_ctype="zh_cn.gb2312"
lc_numeric="zh_cn.gb2312"
lc_time="zh_cn.gb2312"
lc_collate="zh_cn.gb2312"
lc_monetary="zh_cn.gb2312"
lc_messages="zh_cn.gb2312"
lc_paper="zh_cn.gb2312"
lc_name="zh_cn.gb2312"
lc_address="zh_cn.gb2312"
lc_telephone="zh_cn.gb2312"
lc_measurement="zh_cn.gb2312"
lc_identification="zh_cn.gb2312"
lc_all=
这里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
如对本文有疑问,
点击进行留言回复!!
网友评论