LoginSignup
0
0

More than 3 years have passed since last update.

[Oracle Cloud] JDKのアップデート後に発生するDatabase Control 11gR2の日本語文字化け解消方法

Last updated at Posted at 2021-02-25

まだまだ、現役なOracle データベース 11gR2ですが、2020年12月31日でExtended Support 終了を迎えました。データベースのPSUだけではなく、JDKも最新化しようと思い立ち、My Oracle SupportからJDK7u291(Patch 32162885)をダウンロード & 適用すると**日本語が一部文字化け(□、豆腐化)**します。
####ログイン画面
image.png
####ログイン後
image.png

※この事象は、JDK7u291(Patch 32162885)に限らず、過去のJDK7化のパッチでも発生します。未検証ですが、オンプレの環境でも同様に発生するはずです。

#対処策
####DBCSインスタンスに日本語フォントファイル(ipaフォントファミリーとVLゴシックフォントファミリー)をインストールします。
手順
#####1. yumリポジトリの有効化
マニュアル当該箇所(DBシステムの更新)を参考に、DBCSインスタンスでyumレポジトリを有効化します

大阪リージョンを利用している場合、リポジトリとバージョン・ロック・ファイルのダウンロードは以下のようのなります。
[root@test ~]# wget https://swiftobjectstorage.ap-osaka-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/oci_dbaas_ol7repo -O /tmp/oci_dbaas_ol7repo

[root@test ~]# wget https://swiftobjectstorage.ap-osaka-1.oraclecloud.com/v1/dbaaspatchstore/DBaaSOSPatches/versionlock_ol7.list -O /tmp/versionlock.list

ファイルをダウンロード後、適切な場所にコピーします。
[root@test ~]# cp /tmp/oci_dbaas_ol7repo /etc/yum.repos.d/ol7.repo
[root@test ~]# cp /etc/yum/pluginconf.d/versionlock.list /etc/yum/pluginconf.d/versionlock.list-date +%Y%m%d
[root@test ~]# cp /tmp/versionlock.list /etc/yum/pluginconf.d/versionlock.list

yumが動くようにすることが目的ですので、各種パッケージのupdateは不要です。

#####2.ipaフォントファミリーとVLゴシックフォントファミリーのインストール

[root@test ~]# yum -y install ipafonts
[root@test ~]# yum -y install vl
fonts

フォントはデフォルトで/usr/share/fonts配下にインストールされます。
[root@test fonts]# ls -lrt /usr/share/fonts/
total 24
drwxr-xr-x 2 root root 4096 Jan 18 09:21 dejavu
drwxr-xr-x 2 root root 4096 Jan 18 12:58 vlgothic
drwxr-xr-x 2 root root 4096 Jan 18 13:11 ipa-pmincho
drwxr-xr-x 2 root root 4096 Jan 18 13:11 ipa-gothic
drwxr-xr-x 2 root root 4096 Jan 18 13:11 ipa-mincho
drwxr-xr-x 2 root root 4096 Jan 18 13:11 ipa-pgothic
[root@test fonts]#

#####3.fontconfig toolのインストールとフォントキャッシュのクリーンアップ

[root@test ~]# yum -y install fontconfig
[root@test ~]# fc-cache -fv
[root@test ~]# su - oracle
[oracle@test ~]$ fc-cache -fv

#####4.caboキャッシュのクリーンアップとDatabase Controlの再起動

[oracle@test ~]$ $ORACLE_HOME/bin/emctl stop dbconsole
[oracle@test ~]$ cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/ja
[oracle@test ~]$ rm -rf *.gif *.imx
[oracle@test ~]$ $ORACLE_HOME/bin/emctl start dbconsole
#####5.対処策実施後(※スクリーンショットは対処策実施済の別環境です)
image.png

#原因について
パッチ適用のJDK5では、$ORACLE_HOME/jdk/jre/lib/fonts配下に配置されているAlbany WTフォントというフォントで日本語、中国語、韓国語を表示していました。しかしながら、JDK7化のパッチ適用時、$ORACLE_HOME/jdk ディレクトリそのものが置き換わり、Albany WTフォントファイルが$ORACLE_HOME/jdk/jre/lib/fonts配下から無くなったことが直接的な原因です。

