当前位置: 移动技术网 > 科技>操作系统>Linux > linux操作系统环境变量LANG和NLS_LANG的区别

linux操作系统环境变量LANG和NLS_LANG的区别

2018年11月08日  | 移动技术网科技  | 我要评论

例如:


复制代码
代码如下:

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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网