栏目导航: 首页 > 数据库类 > Oracle数据库 > 内容

Oracle客户端出现乱码的解决办法

www.hx99.net    时间: 2014-09-27    阅读: 次     整理: 华西安全网

 修改Oracle客户端字符集方法:

1:可以通过修改注册表键值永久设置,类似于这样的键值:
HKEY_LOCAL_MACHINE/SOFTWARE/Oracle/HOME0下,
如一般的简体中文
nls_lang=SIMPLIFIED CHINESE_CHINA.ZHS16GBK

 

2:查看数据库当前字符集参数设置

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK

 

3:打开CMD窗口,乱码情况

C:/Documents and Settings/Administrator>set NLS_LANG=american_america.AL32UTF8

C:/Documents and Settings/Administrator>sqlplus

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 4月 10 10:59:53 2010

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

请输入用户名:  scott
请输入口令:

连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> select empno,ename,sal from emp where empno=7779;

     EMPNO ENAME                                 SAL
---------- ------------------------------ ----------
      7779 鏉ㄥ钩                                 6080

 

 

4:打开另外个CMD窗口,正常情况

C:/Documents and Settings/Administrator>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK

C:/Documents and Settings/Administrator>sqlplus

SQL> select empno,ename,sal from emp where empno=7779;

     EMPNO ENAME             SAL
---------- ---------- ----------
      7779 杨平             6080

本文来源:华西安全网[http://www.hx99.net]
发表评论】【告诉QQ好友】【错误报告】【加入收藏】【关闭