VagrantにOracleXEを入れた

つまづいたところ。

  • swapが足りなかった。
  • /etc/hostsに(ゲストOSの)ローカルホスト名を設定する必要があった。

実施手順

インストールマニュアル
Oracle® Database Express Editionインストレーション・ガイド

ダウンロードリンク
Oracle Database Express Edition (XE) Downloads

swapが2GB以上ないとインストーラがエラーになるのでswapを増やした。

インストーラ実行

# rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing... ########################################### [100%]
1:oracle-xe ########################################### [100%]
Executing post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

# /etc/init.d/oracle-xe configure

Oracle Database 11g Express Edition Configuration

                                                                                                • -

This will configure on-boot properties of Oracle Database 11g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8780

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:n

Starting Oracle Net Listener...Done
Configuring database...
Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

8780に設定。
1521に設定(デフォルト)。
システムのパスワードは各自で。
boot時の自動起動はOFF。

で、Configuration失敗…。

ログを見るとOracleが動いていないっぽい???

# /etc/init.d/oracle-xe configure

Oracle Database 11g Express Edition Configuration

                                                                                                • -

This will configure on-boot properties of Oracle Database 11g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8780

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done
Configuring database...
Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

やっぱりダメ。

これかなあ。
3.15. Troubleshooting
3.3. Minimum Hardware and Software Requirements

インストール要件
Oracle® Database Express Editionインストレーション・ガイド
をよく見ると、この仮想マシンは色々ライブラリが入っていないのでは?

# yum install glibc
# yum install make
# yum install binutils
# yum install gcc
# yum install libaio

幾つかアップデータされた。
でもインストール失敗。

ここで分かりやすいページを発見。
Linux(CentOS) 64bit版へOracle XE(Express Edition)をインストール | 俺の開発研究所
cloneDBCreation.logに出力されているホスト名が/etc/hostsに無いとダメらしい。
これもXEの事前条件に書いておいてほしい…

# vi /etc/hosts
# /etc/init.d/oracle-xe configure

Oracle Database 11g Express Edition Configuration

                                                                                                • -

This will configure on-boot properties of Oracle Database 11g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8780

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:n

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

ようやく成功。

環境設定シェルが用意されているらしい。.bash_profileに書く。

$vi .bash_profile

書く内容。

# Oracle Environment
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

$ . .bash_profile

Oracle Database 11g Express Editionのスタート・ガイド」ホームページを外部から見えるようにする。
勉強用だからセキュリティは気にしない。

$ sqlplus system
Enter password: SYSTEM_password
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);