NLS_LANG与NLS_LANGUAGE的区别
来源:互联网 发布:javascript 等待 编辑:程序博客网 时间:2024/05/15 23:52
1. 主要区别:
NLS_LANG是环境变量,包括3部分NLS参数:NLS_LANGUAGE, NLS_TERRITORY, NLS_CHARACTERSET,需要在启动SQLPLUS等工具之前设置;
NLS_LANGUAGE主要控制SESSION中提示消息的语言,可以使用ALTER SESSION在SQLPLUS里面设置;
NLS_TERRITORY主要控制SESSION中的日期和货币等本地化参数的现实格式,也可以像NLS_LANGUAGE一样在 SESSION 里面设置;
NLS_CHARACTERSET控制客户端的字符集,不能在SESSION里面进行设置,只能通过NLS_LANG环境变量的方式进行设置。
2. 设置方法:
2.1 环境变量设置(windows),下划线必须和territory配对,点必须和字符集配对
set nls_lang=american_america.utf8
set nls_lang=american / set nls_lang=american_ / set nls_lang=american_.
set nls_lang=_america
set nls_lang=.utf8
2.2 SESSION设置
alter session set nls_language='american' nls_territory='america';
alter session set nls_language='american';
alter session set nls_territory='america';
3. 注意事项:
NLS_CHARACTERSET设置不当会导致数据不能正常显示:
C:\>set nls_lang环境变量 nls_lang 没有定义C:\>sqlplus system/oracle@ora1SQL*Plus: Release 11.2.0.1.0 Production on 星期六 5月 12 14:27:23 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.连接到:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select * from v$nls_parameters where parameter in 2 ( 'NLS_LANGUAGE','NLS_TERRITORY','NLS_CHARACTERSET');PARAMETER VALUE-------------------- --------------------NLS_LANGUAGE SIMPLIFIED CHINESENLS_TERRITORY CHINANLS_CHARACTERSET AL32UTF8SQL> create table t(id number,name varchar2(20));表已创建。SQL> insert into t values(1,'测试');已创建 1 行。SQL> commit;提交完成。SQL> select * from t; ID NAME---------- ---------------------------------------- 1 测试SQL> exit从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options 断开C:\>set nls_lang=.WE8ISO8859P1C:\>sqlplus system/oracle@ora1SQL*Plus: Release 11.2.0.1.0 Production on Sat May 12 14:29:27 2012Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select * from t; ID NAME---------- -------------------- 1 靠SQL>
REF:
1. Setting Up a Globalization Support Environment
http://docs.oracle.com/cd/E11882_01/server.112/e10729/ch3globenv.htm#NLSPG189
- NLS_LANG与NLS_LANGUAGE的区别
- NLS_LANG与NLS_LANGUAGE的区别
- NLS_LANG与NLS_LANGUAGE的区别
- LINUX+ORACLE 字符集 语言 相关区别:LANG NLS_LANG NLS_LANGUAGE characterset
- LINUX+ORACLE 字符集 语言 相关区别:LANG NLS_LANG NLS_LANGUAGE characterset
- nls_lang、nls_language、nls_char…
- LANG和NLS_LANG的区别
- LANG和NLS_LANG的区别
- oracle的字符集(NLS_LANGUAGE)
- oracle的字符集(NLS_LANGUAGE)
- oracle的字符集(NLS_LANGUAGE)
- LANG与NLS_LANG
- NLS_LANG的问题
- 查看 NLS_LANG 的方法
- 坑爹的NLS_LANG
- 查看NLS_LANG的方法
- nls_lang
- nls_lang
- CSS鼠标手势
- oracle中的connect,resource 权限讲解
- 杭电hdu 4217 Data Structure? 线段树
- Visual Studio 项目目录下的bin目录和 obj目录
- wsdl2java:参数解释
- NLS_LANG与NLS_LANGUAGE的区别
- C++中三角函数
- android仿QQ列表的效果实现
- EditText 自动弹出软键盘接收输入问题
- 让Visual Studio 自动添加头部注释信息
- MogileFS启动流程,源码分析
- 飞鸽传书软件很多人都会认为他已经做到了
- C#中的string 和 StringBuider
- 插入排序 二分插入排序 学习