Oracle Database 10g Express Edition On Fedora 13

最小構成のFedora 13にOracle 10g XEのインストール方法。

まずoracle-xe-univ-10.2.0.1-1.0.i386.rpmをダウンロードする。米オラクルのアカウント登録が必要。
wgetだと取得できないのでCUIマシンならftp等で転送する。
http://www.oracle.com/technetwork/database/express-edition/downloads/index.html


インストールに必要なパッケージを入れる。
# yum -y install libaio.i686
# yum -y install bc

oracle 10 xeのインストール
# rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm

セットアップ
# /etc/rc.d/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 to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:(web管理画面のポート番号デフォルトは[8080])

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:(オラクルのsystemユーザーのパスワード)
Confirm the password:(確認でもう一回入力)

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:(OS起動時にオラクルを起動させるか)

Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:設定したweb管理画面のポート番号/apex"

使用するFedoraユーザーの.bash_profileに追記
# su YourUser
$ vi ~/.bash_profile
. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

反映させる
$ source ~/.bash_profile
$ sudo /etc/rc.d/init.d/oracle-xe restart
Shutting down Oracle Database 10g Express Edition Instance.
Stopping Oracle Net Listener.

Starting Oracle Net Listener.
Starting Oracle Database 10g Express Edition Instance.

ちょいと設定
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);を設定することで、127.0.0.1以外からのアクセスを許可する。
$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on 木 12月 2 00:40:50 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

ユーザー名を入力してください: system
パスワードを入力してください: (パスワード)


Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
に接続されました。
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

PL/SQLプロシージャが正常に完了しました。

SQL> exit
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productionとの接続が切断されました。

これでhttp://127.0.0.1:設定したweb管理画面のポート番号/apexにアクセス。
(外部からならマシンのIPに変更してくださいね)

あとはweb上でUser追加するなり、データベース作ったり、とお好みに!
sqlplusコマンドが見つからない場合は.bash_profileの記述間違いです。(恥ずかしながら私はxeをexと打ち込んで散々ハマりました。)
どうしてもできない場合は、


$ . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
と打ち込んだ後にsqlplusコマンドを再トライしてみてください。