字符集乱码,如下:
C:\Users\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on 鏄熸湡浜?7鏈?13 11:30:45 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
杩炴帴鍒?
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SIMPLIFIED CHINESE_CHINA.AL32UTF8
检查:
SQL> select tab1.aa||'_'||tab2.bb||'.'||tab3.cc from
2 (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,
3 (select VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,
4 (select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;
TAB1.AA||'_'||TAB2.BB||'.'||TAB3.CC
--------------------------------------------------------------------------------
SIMPLIFIED CHINESE_CHINA.AL32UTF8
将客户端和服务端设置一样,仍然有乱码:
C:\Users\Administrator>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.AL32UTF8
C:\Users\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on 鏄熸湡浜?7鏈?13 13:35:54 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
杩炴帴鍒?
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
错误的设置,看看结果:
set NLS_LANG=CHINESE_CHINA.AL32UTF8
C:\Users\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 13 13:39:14 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12705: Cannot access NLS data files or invalid environment specified
将客户端字符集设置的与服务端不同,如下:
C:\Users\Administrator>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
C:\Users\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 7月 13 14:15:55 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
此时发现没有了乱码,这和我以前认识的内容有出入,比较困惑。