Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

316

积分

0

好友

0

主题
1#
发表于 2012-7-10 20:49:50 | 查看: 8097| 回复: 8
怎么样查询当前session 的 NLS_LANG ?
2#
发表于 2012-7-10 20:55:49
ODM TEST:

[oracle@vrh8 ~]$ export NLS_LANG=american_america.ZHS16GBK
[oracle@vrh8 ~]$ sqlplus / as sysdba

set serveroutput on;
declare
buffer varchar2(300);
begin

sys.dbms_system.get_env('NLS_LANG', buffer);
dbms_output.put_line('NLS_LANG is '|| buffer);
end;
/


NLS_LANG is american_america.ZHS16GBK

PL/SQL procedure successfully completed.

回复 只看该作者 道具 举报

3#
发表于 2012-7-10 21:34:12
好奇怪,在PL/SQL怎么测都是 UTF8。版本 8.0.0.1483   
OCI : instantclient_11_2

回复 只看该作者 道具 举报

4#
发表于 2012-7-10 22:13:46
select userenv('language') from dual;

回复 只看该作者 道具 举报

5#
发表于 2012-7-10 22:14:28
select * from nls_session_parameters

回复 只看该作者 道具 举报

6#
发表于 2012-7-10 22:23:45
4楼5楼都是扯淡啊~

回复 只看该作者 道具 举报

7#
发表于 2012-7-11 00:15:44
太神了~~太扯了??

用ML的代码,经过多次测试,PL/SQL Developer 的取值居然是服务器端启动数据库时的 NLS_LANG,这是怎么做到的?

回复 只看该作者 道具 举报

8#
发表于 2012-7-11 00:28:38
@凉面

http://www.allroundautomations.com/update/update001.html

To enable Unicode you need to have a database that is created with an UTF-8 or UTF-16 database character set or national character set (for NVARCHAR2, NCHAR, NCLOB and so on). The SQL Window, Report Window and Test Window will automatically detect the Unicode data, and will display the data as such. The Large Data Editor of the SQL Window will also automatically display Unicode data correctly. The client-side character set of the NLS_LANG key (Language_Territory.Charset) does not need to be a Unicode character set.

回复 只看该作者 道具 举报

9#
发表于 2012-7-11 00:34:27
@凉面

http://repettas.wordpress.com/20 ... r-set-implications/

Configuring Your Client To Be a Unicode Client on UNIX:

To hae a Unix Unicode client you need to configure your Unix environment first to use UTF8, then you have to check your telnet software to be able to use Unicode and then (as the last step) you can set the NLS_LANG environment variable equal to AMERICAN_AMERICA.AL32UTF8 and start SQL*Plus.

Configuring Your Client To Be a Unicode Client on Windows:

On Windows you cannot use sqlplusw.exe or sqlplus.exe as a Unicode / UTF8 client. Using sqlplusw.exe with NLS_LANG set to AL32UTF8 is totally incorrect. There are 2 Oracle provided Unicode clients you can use on Windows: iSQL*Plus and Oracle SQL Developer. If you want to use / write a Unicode application on Windows then the application should be specifically written to use the Windows Unicode API, setting NLS_LANG to AMERICAN_AMERICA.AL32UTF8 is not enough. You should consult the application vendor or the vendor of the development environment to see how to properly code in Unicode.

The popular tool TOAD is NOT able to run against (AL32)UTF8 databases. Toad does not support databases with a Unicode character set such as UTF8 or AL16UTF16. The International version of Toad is the only version of Toad that does support (AL32)UTF8.

All Oracle 9i and up clients are compatible with a AL32UTF8 database, even if they use a non-AL32UTF8 NLS_LANG setting:

Note: You can use sqlplusw.exe on a Western European / US Windows Client (using a NLS_LANG set to AMERICAN_AMERICA.WE8MSWIN1252, which is the correct value for a Western European US Windows system to connect to a AL32UTF8 database. However, the SQL*Plus client will only be able to insert / view Western European characters. If another user using SQL*Plus on a correctly configured Chinese Windows System inserts data then this will not be visible in the Western European SQL*Plus client. If you try to update Chinese data using the Western European client this will also fail.

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-16 01:38 , Processed in 0.051299 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569