欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

oracle中文乱码的解决方法

程序员文章站 2022-07-20 14:36:28
解决办法:修改oracle用户的环境变量 文件。加入nls_lang="simplified chinese_china.al32utf8"; export nls_lan...
解决办法:
修改oracle用户的环境变量 文件。加入nls_lang="simplified chinese_china.al32utf8"; export nls_lang
复制代码 代码如下:

[oracle@rhel6r4 ~]$ vi .bash_profile
# .bash_profile
# get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# user specific environment and startup programs
path=$path:$home/bin
export path
# oracle settings
tmp=/tmp; export tmp
tmpdir=$tmp; export tmpdir
oracle_hostname=rhel6r4; export oracle_hostname
oracle_unqname=mydb; export oracle_unqname
oracle_base=/u01/oracle; export oracle_base
oracle_home=$oracle_base/product/11gr2/db; export oracle_home
oracle_sid=mydb; export oracle_sid
path=/usr/sbin:$path; export path
path=$oracle_home/bin:$path; export path
ld_library_path=$oracle_home/lib:/lib:/usr/lib; export ld_library_path
classpath=$oracle_home/jlib:$oracle_home/rdbms/jlib; export classpath
nls_lang="simplified chinese_china.al32utf8"; export nls_lang
[oracle@rhel6r4 ~]$ source .bash_profile

中文可正常显示
复制代码 代码如下:

[oracle@rhel6r4 ~]$  env|grep lang
nls_lang=simplified chinese_china.al32utf8
lang=en_us.utf-8