Vagrant+CentOS 6の環境にOracle Database 12c Release 1をインストールした時のメモの後編です。
前編はコチラです!
環境
Oracle Database 12c Release 1 (12.1.0.2)
CentOS 6.8 (ゲストOS)
Vagrant 1.9.5
VirtualBox 5.1.22 r115126 (Qt5.6.2)
XQuartz 2.7.11 (xorg-server 1.18.4)
macOS Sierra 10.12.5
手順
前編の続きです。
unzipパッケージをインストールする
Oracle Databaseのzipファイルを解凍するために、unzipパッケージをインストールします。
1 |
[root@localhost ~]# yum install unzip |
インストールの作業用ディレクトリを作成する
インストールの作業用ディレクトリを作成します。
1 2 |
[root@localhost ~]# su - oracle [oracle@localhost ~]$ mkdir tmp |
あらかじめダウンロードしておいたOracle Databaseの2つのファイルは、このtmpディレクトリに格納しておきます。
1 2 3 |
[oracle@localhost ~]$ cd tmp/ [oracle@localhost tmp]$ ls linuxamd64_12102_database_1of2.zip linuxamd64_12102_database_2of2.zip |
Oracle Databaseのzipファイルを解凍する
1 2 |
[oracle@localhost tmp]$ unzip linuxamd64_12102_database_1of2.zip [oracle@localhost tmp]$ unzip linuxamd64_12102_database_2of2.zip |
日本語を設定する
oracleユーザの「~/.bashrc」ファイルを編集して日本語を設定します。
1 2 3 4 5 6 7 8 9 |
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions export LANG=ja_JP.UTF-8 |
設定を反映します。
1 |
[oracle@localhost tmp]$ source ~/.bashrc |
Oracle Databaseをインストールする
準備が長かったですが、いよいよOracle Databaseをインストールします。
1 2 3 4 5 6 7 |
[oracle@localhost tmp]$ ./database/runInstaller Oracle Universal Installerを起動中です... 一時領域の確認中: 500MBを超えている必要があります. 実際 27959MB 問題なし スワップ領域の確認中: 150MBを超えている必要があります. 実際 2015MB 問題なし モニターの確認中: 少なくとも256色表示するよう設定されている必要があります. 実際 16777216 問題なし Oracle Universal Installerの起動を準備中 /tmp/OraInstall2017-06-20_01-58-05PM. お待ちください... |
インストーラが起動しなかった場合は以下もご覧になってみてください。
「セキュリティ・アップデートをMy Oracle Support経由で受け取ります」のチェックを外し、「次へ」をクリックします。
「データベース・ソフトウェアのみインストール」を選択し、「次へ」をクリックします。
新たにターミナルを開き、rootユーザになります。
1 2 3 4 |
$ vagrant ssh [vagrant@localhost ~]$ su - Password: [root@localhost ~]# |
スクリプトを実行します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@localhost ~]# /u01/app/oraInventory/orainstRoot.sh 権限を変更中 /u01/app/oraInventory. グループの読取り/書込み権限を追加中。 全ユーザーの読取り/書込み/実行権限を削除中。 グループ名の変更 /u01/app/oraInventory 宛先 oinstall. スクリプトの実行が完了しました。 [root@localhost ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.1.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: (enterを押す) Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. |
環境変数を設定する
最後に環境変数を「~/.bash_profile」に設定します。
これを
1 2 3 4 5 6 7 8 9 10 11 12 |
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH |
このようにします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin umask 022 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH export LANG=ja_JP.UTF-8 export NLS_LANG=Japanese_Japan.AL32UTF8 |
設定を反映します。
1 |
[oracle@localhost tmp]$ source ~/.bash_profile |
以上です!