オラクルが、正規ライセンス購入前の勉強目的で試しにソフトウェアを利用することのできるライセンス『OTN(Oracle Technology Network)開発者ライセンス』を提供していることを今更ながら知りました:
自分用Oracle DBを「無償で」作ろう!「OTN開発者ライセンス」

※同じく無料版である IBM Db2 Express-C みたいな位置付け?と思っていたのですが、ちと違いそう。Express-C は機能としては Express Edition に近いのですが、開発者エディションというわけではありません。「サポートなしで本番利用可」なのが IBM Db2 Express-C であり、この辺りが違いと言えそうです。

※むしろ IBM Db2 Developer Community Edition の位置付けが近い感じ。


利用するには Oracle アカウントの登録が必要ですが、登録自体は無料でした。各種オラクル製品がダウンロード可能で、オラクルDBはもちろん、Java や MySQL などの製品版も対象に含まれていました。利用目的は制限されていますが、仕様、検証、開発、テストに使うことはできるとのこと。早速使ってみました。なんと 20年以上ぶりにオラクル DB をインストールしてみた顛末です(笑)。


まずは OTN ページにアクセスして "Sign In" します:
2017072101


自分の OTN ID とパスワードを指定して「サインイン」します:
2017072102


サインイン後、"Software Downloads" をクリックしてダウンロードページに移動します:
20170721025


ダウンロードページをスクロールすると、ダウンロード対象の製品一覧が見つかります。オラクルDBも新しいエディションである 12c の Enterprise/Standard Edition 含めてダウンロードできますが、自分は比較的軽量な方がいいので 11g の Express Edition を選択しました:
2017072103


オラクルDB Express 11g2 のダウンロードページです。License Agreement にチェックを入れます:
2017072104


そして対象プラットフォーム(下図は Linux x64 を選択。他に Windows 32/64 bit 版を選択可)を選ぶとダウンロードが開始されます:
2017072105


ダウンロードできれば後はインストールするだけですが、Linux 版のオラクルDB Express 11g2 の場合、インストールするにはメモリが 2GB 必要です(足りないとインストーラーが止まります)。充分なスワップメモリが確保されていない環境の場合は動的にスワップファイルを増やす必要があります。その方法や手順は以下を参照ください:
Linux の SWAP 領域を増やす


改めて Linux 版の場合は zip された rpm ファイルがダウンロードされます。なので 64bit Linux 上でダウンロードしたファイルを unzip し、Disk1 フォルダ以下にある rpm ファイルを指定してインストールします:
# unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
# cd Disk1
# rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
準備中...                ########################################### [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.


「root で /etc/init.d/oracle-xe configure を実行しろ」というメッセージが表示されているので、このコマンドを実行して初期セットアップを実行します。セットアップ時の選択肢は全てデフォルトのままで、明示的に指定したのはパスワード(と確認パスワード)だけです:
# /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 <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 11g Express Edition to be started on boot (y/n) [y]:

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


これでセットアップ完了、、のはず、ですが、この後の作業を便利に行うための追加作業をしておきます。オラクル DB をコマンドラインから操作する場合に便利な環境変数が /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh(および /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.csh)コマンドによって設定されます。なので、/etc/bashrc などに以下の1行を追加して、対象ユーザーがログインする際にこの環境変数設定が行われるようにしておきます:
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

改めてログインし直して(この環境変数設定を有効にして)、SQL*Plus を実行し、system DB に対して SQL を実行してみます:
# sqlplus system

SQL*Plus: Release 11.2.0.2.0 Production on 土 7月 22 01:54:50 2017

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

パスワードを入力してください:


Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
に接続されました。
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQL>

動きましたー! 懐かしい(Solaris の前の)SunOS 以来のオラクル DB インストール体験でした。いやあ、再びオラクルをインストールする日が来るとは・・・