CentOS へ Oracle10gXE をインストールする手順
CentOS へ Oracle10gXE をインストールするためには、次の手順を踏みます。
Oracle 10g XE のダウンロード
次のサイトから Oracle10gXE の RPM パッケージをダウンロードします。ダウンロードの際には oracle.com のアカウントが必要です。
libaio のインストール
Oracle10gXE をインストールするために必要な libaio を追加インストールします。
# yum install libaio
Oracle 10g XE のインストール
ダウンロードした RPM パッケージから Oracle10gXE をインストールします。
# rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm Preparing... ########################################### [100%] 1:oracle-xe-univ ########################################### [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 を実行します。
# /etc/init.d/oracle-xe configure Oracle Database 10g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 10g 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 <Enter> to accept the defaults. Ctrl-C will abort. Specify the HTTP port that will be used for Oracle Application Express [8080]: Specify a port that will be used for the database listener [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 10g Express Edition to be started on boot (y/n) [y]:
HTTP ポート、リスナーポート、パスワード、 boot 時にoracle XE 起動するかどうかを対話式に設定していきます。
Specify the HTTP port that will be used for Oracle Application Express [8080]: .
Oracle Application Express へのアクセスポートを設定します。デフォルトの 8080 で問題ない場合はそのまま Enter を押します。
Specify a port that will be used for the database listener [1521]: .
データベースのリスナーポートを設定します。デフォルトの 1521 で問題ない場合はそのまま Enter を押します。
initial configuration: Confirm the password:
システム管理者である SYS と SYSTEM のパスワードを設定します。確認のため、2回、同じパスワードを入力します。
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: .
システムのブート時に Oracle を開始するかを設定します。システムのブートとともに開始して問題ない場合は Enter を押します。
インストール時に追加された oracle ユーザに bash 関連ファイル付与
インストール時に追加された oracle ユーザにシェル環境を与えるため、スケルトンの設定ファイルをコピーします。
# su - oracle $ cp /etc/skel/.bash* /usr/lib/oracle/xe/
SQL*Plus をフルパスで呼び出しさないで済む設定を各ユーザアカウントに追加
該当アカウントホームディレクトリに移動後…
$ vi .bash_profile $ vi /usr/lib/oracle/xe/.bash_profile
.bash_profile ファイルに次の行を追記する。
# ファイルの末尾 . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
以上です。
CakePHP 1.2 から Oracle を使う場合はこちらも参照ください。