1、服务器确认字符集
select * from v$nls_parameters; #是否为zhs16GBK,zhs16utf8.
2、如不是中文字符集需改:关建点
shutdown immediate;
startup mount;
alter database open;
alter system enable restricted session;
alter database national character set internal_use utf8;
alter database character set internal_use AL32GBK;
shutdown immediate;
startup;
3、客户端显示语言及字符集修改
vim /home/oracle/.bash_profile
export LANG=zh_CN.GBK
export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK #注意引号,分别是语言_地理.字符集
oracle 的sqlplus会去读取OS中环境变量下的nls_lang信息
确认是:select * from v$nls_parameters;
PARAMETER VALUE
------------------------------ ------------------------------
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY CHINA
NLS_CURRENCY ¥
NLS_ISO_CURRENCY CHINA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE SIMPLIFIED CHINESE
NLS_CHARACTERSET ZHS16GBK
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
4、此时在linux还不能显示中文,那得确认一下服务器本身能不能显示中文文件、目录
通过设置LANG=zh_CN.UTF-8 or LANG=zh_CN.GBK等解决. linux用source .bash_profile命令生效.
WIN系列请在系统高级里同样设:NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK,LANG=zh_CN.UTF-8 or LANG=zh_CN.GBK
5、如还碰到sqlplus中文提示信息乱码
请求调整secureCRT或putty的字符集,如由UTF8调来gb2312.