vagrant-centos7-oracleの組み合わせで環境構築メモ

 ジュース飲んだりコーヒー飲んだりで時間をつぶしているけれど、この時間もったいないね。
(コンピューターの計算待ち時間なので、仕事をしていないわけではない)
待ちの時間がヒマすぎなうなう。

以下、今日の作業で使った呪文(自分のためのメモ)
「vagrant-centos7-oracleの組み合わせで環境構築」

○前提
Virtualbox 4.3.2 をインストール https://www.virtualbox.org/wiki/Downloads
Vagrant 1.3.5 をインストール http://downloads.vagrantup.com/
Git をインストール http://git-scm.com/downloads

必要に応じて、VagrantとGitにプロキシ設定すること。

○操作
コマンドプロンプトを開き、以下を任意のフォルダでで実行。
以下、コマンドプロンプトでの操作を > で示す。
>git clone https://github.com/ismaild/vagrant-centos-oracle.git

以下必要に応じて。
>vagrant plugin install vagrant-proxyconf

>mkdir centos7gui
>cd centos7gui

GUI入りcentos7のboxを指定してvagrant init
>vagrant init pbarriscale/centos7-gui

Vagrantfile に設定として下記追記(プロキシ周りは必要に応じて)

if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://(あなたのつかえるプロキシサーバ):8080/"
config.proxy.https = "http://(あなたのつかえるプロキシサーバ):8080/"
config.proxy.no_proxy = "localhost,127.0.0.1"
end

require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
if is_windows
config.vm.provision "shell" do |sh|
sh.path = "provisioning/windows.sh"
sh.args = "provisioning/oracle-xe.yml provisioning/inventory"
end
else
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/oracle-xe.yml"
end
end

config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.network "forwarded_port", guest: 1521, host: 1521, auto_correct: true

https://github.com/ismaild/vagrant-centos-oracle.git で取得したoracle、provisioningフォルダをcentos7guiフォルダに置く

>vagrant up --provider virtualbox
>vagrant provision

以下、TeraTarm等で接続して行う。行頭の$はvagrantアカウントで、#はrootアカウントで行う。
$ su -root
vagrant
# cd /etc/yum.repos.d/
# wget https://public-yum.oracle.com/public-yum-ol6.repo --no-check-certificate
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle --no-check-certificate
# yum install oracle-rdbms-server-11gR2-preinstall


yum -y install unixODBC

# yum -y install elfutils-libelf-devel

※以下、「oracle-rdbms-server-11gR2-preinstall」で作られるので作業上は省略する
# vi /etc/sysctl.conf

kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576


※以下、「oracle-rdbms-server-11gR2-preinstall」で作られるので作業上は省略する
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle

※以下、「oracle-rdbms-server-11gR2-preinstall」で作られるので作業上は省略する
vi /etc/security/limits.conf

以下の内容を設定する。

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536


以下を追加する。

session required pam_limits.so


以下を末尾に追加する。

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi


mkdir /u01/app

# chmod 777 /u01/app

あらかじめoracleよりダウンロードしておいた
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
をc:\centos7guiに解凍する。databaseフォルダができているはずである。

解凍したdatabaseフォルダは
$ mv /vagrant/database /u01/app/

/u01/app/
に移す。

ここからはGUI内のコンソールで行う
$ cd /u01/app/database
$ ./runInstaller

オラクルインストーラが起動する。

用途:サーバー
パスワード:orcl
あとはデフォルト。
途中何か聞かれるが、Ignore allで通った。
エラーが何回か出るが、continueを選択。

○参考資料
http://qiita.com/mon_tu/items/772cc46ab6518bf9e73a
http://www.oracle.com/technetwork/jp/database/database-11g/downloads/index.html#11gstand
http://qiita.com/mon_tu/items/772cc46ab6518bf9e73a
http://momijiame.tumblr.com/post/71207485722/vagrant-%E3%81%AE-vm-%E3%81%A7-gui-x11-%E3%81%AE%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86
http://kwski.net/linux/208/
http://qiita.com/naomichi-y/items/d82da991831076599fd4
https://dl.dropboxusercontent.com/u/3318148/vagrant/CentOS-6.4-x86_64-v2.box
https://github.com/ismaild/vagrant-centos-oracle

http://qiita.com/mon_tu/items/772cc46ab6518bf9e73a

この記事が気に入ったらサポートをしてみませんか?