修改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