17
Go to list of users who liked
17
More than 5 years have passed since last update.
OS X で Vagrant な Ubuntu に Oracle XE をインストール
Last updated atPosted at 2014-04-16
環境
- OS X 10.9.2
- Vagrant 1.5.2
- Ubuntu 12.04 64bit (precise64)
- Oracle Database XE 11.2
(参考)ubuntu 13.04(64bit)にoracle-xe-11.2をcuiでインストール
仮想マシンを作成する
$vagrant init hashicorp/precise64$vagrant up
Oracleからパッケージを入手する(要OTNアカウント)
http://www.oracle.com/technetwork/jp/database/database-technologies/express-edition/downloads/index.html
- oracle-xe-11.2.0-1.0.x86_64.rpm.zip
仮想マシンにパッケージをコピーする
$vagrant ssh-config> .vagrant.ssh.config$scp-F .vagrant.ssh.config path/to/oracle-xe-11.2.0-1.0.x86_64.rpm.zip default:
仮想マシンにログインする
$vagrant ssh
$sudoapt-get update$sudoapt-getinstallalien libaio1 unixodbc unzip$unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip$cdDisk1/
rpm形式をdebian形式に変換する
$sudoalien--to-deb--scripts oracle-xe-11.2.0-1.0.x86_64.rpmoracle-xe_11.2.0-2_amd64.deb generated
chkconfigファイルを作成する
$sudovi /sbin/chkconfig
# !/bin/bash# Oracle 11gR2 XE installer chkconfig hack for Debian by Dudefile=/etc/init.d/oracle-xeif [[ ! `tail -n1 $file | grep INIT` ]]; then echo >> $file echo '### BEGIN INIT INFO' >> $file echo '# Provides: OracleXE' >> $file echo '# Required-Start: $remote_fs $syslog' >> $file echo '# Required-Stop: $remote_fs $syslog' >> $file echo '# Default-Start: 2 3 4 5' >> $file echo '# Default-Stop: 0 1 6' >> $file echo '# Short-Description: Oracle 11g Express Edition' >> $file echo '### END INIT INFO' >> $filefiupdate-rc.d oracle-xe defaults 80 01
$sudo chmod755 /sbin/chkconfig$sudo ln-s /usr/bin/awk /bin/awk$sudodpkg--install ./oracle-xe_11.2.0-2_amd64.deb
初期化スクリプトを修正する
sudovi /u01/app/oracle/product/11.2.0/xe/config/scripts/init.orasudovi /u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora
# memory_target=pga_aggregate_target=200540160sga_target=601620480
パスワードは oracle に設定する
sudo /etc/init.d/oracle-xe configure
sqlplusで確認する
$source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh$sqlplus system/oracle
仮想マシンをログアウトして1521ポートをフォワードする
$vi Vagrantfile
config.vm.network :forwarded_port, guest: 1521, host: 1521
$vagrant reload$sqlplus system/oracle@127.0.0.1
ボックスを保存する
$vagrant package$vagrant box add oracle package.box
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme