Installing Oracle Database 11gR2 on Oracle Linux 5

Oracle 11g

To install Oracle Database 11g R2 on a Linux server there if few things we need to keep in mind that installing Oracle Database is quite simple, it’s the pre-installation process that can be tricky.

In our example I will use the 64Bit Oracle Linux 5 update 7 which by default uses the Oracle’s Unbreakable Enterprise Kernel (read more about UEK)!

Our oracle installation will be on a different disk/partition than the OS’s, So we create 3 disks/partitions, one for the system root, one for the swap, and the third for the Oracle Database (I did define the third disk/partition as /u01).

if you have the system Installed from before then we can check the system architect with:

check the system architect:
# uname -m

It’s very important that we understand the relationship between the RAM and the SWAP size as defined with the table below:

If the RAM was
Between 4GB and 8GB then the SWAP should be 2 times the size of the RAM.
Between 8GB and 32GB then the SWAP should be 1.5 times the size of the RAM.
More than 32GB then the SWAP should be 32GB.

Note: it’s better that you prepare the system’s SWAP size while install a fresh copy of Linux.
To determine the RAM size, enter the following command:
# grep MemTotal /proc/meminfo
To determine the size of the configured swap space, enter the following command:
# grep SwapTotal /proc/meminfo
To determine the available RAM and swap space, enter the following command:
# free

After installing/checking Linux

We can install/run the Oracle Validate to check and configure (most of) the system setting and make it ready for database hosting.

Before Oracle build the Oracle-Validate package we had to do this manually but now no need to do this manually, we can just download and run the oracle-validate package.

We need to download and enable the repository.

# cd /etc/yum.repos.d

# wget

Enable both the [el5_u7_base] repositories in the yum configuration file by changing enable=0 to enable=1 in those sections.
name=Oracle Linux $releasever – U5 – x86_64 – base
Then we run the command
# yum install oracle-validated
After the command modifying most of the settings and adding users and groups
We go and check if the user “oracle” was created

# id oracle

To make sure that we have full control over the user’s password “oracle”:
We start to tune the settings and create some directories

Change the password for the user “oracle” to something you want.
# passwd oracle

Create the Oracle Base Directory.
We have created the disk/partition /u01 so here we are going to use it
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle
# chmod -R 775 /u01/app

Create the Oracle Inventory directory (oraInventory) stores an inventory of all software installed on the system.
# mkdir -p /u01/app/oraInventory
# chown -R oracle:oinstall /u01/app/oraInventory
# chmod -R 775 /u01/app/oraInventory

If not disable secure linux by editing the


file, making sure the SELINUX flag is set as follows:


Login as the user “oracle”

Edit the file (the default location) /home/oracle/.bash_profile

Add the following lines to file (do not replace):

# Oracle Settings

TMP=/tmp; export TMP


ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME



PATH=/usr/sbin:$PATH; export PATH

ulimit -p 16384

ulimit -n 65536


ulimit -u 16384 -n 65536



Now you are ready to run the Oracle Installation Process

When we are done with Oracle installation and configuration process, there will be one things missing, it is the startup/shutdown process that integrates with Linux’s startup/shutdown process.

Note: It’s not like on windows where the database and the listener will be starting and shutting down when the system is starting or shutting down, you need to do that manually, and it’s a critical thing because you do not want to shut down the system while the database is running, you need to shut down the database and the listener before you shut down the system!

There will be another post to configure the process.