DB関連/Oracle 11g R2のダウンロードとインストール(Linux版)その1の続きです。
Oracleをインストールし、使用するためには以下のグループとユーザーが必要になります。
| No | グループ/ユーザ名 | 意味 | 種別 | 備考 |
| 1 | oinstall | オラクルインベントリーグループ | グループ | |
| 2 | dba | データベース管理者グループ | グループ | |
| 3 | oracle | ソフトウェアオーナー | ユーザ |
今回は、完全に新規のインストールを想定して説明します。
既にこれらのグループが作成されていた場合の対処方法は、インストールマニュアルを参照してください。
http://download.oracle.com/docs/cd/E11882_01/install.112/e10860/toc.htm#BHCBCFDI
# /usr/sbin/groupadd oinstall #オラクルインベントリグループの作成 # /usr/sbin/groupadd dba #データベース管理者グループの作成 # /usr/sbin/useradd -g oinstall -G dba oracle #ユーザーの作成 # passwd oracle #パスワードの設定
カーネルパラメータの要件は次の通りになります。
| No | パラメータ | 値 | 備考 |
| 1 | semmsl | 250 以上 | |
| 2 | semmns | 32000 以上 | |
| 3 | semopm | 100 以上 | |
| 4 | semmni | 128 以上 | |
| 5 | shmall | 2097152 以上 | |
| 6 | shmmax | 716800000 以上 | DB関連/Oracle 11g R2のダウンロードとインストール(Linux版)その1で決めたため |
| 7 | shmmni | 4096 以上 | |
| 8 | file-max | 6815744 以上(512byte単位) | |
| 9 | ip_local_port_range | 9000 - 65500 | |
| 10 | rmem_default | 262144 以上 | |
| 11 | rmem_max | 4194304 以上 | |
| 12 | wmem_default | 262144 以上 | |
| 13 | wmem_max | 1048576 以上 | |
| 14 | aio-max-nr | 1048576 以上 |
/etc/sysctl.conf
ファイルを開いて、設定が無かったら追加し、既存の設定範囲が狭かったら下記の設定で上書きします。
fs.file-max = 6815744 fs.aio-max-nr = 1048576 kernel.sem = 250 32000 100 128 kernel.shmall = 2097152 kernel.shmmax = 716800000 kernel.shmmni = 4096 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 = 1048586
自分の場合、既に値が入っていた部分があったので、最終的な設定値は以下のようになりました。
fs.file-max = 6815744 fs.aio-max-nr = 1048576 kernel.sem = 250 32000 100 128 kernel.shmall = 268435456 kernel.shmmax = 4294967295 kernel.shmmni = 4096 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 = 1048586
カーネルパラメータの有効化
以下のコマンドを投入し、カーネルパラメータを有効化させます。
# /sbin/sysctl -p # /sbin/sysctl -a
http://download.oracle.com/docs/cd/E11882_01/install.112/e10860/toc.htm#BHCCADGD
/etc/security/limits.conf に以下の定義を追加します。
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
/etc/pam.d/loginに以下の定義を追加します。
session required pam_limits.so
http://download.oracle.com/docs/cd/E11882_01/install.112/e10860/toc.htm#sthref46
/etc/profile (Bash, またはKorn shellの場合) ←一般的にこっち。
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
/etc/csh.login (Cshなどの場合)
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif
今回、Oracleをインストールするディレクトリは、/opt/oracle/ 以下にします。
以下のコマンドを投入し、インストールディレクトリを作成します。
# mkdir -p /opt/oracle/ #ディレクトリの作成 # mkdir -p /opt/oraInventory/ #ディレクトリの作成 # chown -R oracle:oinstall /opt/oracle/ #所有者の変更 # chown -R oracle:oinstall /opt/oraInventory/ #所有者の変更 # chmod -R 775 /opt/oracle/ #パーミッションの変更 # chmod -R 775 /opt/oraInventory/ #パーミッションの変更
http://download.oracle.com/docs/cd/E11882_01/install.112/e10860/toc.htm#CEGIHDBF
~/.bash_profile ファイルに以下を追加します。(Cシェル系を利用の人は適宜修正してください。)
su - oracle vi .bash_profile
umask 022 export ORACLE_BASE=/opt/oracle export ORACLE_SID=tech01 (注意!:一般的にはorclです。自分のサイトに合わせて変更してます。)
http://download.oracle.com/docs/cd/E11882_01/install.112/e10860/toc.htm#CEGEGDBA
続いてダウンロード方法について、説明します。
DB関連/Oracle 11g R2のダウンロードとインストール(Linux版)その3 へ続く。