2015-10-12
1.查看服务器字符集
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
2.查看客户端字符集
[oracle@mdb ~]$ echo $NLS_LANG
AMERICAN_AMERICA.AL32UTF8
或
[oracle@mdb ~]$ env|grep NLS_LANG
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
或
[oracle@mdb ~]$ set|grep NLS_LANG
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
服务端字符集必须和客户端字符集一致
3.修改客户端字符集
[oracle@mdb ~]$ vim /etc/profile
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL NLS_LANG
参考资料
[1] ORACLE字符集基础知识
[2] 设置ORACLE客户端字符集