2010年11月3日星期三

RedHat Linux平台下Oracle 10g EM乱码快速解决方法

    操作系统版本:
[root@RedHatAS4U4 /]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
[root@RedHatAS4U4 /]# cat /proc/version
Linux version 2.6.9-42.EL (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 Wed Jul 12 23:16:43 EDT 2006
    Oracle数据库版本:
SQL> select * from V$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
 
1、JDK/JRE中文字符集配置文件如下
[oracle@RedHatAS4U4 zhs]$ ls -l $ORACLE_HOME/jdk/jre/lib/font*zh_CN*
-rwxr-xr-x  1 oracle oinstall 6854 Apr 20  2005 /u01/app/oracle/product/10.2.0/db_1/jdk/jre/lib/font.properties.zh_CN.Redhat
-rwxr-xr-x  1 oracle oinstall 7410 Apr 20  2005 /u01/app/oracle/product/10.2.0/db_1/jdk/jre/lib/font.properties.zh_CN.Redhat2.1
-rwxr-xr-x  1 oracle oinstall 6845 Apr 20  2005 /u01/app/oracle/product/10.2.0/db_1/jdk/jre/lib/font.properties.zh_CN.Sun
-rwxr-xr-x  1 oracle oinstall 7137 Apr 20  2005 /u01/app/oracle/product/10.2.0/db_1/jdk/jre/lib/font.properties.zh_CN_UTF8.Sun
 
[oracle@RedHatAS4U4 zhs]$ ls -l $ORACLE_HOME/jre/1.4.2/lib/font*zh_CN*
-rwxr-xr-x  1 oracle oinstall 6854 Apr  6  2005 /u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/lib/font.properties.zh_CN.Redhat
-rwxr-xr-x  1 oracle oinstall 7410 Apr  6  2005 /u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/lib/font.properties.zh_CN.Redhat2.1
-rwxr-xr-x  1 oracle oinstall 6845 Apr  6  2005 /u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/lib/font.properties.zh_CN.Sun
-rwxr-xr-x  1 oracle oinstall 7137 Apr  6  2005 /u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/lib/font.properties.zh_CN_UTF8.Sun
 
2、只要把合适的中文字符集替换掉缺省字符集即可
[oracle@RedHatAS4U4 zhs]$cp $ORACLE_HOME/jdk/jre/lib/font.properties.zh_CN.Redhat $ORACLE_HOME/jdk/jre/lib/font.properties
[oracle@RedHatAS4U4 zhs]$ cp $ORACLE_HOME/jre/1.4.2/lib/font.properties.zh_CN.Redhat $ORACLE_HOME/jre/1.4.2/lib/font.properties
 
3、清理CACHE
[oracle@RedHatAS4U4 zhs]$ rm $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs/*.gif
 
4、重启EM
[oracle@RedHatAS4U4 zhs]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://RedHatAS4U4:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
 ...  Stopped.
[oracle@RedHatAS4U4 zhs]$ emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://RedHatAS4U4:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ................... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/RedHatAS4U4_asmtestdb/sysman/log
 
现在登陆EM页面,原先的乱码可以正常显示中文了。

没有评论:

发表评论