Better At Oracle

A collection of tutorials, code and tools to help you get better using Oracle


06 June 2011

Installing Oracle 11gR2 on Centos 5.6

Notes on installing Oracle 11gR2 on Cent OS 5.6

Check all the Kernel params

All were well within limits when I tested them:

kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144

However, Oracle will tell you what ones are not at the correct values during install, and give you the chance to correct and retest etc.

To set the kernel parameters, edit /etc/sysctl.conf, then save and run /sbin/sysctl -p and it will load what is in that file. I added:

# Modified for Oracle install
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.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr=1048576

To test what a parameter is currently set to run:

/sbin/sysctl -a | grep <param-name>

Add the following lines to the /etc/security/limits.conf file:

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

Add the following line to the /etc/pam.d/login file, if it does not already exist:

session    required     pam_limits.so

Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled

Required Libraries

Check or install the following libraries:

yum install binutils*
yum install elfutils-libelf-0.*
yum install glibc-2.*
yum install glibc-common-2.*
yum install libaio-0.*
yum install libgcc-4.*
yum install libstdc++-4.*
yum install make-3.*
yum install compat-libstdc++-33*
yum install gcc-4.*
yum install gcc-c++-4.*
yum install libaio-devel-0.*
yum install libstdc++-devel-4.*
yum install unixODBC-2.*
yum install unixODBC-devel-2.*
yum install sysstat-7.*
yum install pdksh-5*

Create all the groups and directories:

groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin

useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle

mkdir -p /dboracle/product/11.2.0
chown -R oracle:oinstall /dboracle
chmod -R 755 /dboracle

Unzip the software to get it ready to install. At this point can use the GUI to do the install, but I'd rather do it using a prompt file so it will work for remote installs.

Response File Install

There is a template response file included in the Oracle software download:

database/response/db_install.rsp

Go through the file and fill in the various values. There are not too many required for a software only install. Some things to note are:

UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db
ORACLE_BASE=/u01/app/oracle

If you get an error that states "email address not specified" when running the installer, try setting

DECLINE_SECURITY_UPDATES=true 

When running in silent mode, if you get an error like:

Xlib: connection to ": 0.0" refused by server
Xlib: No protocol Specified

Try unsetting the DISPLAY environment variable:

unset DISPLAY

To run the installer, use the command:

./runInstaller -silent -responseFile /u01/app/oracle/stage/database/response/db_install.rsp

Root Scripts

After the install completes there are two scripts you must run as root on the system:

/u01/app/oracle/product/11.2.0/db/root.sh
/u01/app/oraInventory/orainstRoot.sh

GUI Installer

To run the GUI installer, you need to set the DISPLAY variable correctly for X. Running locally on localhost, I got it to work by doing:

DISPLAY=:0; export DISPLAY

Other places suggest the correct format is DISPLAY=hostname:0:0, but that would not work for my local install.

Now run the Oracle installer - I picked SOFTWARE ONLY install to avoid creating a database, which I will do seperately.

Profile

Add the following to the Oracle .bash_profile to correctly setup the current Oracle home etc:

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=home.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/dboracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

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

If all goes to plan, that will be Oracle successfully installed. Next, create a database.

blog comments powered by Disqus