Preparing CentOS 6.x for an Oracle 11g Database Server

Perform steps as root unless stated otherwise.


Hardware Requirements

Check all requirements before continuing.

Memory

# grep -i memtotal /proc/meminfo

should be > 1GB

Swap

# grep -i swaptotal /proc/meminfo

should be

  • if memtotal < 2GB then 1.5* of memtotal
  • if 2GB < memtotal < 8GB then equal to memtotal
  • if 8GB < memtotal then 0,75* of memtotal

Disk space in /tmp

# df -h /tmp

should be atleast 400MB

Disk space for Oracle binaries

# df -h

should be (depending on installation) between 1.5GB and 3GB

Software Requirements

Choose the one which fits your system!

Required packages (for 64-Bit systems)

# rpm -q compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel
# rpm -q glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel
# rpm -q libaio libgcc libstdc++ make sysstat unixODBC unixODBC-devel
If anything is missing install it using:
# yum install compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel
# yum install glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel
# yum install libaio libgcc libstdc++ make sysstat unixODBC unixODBC-devel

Required packages (for 32-Bit systems)

# rpm -q compat-libstdc++-33.i686 binutils elfutils-libelf elfutils-libelf-devel
# rpm -q glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel
# rpm -q libaio libgcc libstdc++ make sysstat unixODBC unixODBC-devel
If anything is missing install it using:
# yum install compat-libstdc++-33.i686 binutils elfutils-libelf elfutils-libelf-devel
# yum install glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel
# yum install libaio libgcc libstdc++ make sysstat unixODBC unixODBC-devel

You will need unzip or a similar programm later on

# yum install unzip

Please note that, when you are using Oracle Linux 6.x, some of the missing libraries can usually be ignored since the OUI does not recognise newer packages. The following packages can be ignored:

  • libaio-0.3.105 (i386)
  • compat-libstdc++-33-3.2.3 (i386)
  • libaio-devel-0.3.105 (i386)
  • libgcc-3.4.6 (i386)
  • libstdc++-3.4.6 (i386)
  • unixODBC-2.2.11 (i386)
  • unixODBC-devel-2.2.11 (i386)
  • pdksh-5.2.14

Pre-Installation setup

Create Oracle's user and groups

Create groups oinstall & dba:

# groupadd oinstall
# groupadd dba

Create the oracle user and set its password:

# useradd -m -g oinstall -G dba -s /bin/bash oracle
# passwd oracle

Kernel-Configuration

Change the parameters if they are lower than stated here (take notes and edit /etc/sysctl.conf after you checked all parameters):

kernel.sem
# sysctl -a | grep kernel.sem

should be ≥ than:

kernel.sem = 250   32000   100   128
kernel.shm
# sysctl -a | grep kernel.shm

should be ≥ than:

kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
file-max
# sysctl -a | grep file-max

should be ≥ than:

fs.file-max = 6815744
ip_local_port_range
# sysctl -a | grep ip_local_port_range

minimal value should be ≤ 9000 and maximum value should be ≥ 65500, see example below:

net.ipv4.ip_local_port_range = 9000   65500
rmem_default
# sysctl -a | grep rmem_default

should be ≥ than:

net.core.rmem_default = 262144
rmen_max
# sysctl -a | grep rmem_max

should be ≥ than:

net.core.rmem_max = 4194304
wmem_default
# sysctl -a | grep wmem_default

should be ≥ than:

net.core.wmem_default = 262144
wmem_max
# sysctl -a | grep wmem_max

should be ≥ than:

net.core.wmem_max = 1048576
aio-max-nr
# sysctl -a | grep aio-max-nr

should be ≥ than:

fs.aio-max-nr = 1048576
All required parameters:
kernel.sem = 250 32000 100 128
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
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

Apply the changes:

# sysctl -p

Shell limits for Oracle user:

Edit /etc/security/limits.conf
# vi /etc/security/limits.conf

Add the following:

oracle soft nproc  2048
oracle hard nproc  16384
oracle soft nofile 1024
oracle hard nofile 65536
Edit /etc/pam.d/login
# vi /etc/pam.d/login

For 64-Bit systems:

session required /lib64/security/pam_limits.so

For 32-Bit systems:

session required pam_limits.so

Always check the location for pam_limits.so. The location depends on distribution or architecture.

For CentOS 6.x it is /lib64/security/pam_limits.so.

If you are unsure use find / -name pam_limits.so to locate pam_limits.so.

Creating folders for Oracle installation:
# mkdir -p /opt/app/oracle/product/11.2.0
# chown -R oracle:oinstall /opt/app
# chmod -R 775 /opt/app
Create a new profile archive
# vi /etc/profile.d/custom.sh

Add the following:

#!/bin/bash

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

Allow it to be executed:

# chmod +x /etc/profile.d/custom.sh
Change active users to oracle and edit ~/.bash_profile:
# vi ~/.bash_profile

Add the following:

umask 022
export TMPDIR=/tmp
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export PATH=$ORACLE_HOME/bin:$PATH

Execute ~/.bash_profile:

# source ~/.bash_profile