How to Install Oracle 11g R2 on RHEL-6 step by step

In this article, we are going to discussed how to install Oracle 11g R2, a brief guide on Redhat Linux 6 (64 bit). This article discusses Oracle 11g (R2) Database server installation, this server minimum 2 GB swap size, and selinux=permissive. For Linux Installation see my Linux Installation post or Video.

How to install oracle 11g on Linux

Download Oracle Database Software from the Oracle website, it will be downloaded in two parts. Then unzip these both file after unzipping these file making a single database folder. For unzip follow the below steps.

Unzip downloaded files:

# mkdir /u01
# unzip linux.x64_11gR2_database_1of7.zip -d/u01
# unzip linux.x64_11gR2_database_2of7.zip -d/u01

Now you have a single Database folder which is have runInstaller file.

Edit Hosts file

using below steps edit your hosts file carefully. In the Hosts file you have to fully specify your hostname and your machine IP address.

#vi /etc/hosts       (hit enter then press I for insert mode then edit it)

For Example.

<ip address >  <full name of machine >   <short name of your machine>
192.168.1.10    ocptechnology.com         ocptechnology

After update, save this file press Esc then shif+: then wq  then Enter.

Edit sysctl.conf

Now we need to edit sysctl.conf file for updating kernel parameters, open it and just copy paste the below parameter at end of this file.

#vi /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
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

After that run below command for applying changes of sysctl.conf file.

#/sbin/sysctl -p

Edit limits.conf

Now Edit limits.conf and add following lines in end of this file.

#vi /etc/security/limits.conf

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

Edit /etc/pam.d/login

Now Edit /etc/pam.d/login file and add below line.

#vi /etc/pam.d/login

session    required     pam_limits.so

Install required RPMs

Now install the required packages for configuring Oracle Database to installing these RPMs using YUM server, for yum server configuration Click Here.

yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y

Once you successfully installed all the RPMs then follow the below steps.

Group and Users

Now add necessary Groups and add a Oracle user for installation.

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper

useradd -g oinstall -G dba,oper oracle

--set the password for oracle user

passwd oracle

Grant Permissions

Now grant ownership and read write permissions to oracle user on directory (which we are going to use for oracle installation)

chown -R oracle:oinstall /u01
chmod -R 775 /u01

Disable Firewall and Selinux

Now make firewall disabled using setup command. Following below steps.

#setup -- firewall configuration--disable

Now set selinux=permissive

#vi /etc/selinux/config

Edit .bash_profile

Now edit .bash_profile and set the below parameters (check your oracle home directory carefully) inside .bash_profile.

Login with ORACLE user:

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

 export TMPDIR
 ORACLE_HOSTNAME=rhel6.localdomain; export ORACLE_HOSTNAME
 ORACLE_UNQNAME=db11g; export ORACLE_UNQNAME
 ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
 ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/db_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

Now you need to take reboot your machine to apply changes, or you can skip the reboot just run below command.

. .bash_profile  (this command load .bash_profile parameter in memory)

Start ./runInstaller

This is the final step, after running ./runinstaller the GUI interface appear just follow the instruction. For more clarity watch above video.

cd /u01/database
./runInstaller

Note: If you got any error related to pdksh rpm then download this rpm file from the internet and install it then try again.

Connect with me on:

Instagram: https://www.instagram.com/shripaldba
Linkedin: 
https://www.linkedin.com/in/shripal-singh
Twitter: 
https://twitter.com/ocptechnology
Facebook: 
https://www.facebook.com/ocptechnology
YouTube:
https://www.youtube.com/ocptechnology

3 thoughts on “How to Install Oracle 11g R2 on RHEL-6 step by step”

Leave a Comment

%d bloggers like this:
Enable Notifications    OK No thanks