Monday, January 24, 2011

Step by step guide to install Oracle 11G R2 on x86_64 Linux (CentOS 5.5)

Hardware Requirements:

Physical Memory
[root@centos55 ~]# grep -i memtotal /proc/meminfo
results: should be at least 1GB
[root@centos55 ~]# grep -i swaptotal /proc/meminfo
results: should be 1.5 the size of memtotal if memtotal <>
should be equal to memtotal if memtotal is between 2GB and 8GB
should be .75 the size of memtotal if memtotal > 8GB
Shared Memory
[root@centos55 ~]# df -k /dev/shm
results: informational
purpose: The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer.
Disk space in /tmp
[root@centos55 ~]# df -h /tmp
results: should have at least 400MB available
Disk space for Oracle binaries
[root@centos55 ~]# df -h
results: Depending on installation type you should have between 4.5GB and 4.9GB

Software requirements:

Linux distribution :
[root@centos55 ~]# cat /proc/version
Linux version 2.6.18-194.32.1.el5 ( (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Wed Jan 5 17:52:25 EST 2011

Kernel version:
[root@centos55 ~]# uname -r

Required Packages:
[root@centos55 ~] # rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers-2.6.18 ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel

It is probably a good idea to do a minimal install of the CentOS and install the following packages using Yum using the following commands.

[root@centos55 ~]# yum -y install compat-db gcc gcc-c++ libstdc++ pdksh sysstat compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static unixODBC unixODBC-devel libaio-devel
to install the missing packages.

[root@centos55 ~]# yum -y groupinstall "X Window System"

Create Oracle user and group

Create groups oinstall & dba

[root@centos55 ~]# groupadd oinstall
[root@centos55 ~]# groupadd dba
Create the Oracle user and change password
[root@centos55 ~]# useradd -g oinstall -G dba -s /bin/bash oracle
[root@centos55 ~]# passwd oracle

Creating Directories to Install the Oracle Software

[root@centos55 ~]# mkdir /u01
[root@centos55 ~]# mkdir /u02
[root@centos55 ~]# chown -Rf oracle:oinstall /u01
[root@centos55 ~]# chown -Rf oracle:oinstall /u02
[root@centos55 ~]# mount -o tcp,rsize=32768,wsize=32768,hard,intr,timeo=600 /u02
[root@centos55 ~]# chown -Rf oracle:oinstall /u02

Setting shell limits for the Oracle user

[root@centos55 ~]# vi /etc/security/limits.conf

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

Add the following lines to /etc/pam.d/login

[root@centos55 ~]# vi /etc/pam.d/login
session required

Add the following lines to /etc/profile

[root@centos55 ~]# vi /etc/profile

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

export ORACLE_BASE=/opt/app/oracle:$ORACLE_BASE
export ORACLE_SID=orcl

Configuring kernel parameters

[root@centos55 ~]# vi /etc/sysctl.conf

kernel.shmmax = 6442450944
kernel.shmall = 2097152
kernel.sem=250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range=9000 65500
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 262144 16777216
net.ipv4.tcp_wmem = 4096 262144 16777216
net.ipv4.tcp_window_scaling = 1

[root@centos55 ~]# sysctl -p

Unzipping the downloaded setup files:

Unzip the downloaded files to a temporary location.

[root@centos55 opt]# unzip
[root@centos55 opt]# unzip

[root@centos55 opt]# ls -lrth
total 2.2G
-rw-r--r-- 1 oracle oinstall 1.2G Mar 10 2010
-rw-r--r-- 1 oracle oinstall 1.1G Mar 10 2010

Here the files have been unzipped into /opt and the following commands will take you through starting the Oracle installer form that mount point.

[root@centos55 ~]# cd /opt/database

[root@centos55 ~]# ./runInstaller

From this point, Oracle will do a few minor checks on the operating system and then put up the Oracle Installation screen. Our particular configuration did not throw any errors at this point but it should be noted, as it can be helpful, that sometimes the Oracle installer will complain at this very early stage about various Linux system configurations. If this is the case you might be able to bypass them by adding an additional argument to the runInstaller command. Please only use this as a last resort to the normal installation path.

[root@centos55 ~]# ./runInstaller -ignoreSysPrereqs

The installation settings are pretty explanatory. Just go with the defaults, and if there is an error at some point the details panel will explain whats wrong.

At one point you will be asked for the SYSMAN password. Remember it because it will be used to login into the web console.

When you near the very end of the installation, you will be asked to run one or two scripts as root.

Just open up a terminal, su – into root and run the scripts which have their full paths displayed for your convenience.

Execute Configuration scripts

[root@centos55 ~]# /opt/app/oraInventory/
[root@centos55 ~]# /opt/app/oracle/product/11.1.0/db_1/

1. accept default of /usr/local/bin
2. Click
3. Click
4. Click

Starting And Stoping Oracle

You might need to start oracle back up or stop it at some point so sue these commands which are located in:


emctl start dbconsole
lsnrctl start

emctl stop dbconsole
lsnrctl stop

Direct NFS Client

For improved NFS performance, Oracle recommend using the Direct NFS Client shipped with Oracle 11g. The direct NFS client looks for NFS details in the following locations:




[root@centos55 ~]# vi $ORACLE_HOME/dbs/oranfstab

server: nas1
export: /vol/u02export mount /u02

Since we already have our NFS mount point details in the "/etc/fstab", and therefore the "/etc/mtab" file also, there is no need to configure any extra connection details.

For the client to work we need to switch the library for the library, as shown below.

SQL>shutdown immediate

[root@centos55 ~]# cd $ORACLE_HOME/lib
[root@centos55 ~]# mv libodm11.so_stub
[root@centos55 ~]# ln -s


With the configuration complete, you can see the direct NFS client usage via the following views:
For example:
SQL> SELECT svrname, dirname FROM v$dnfs_servers;

------------- -----------------
nas1 /vol/u02export