#####パッチ適用前
[oracle@test fonts]$ ls -lrt /u01/app/oracle/product/11.2.0.4/dbhome_1/jdk.ORG/jre/lib/fonts
total 105144
-rwxr-xr-x 1 oracle oinstall 590632 Aug 18 2010 ALBANYWT.ttf
-rwxr-xr-x 1 oracle oinstall 26128384 Aug 18 2010 ALBANWTT.ttf
-rwxr-xr-x 1 oracle oinstall 25949224 Aug 18 2010 ALBANWTS.ttf
-rwxr-xr-x 1 oracle oinstall 26611852 Aug 18 2010 ALBANWTK.ttf
-rwxr-xr-x 1 oracle oinstall 26283116 Aug 18 2010 ALBANWTJ.ttf
-rwxr-xr-x 1 oracle oinstall 4041 Jun 24 2013 fonts.dir
-rwxr-xr-x 1 oracle oinstall 242700 Jun 24 2013 LucidaTypewriterRegular.ttf
-rwxr-xr-x 1 oracle oinstall 234068 Jun 24 2013 LucidaTypewriterBold.ttf
-rwxr-xr-x 1 oracle oinstall 698236 Jun 24 2013 LucidaSansRegular.ttf
-rwxr-xr-x 1 oracle oinstall 317896 Jun 24 2013 LucidaSansDemiBold.ttf
-rwxr-xr-x 1 oracle oinstall 344908 Jun 24 2013 LucidaBrightRegular.ttf
-rwxr-xr-x 1 oracle oinstall 80856 Jun 24 2013 LucidaBrightItalic.ttf
-rwxr-xr-x 1 oracle oinstall 75124 Jun 24 2013 LucidaBrightDemiItalic.ttf
-rwxr-xr-x 1 oracle oinstall 75144 Jun 24 2013 LucidaBrightDemiBold.ttf
[oracle@test fonts]$
#####パッチ適用後
[oracle@test fonts]$ ls -lrt /u01/app/oracle/product/11.2.0.4/dbhome_1/jdk/jre/lib/fonts
total 2044
-rw-r--r-- 1 oracle oinstall 4041 Sep 19 03:14 fonts.dir
-rw-r--r-- 1 oracle oinstall 242700 Sep 19 03:14 LucidaTypewriterRegular.ttf
-rw-r--r-- 1 oracle oinstall 234068 Sep 19 03:14 LucidaTypewriterBold.ttf
-rw-r--r-- 1 oracle oinstall 698236 Sep 19 03:14 LucidaSansRegular.ttf
-rw-r--r-- 1 oracle oinstall 317896 Sep 19 03:14 LucidaSansDemiBold.ttf
-rw-r--r-- 1 oracle oinstall 344908 Sep 19 03:14 LucidaBrightRegular.ttf
-rw-r--r-- 1 oracle oinstall 80856 Sep 19 03:14 LucidaBrightItalic.ttf
-rw-r--r-- 1 oracle oinstall 75124 Sep 19 03:14 LucidaBrightDemiItalic.ttf
-rw-r--r-- 1 oracle oinstall 75144 Sep 19 03:14 LucidaBrightDemiBold.ttf
[oracle@test fonts]$

###参考情報
JDK and PERL Patches for Oracle Database Home and Grid Home (Doc ID 2584628.1)
#おわりに
JDK5の頃は単純に、$ORACLE_HOME/jdk/jre/lib/fonts配下にAlbany WTフォントファイルをリストアすれば復旧できたのですが、JDK7で仕様が変わったようで、JDK5で有効でだった対処策は無効でした。
Linuxのフォントに詳しい人であれば、$ORACLE_HOME/jdk/jre/lib/fonts/fontconfig.properties.srcを適切に編集して復旧することができるかもしれません。しかしながら、バックアップしていなければ、日本語フォントのインストールは必要ですし、JDKのパッチを適用するたびに$ORACLE_HOME/jdkが上書きされるため、サステイナブルな対処策を紹介する目的で本記事を書いてみました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0