环境说明如下:
OS:HOST OS: Windows XP SP3 VMware® Workstation 7.0.0 build-203739 GUEST OS :RHEL5U3
DB:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
遇到问题如下:
在虚拟机上成功安装数据库后,主机XP登录EM,发现EM所有按钮都为乱码,于是上网寻找解决办法,解决办法如下:
第一种:
此种方法有3处需要修改的地方:
1.在 $ORACLE_HOME/jdk/jre/lib 路径下
将 font.properties与font.properties.zh_CN.Redhat备份
cp font.properties font.properties.0310.bak
cp font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat.0310.bak
然后 cp font.properties.zh_CN.Redhat font.properties
2.在 $ORACLE_HOME/jre/1.4.2/lib/ 路径下
将 font.properties与font.properties.zh_CN.Redhat备份
cp font.properties font.properties.0310.bak
cp font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat.0310.bak
然后 cp font.properties.zh_CN.Redhat font.properties
3.在 $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs路径下
rm -rf *.gif
4.执行 emctl stop dbconsole
emctl start dbconsole
重启服务器,之后重新登录EM。
可能由于本人RP较低,按网上找到的此种方法操作后,登录控制台发现所有按钮仍然是乱码,于是又上网找其他解决方法,
但发现主要方法大体都与第一种方法类似,于是开始自己思考,发现此种方法纯粹是巧合。
第二种:
1、用如下命令查看font.properties,当然也可以用其他命令了,我开始时用的more命令,发现问题在最后几行所以建议用tail
[oracle@dbserver lib]$ tail font.properties
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0
fontset.default=\
-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1,\
-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf
问题就出在“filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1”行,
准备切换到“/usr/share/fonts/zh_CN/TrueType/”路径查看内容
[oracle@dbserver lib]$ cd /usr/share/fonts/zh_CN/TrueType
-bash: cd: /usr/share/fonts/zh_CN/TrueType: No such file or directory/usr/share/fonts/zh_CN/TrueType
[oracle@dbserver lib]$
提示该文件夹根本就不存在,当然字体文件也不会存在了,由于本人一直在用智能机,常常更换字体,也遇到过乱码问题,于是就想是不是也是
由于字体文件不存在的原因造成的呢!
于是按如下步骤执行:
[oracle@dbserver lib]$ cd /usr/share/fonts
[oracle@dbserver fonts]$ ls
bitmap-fonts bitstream-vera chinese default dejavu-lgc liberation zh_TW
[oracle@dbserver fonts]$ cd chinese/
[oracle@dbserver chinese]$ ls
TrueType misc
[oracle@dbserver chinese]$ cd TrueType/
[oracle@dbserver TrueType]$ ls
fonts.dir fonts.scale ukai.ttf uming.ttf
[oracle@dbserver TrueType]$
发现在chinese文件夹下存在字体文件,于是便修改font.properties文件
[oracle@dbserver lib]$ vi font.properties
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0
fontset.default=\
-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1,\
-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0
#filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/uming.ttf
将原行注释掉,并复制原行,将字体文件路径改为/usr/share/fonts/chinese/TrueType/uming.ttf
此处需要将第一种方法中提到的两个路径下的font.properties文件全部修改。
2.在 $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs路径下
rm -rf *.gif
3.执行 emctl stop dbconsole
emctl start dbconsole
重启服务器,之后重新登录EM。
此时熟悉的中文又出现在了我们的面前。
如大家有其他好的方法,还请共享,谢谢。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20666745/viewspace-629076/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20666745/viewspace-629076/