About Me

My photo
Bangalore, India
I am an Oracle Certified Professional working in SAP Labs. Everything written on my blog has been tested on my local environment, Please test before implementing or running in production. You can contact me at amit.rath0708@gmail.com.

Wednesday, September 25, 2013

How to install Oracle Database 11.2.0.1(11GR2) in Redhat Linux 5 step by step

PFB steps to install Oracle Database 11gR201 on RHEL 5 :-

1. Download Software from www.oracle.com, Downloads section --> Oracle Database.

linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip

2. Unzip both the files in same directory one by one. A single directory named database will be created after you unzip both the files.

3. You need minimum 5 GB space for this installation excluding software.

4. Prerequisites for Oracle Installation in RHEL5 :-

a. Check Memory :- Minimum 1GB required, But 2GB recommended.

[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal:      2058824 kB

b. Check that System architecture can run software :-

[root@localhost ~]# uname -m
x86_64

As system is 64 bit , Oracle which has to be installed has to be 64 bit.

c. Check Swap Space :-

1GB -2GB RAM    ----------  SWAP space 1.5 times
2GB - 16GB RAM ---------   SWAP space equal to RAM
> 16GB RAM        ---------   SWAP space equals 16GB

[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal:     4095992 kB

d. Check /tmp directory :-

[root@localhost ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       2G   436m  1.5G  21% /tmp

/tmp directory must have 1GB free space.

e. Check Kernal Version :-

[root@localhost ~]# uname -r
2.6.18-274.el5

f. Check Package requirements :-

rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*

Run above packages , if they are already installed then it will give message as 'INSTALLED' and those are not installed it will install those.

If you need to check which package is there or not then use :-

rpm -q package_name

g. Create required groups, User and Directories :-

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# mkdir -p /oracle_home/app
[root@localhost /]# chown -R oracle:oinstall /oracle_home/app
[root@localhost /]# chmod -R 750 /oracle_home/app
[root@localhost /]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

h. Configuring Kernal Parameters :-

Enter the below mentioned entries in /etc/sysctl.conf file :-

fs.suid_dumpable = 1
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=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

If values for above already present commnt those. Run below mentioned command to change current kernal values :-

[root@localhost /]# /sbin/sysctl -p
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

i. Configure the Resource limits for Oracle User :-

Enter the below mentioned entries in /etc/security/limits.conf file :-

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

j. Set the Display setting for graphical Oracle Installation :-

[root@localhost /]# su - oracle
[oracle@localhost ~]$ export DISPLAY=localhost:0.0
[oracle@localhost ~]$ echo $DISPLAY
localhost:0.0

Prerequisites have been completed . Now we can start Oracle Installation.

5. Installation of Oracle

a. Run the ./runInstaller in database folder which has been created after Unzipping the software :-

[oracle@localhost database]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 7482 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3999 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 65536    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-09-25_09-43-28PM. Please wait ...[oracle@localhost database]$ 




















Execute these scripts as root user 

[root@localhost ~]# /oracle_home/app/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /oracle_home/app/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost ~]#


Database 11GR2O1 installation completed.

6. Configure Oracle Settings in .bash_profile :-

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

ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/oracle_home/app; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
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/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

export PATH

[oracle@localhost ~]$ echo $ORACLE_HOME
/oracle_home/app/product/11.2.0/dbhome_1
[oracle@localhost ~]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 25 22:47:19 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: /as sysdba

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

I hope this article helped you.

Regards,
Amit Rath

No comments:

Post a Comment