もりねずみーのやつ

インターネット上でしか生きられません

ArchLinuxにOracle Database 11gR2 Express Editionをインストール

どうも、もりねずみーです。 1ヶ月ほどハードボイルドな街に放り込まれ、銃弾や車の突進を避けつつなんとか生きて帰りました。

ちょっとお仕事でOracleを触る機会があったので、誰得感満載ではあるけど、Arch Linuxに入れてみようかと。

Oracleは11gR2のExpressEdition(以降XE)で、無償評価的な位置付けのもの。

インストール

インストール方法は毎度おなじみ、便利なAUR。

ただ、残念なことに、この記事を書いている時点のAURパッケージは、ソースダウンロード元のリンクが切れているっぽいので、少し手を加えてやればうまくPacmanでインストールできる。

まず、AURからoracle-xeをダウンロード。

次に、Oracle Technorogy NetworkからLinux向けOracleXEをダウンロードし、 そのZIPファイルをDropboxかどっかに置いておく。

PKGBUILDのsource=()の部分にOracleXEのダウンロード先のURLが書いてあるので、そこにさっきのDropbox等のダウンロードURLに書き換える。

で、

$ makepkg -s
$ sudo packman -U oracle-xe-11.2.0_1.0-2-x86_64.pkg.tar.xz

初期設定/起動

インストールが終わったら、以下のコマンドで立ち上げてみよう。

$ sudo usermod -G dba morinezumiiii
$ sudo /etc/rc.d/oracle-xe configure

You must be root user to run the configure script.  Login as root user and 
then run the configure script.
[morinezumiiii@morinezumiiii-arch oracle-xe]$ sudo /etc/rc.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 <Enter> to accept the defaults. 
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:(APEXのポート番号)

Specify a port that will be used for the database listener [1521]:(TNSリスナーのポート番号)

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:(SYSパスワード)
Confirm the password:(SYSパスワード)

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:(ブート時にOracleを起動させるかどうか)

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

これで立ち上がったはずなので、Oracle SQL DeveloperやSQL*Plusなどで確認してみましょう。

接続

SQL*Plusの場合

conn sys as sysdba

起動と停止

$ sudo /etc/rc.d/oracle-xe start
$ sudo /etc/rc.d/oracle-xe stop

おわりに

今更Oracleとかホント誰得な記事でした。ありがとうございました。