vagrantでCentOS6.7を入れて試している. (CentOS7はちょっと今回スルーで....)
1. ダウンロード
ここからライセンス同意すればダウンロードできる.
RPMで配布されている.
何気にアカウント登録を求められるのがめんどい...
64bit版しかないけど, 今時32bitもなかろう.
2. インストール
2.1. zipを解凍して中身を確認
とりあえずzipを解凍
[vagrant@localhost ~] unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
Disk1ディレクトリが出来る.
中身はこんな感じ.
[vagrant@localhost ~]$ cd Disk1/ [vagrant@localhost Disk1]$ ls oracle-xe-11.2.0-1.0.x86_64.rpm response upgrade
2.2. 依存パッケージのインストール
一度試すとbcが要るといわれたので入れる.
[vagrant@localhost Disk1]$ sudo yum install bc
2.3. [番外編]vagrantのswapが足りないといわれたので増やす
[vagrant@localhost Disk1]sudo swapon -s [vagrant@localhost Disk1]df [vagrant@localhost Disk1]sudo dd if=/dev/zero of=/swapfile bs=1M count=2500 [vagrant@localhost Disk1]sudo mkswap /swapfile [vagrant@localhost Disk1]sudo swapon /swapfile
2.4. rpmでインストール
[vagrant@localhost Disk1]$ sudo 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.
2.5. configureを実行
[vagrant@localhost ~]$ sudo /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]: #[デフォルトで良いのでEnter] Specify a port that will be used for the database listener [1521]: #[デフォルトで良いのでEnter] 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: #[passwordとか適当に] Confirm the password: #[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...Done Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully.
3. 接続確認
3.1. SQLPlusの設定
下記を実行すれば環境変数はいい感じにしてくれるらしい.
[vagrant@localhost ~]$ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
~/.bashrcに環境変数設定用シェルスクリプトの呼び出しを追加.
[vagrant@localhost ~]$ vi ~/.bashrc
# User specific aliases and functions . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
3.2. SQLPlusで確認
いい感じ.
[vagrant@localhost ~]$ sqlplus system SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 12 03:07:33 2017 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production SQL>