事前準備

ORACLEサーバをインストールする前の事前準備を行います。

事前条件

  • CentOSをインストール直後の状態で作業

hostsの設定

[shell] # vi /etc/hosts
192.168.xx.xx oracle11gr2.alt oracle11gr2
[/shell]

※192.168.xx.xxは、自分自身のIPアドレス

デスクトップ環境のインストール

[shell]

# yum -y groupinstall "X Window System"
# yum -y groupinstall "Desktop"
# yum -y groupinstall "General Purpose Desktop"

[/shell]

その他、yumのインストール

[shell]

# yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel

[/shell]

一般ユーザーでstartxできるように

[shell]

# vi /etc/pam.d/xserver

# cat /etc/pam.d/xserver
#%PAM-1.0
auth sufficient pam_rootok.so
auth required pam_permit.so
account required pam_permit.so
session optional pam_keyinit.so force revoke

[/shell]

カーネルパラメータの編集

[shell] # vi /etc/sysctl.conf

# 以下コメント化
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

# 最終行に追記
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
[/shell]

確認

[shell] # sysctl -p
[/shell]

oracleユーザーとグループを作成

[shell] # groupadd -g 200 oinstall
# groupadd -g 201 dba
# useradd -u 440 -g oinstall -G dba -d /usr/oracle oracle
[/shell] [shell] # vi /etc/pam.d/login

# 14行目あたりに追記
session required pam_selinux.so open
session required pam_namespace.so
session required pam_limits.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
[/shell] [shell] # vi /etc/security/limits.conf

# 最終行に追記
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[/shell] [shell] # vi /etc/profile

# 最終行に追記
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
[/shell]

Oracleユーザーの設定

[shell] # su oracle
$ cd
$ chmod 755 /usr/oracle
$ mkdir /usr/oracle/app
$ chmod 775 /usr/oracle/app
$ mkdir /usr/oracle/oradata
$ chmod 775 /usr/oracle/oradata
[/shell] [shell] $ vi ~/.bash_profile

# 最終行に追記
umask 022
export ORACLE_BASE=/usr/oracle/app
[/shell] [shell] $ mkdir tmp
[/shell]