0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS 7.2 で Oracle Database Express Edition(11.2) インストール時の integer expression expected

Posted at

無料で使えるOracle Database Express Editionを CentOS 7.2にrpmインストールする際、ちょっとしたエラーが出ます。結論から言うと実害はないのですが、原因についてまとめておきます。

インストールバイナリ

Oracle Database Express Edition 11.2(x86_64)は、Oracleの公式サイトからrpmファイルをダウンロード、インストールすることができます。インストールマニュアルではRHEL4,5がインストール要件となっていますが、一応RHEL7でもインストール・動作させることは可能です。

発生事象

必要なパッケージをインストールした上で、Oracle Database Express Editionのrpmファイルをインストールするわけですが、CentOS 7.2のデフォルト設定の場合、「integer expression expected」というエラーが出ます。


/var/tmp/rpm-tmp.djOKcn: line 257: [: 18446744073692774399: integer expression expected
/var/tmp/rpm-tmp.djOKcn: line 271: [: 18446744073692774399: integer expression expected
Executing post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

原因

Oracle Databaseは、インストール時に要件となるカーネルパラメータをチェックしています。このエラーは、チェック処理のうちkernel.shmallとkernel.shmmaxの値をチェックする際のエラーです。

RHEL7.2(CentOS7.2)から、kernel.shmallとkernel.shmmaxのデフォルト値に非常に大きな値が設定されるようになったことに起因しています。以下の通り、bashの数値比較で扱える値を超えてしまっています。


# sysctl -a | grep kernel.shm
kernel.shmall = 18446744073692774399
kernel.shmmax = 18446744073692774399

インストール要件としては、kernel.shmmax=4294967295 kernel.shmall=2097152 よりも大きな値が設定されていること、となっているため、例えばkernel.shmmaxの値をチェックする場合以下のような比較処理になりますが、実際にbashで実行してみると、値が大きすぎてエラーとなることが確認できます。


# [ 4294967295 -gt 18446744073692774399 ]; echo $?
bash: [: 18446744073692774399: integer expression expected
2

bashの比較で扱えるのは2の63乗-1までで、それ以上はエラーになるようですね。


[ 4294967295 -gt 9223372036854775808 ]; echo $? 
bash: [: 9223372036854775808: integer expression expected
2

[ 4294967295 -gt 9223372036854775807 ]; echo $?
1

対処

OSのkernel.shmmaxとkernel.shmallの値を小さくすればエラーは出なくなります。が、あくまでチェック処理でエラーとなっているだけで、Oracleのインストール要件は満たしているため、デフォルト設定のままでも問題ないと思われます。

補足

https://github.com/oracle/docker-images
Oracleが提供しているdocker-imagesを用いて、Oracle Database Express EditionのDockerイメージを作成した際にも同様のエラーがでます。これも、無視して問題ないでしょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?