Setup Oracle 11gR2 on a centOS 5.4 VMware Virtual Machine

Well it was time for me to install a test and development virtual machine for Oracle 11gR2 and as it turned out to be a bit of a painful experience to get this installed on centOS 5.4, I’ve written the details down into a blog article.

This way you can all enjoy the ultimate pleasures of installing Oracle on a RHEL/CentOS virtual machine.


This setup guide is not meant as a guideline for setting up a production server, most settings are absolute minimums and do not qualify for a proper production server.

These steps should only be used as a quick guide for setting up a test oracle server for development and or testing.

At any time we do strongly suggest to first read the Quick Install Guide that can be found in your unzipped database install folder after opening the welcome.html file in there with a browser.

Basic OS Setup

First setup centOS 5.4 32 bits as usual, yes you are reading that correctly 32 bits, at this stage that was enough for me as I can run it anywhere. You might want to check the quick install notes for 64 bits, although I expect most of it to be the same.

Extra steps which I am not detailing down here are:

  • Disable SELinux (it is actually supported for Oracle 11gR2, so leave it on if you are in for an adventure )
  • Install vmware tools if virtual (use the tar.gz install over rpm as it tends to give better results)
  • Setup sudo (see How To: configure sudo on ESX | PlanetVM I’m using the -user can run anything as root via the wheel group- method here)

As Oracle requires at least 1024 Mb of memory, set the memory of your VM to 1048 Mb.. yes that’s correct, Oracle cannot count. Setting it to 1024Mb will make it fail the test.

The absolute minimum virtual disk size is 15GB for a single disk install. I’ve had to grow my disk 2 times when i was too conservative, so save yourself the trouble and don’t make the disk any smaller as that. Set your swap size at least to 1.5 GB umm make that 1.6 GB 😉

Software prerequisites

Make sure following packages are installed:

 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

I had to run:

 sudo yum 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.
Rerun the rpm -q line from above to check afterwards that everything installed OK.

Setup users and groups

create users/groups as described

 sudo /usr/sbin/groupadd oinstall
 sudo /usr/sbin/groupadd dba
 sudo /usr/sbin/useradd -m -g oinstall -G dba oracle
 sudo id oracle

Expected output:

 uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

now setup a new password for the user oracle:

 sudo passwd oracle

Set Kernel parameters

Now you need to tweak the kernel parameters to keep the installer happy.

Save the following to a script called and run it as root (or download):

 cat >> /etc/sysctl.conf <<EOF
 # Added kernel parameters for Oracle setup
 kernel.shmmni = 4096
 kernel.sem = 250 32000 100 128
 fs.file-max = 6815744
 net.ipv4.ip_local_port_range = 9000 65500
 /sbin/sysctl -p

First make executable:

 sudo chmod +x

and then run:

 sudo ./

The output of that should be:

 net.ipv4.ip_forward = 0
 net.ipv4.conf.default.rp_filter = 1
 net.ipv4.conf.default.accept_source_route = 0
 kernel.sysrq = 0
 kernel.core_uses_pid = 1
 net.ipv4.tcp_syncookies = 1
 kernel.msgmnb = 65536
 kernel.msgmax = 65536
 kernel.shmmax = 4294967295
 kernel.shmall = 268435456
 kernel.shmmni = 4096
 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

It just lists your current settings.

Basic folder structure

Now we will create the basic folder structure for oracle to install under:
Again save to a script called (or download) and run as root:

 mkdir -p /u01
 mkdir -p /opt/oracle
 mkdir -p /opt/oracle/product
 mkdir -p /opt/oraInventory
 chown -R oracle:oinstall /u01
 chown -R oracle:oinstall /opt/oracle
 chown -R oracle:oinstall /opt/oraInventory
 chmod -R 775 /u01
 chmod -R 775 /opt/oracle
 chmod -R 775 /opt/oracle/product

make executable:

 chmod +x

now run as root:

 sudo ./

Setup shell-limits

see script download

same as before now run ./ as root.


Make sure to use a fixed IP and setup your hostname in /etc/hosts
Use network manager for this:

Disable the firewall temporary for the install, but before you do that, add tcp ports: 1521, 1158
Port 1521 is for the connection to the database (the so called listener) and 1158 is for the port on which you web management interface runs.

Do not forget to enable the firewall after you installed oracle!

Installing oracle

Move the downloaded zip files to /opt/oracle

 sudo mv linux_11gR2_database_* /opt/oracle

change the rights to your oracle user

 cd /opt/oracle
 sudo chown oracle:oinstall linux_11gR2_database_*

Now reboot the machine and log in as user: oracle

cd /opt/oracle

and unzip both of them:


This is where you might want to take a snapshot of your virtual machine!
now delete both of the zip files to create some more space (you’ll need it!)

rm linux_11gR2_database_*.zip

and a df -h now shows on my machine:

 df -h
 Filesystem            Size  Used Avail Use% Mounted on
 13G  5.0G  7.4G  41% /
 /dev/sda1              99M   18M   76M  20% /boot
 tmpfs                 373M     0  373M   0% /dev/shm

Yes, you’ll need that 7.4G just for the install.. no less please!

Now change into the database subfolder and run


You should not get an error before your first screen, if you get a complaint about your /etc/hosts configuration then don’t bother installing and fix that first (is your firewall still on?)




Set oracle base to:

then change the OSDBA group to oinstall

If your database name is bigger as 8 characters then make it shorter, for ex. orcl (we are using planetvm here)

enter password and click Next

for inventory choose:

and click Next again and the setup will start verifying things for you:


If you are unlucky, then you’ll get a screen like this one:

6.Prereq-checks-failand else the screen just doesn’t appear and you’ll end up on the summary and can click Next to install the product.


Click on Finish for the actual setup to run:

8.Install-ProductAfter a while you should see:

8.Install-Product-progressand then after getting really hungry you’ll end up with:


Almost done now, here’s the final step:


Do exactly what it says: Open a new terminal window while the install program is still open and run su – to gain root (we have not setup sudo for the oracle user):

$ su -
[root@ora ~]# /opt/oraInventory/
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /opt/oraInventory to oinstall.
The execution of the script is complete.
[root@ora ~]# /opt/oracle/product/11.2.0/dbhome_1/
Running Oracle 11g script...

The following environment variables are set as:
 ORACLE_HOME=  /opt/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
 Copying dbhome to /usr/local/bin ...
 Copying oraenv to /usr/local/bin ...
 Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

Click OK


Congratulations if you made it this far, you have succeeded into installing Oracle!

That was easy wasn’t it? 😀

Also see:

Oracle on VMware vSphere Essential Database Deployment Tips

This article was based on many tips from the following link which describes how-to install Oracle 10g/11gR1 on centOS 4.x (which is very different I’m afraid):

Author: Wil van Antwerpen

Wil van Antwerpen is a software developer who loves to work on Open Source and dabble a bit with VMware products. He likes to help people out as that is a good way to learn more. He is the author of Vimalin Backup ( which is virtual machine backup software for VMware Fusion and VMware Workstation Pro.

14 thoughts on “Setup Oracle 11gR2 on a centOS 5.4 VMware Virtual Machine”

  1. As an Oracle Apps DBA for 10+ years, I have to say it’s a very good write-up – nice job!

    Couple of minor notes – if running it virtualized I’d recommend adding elevator=noop to the grub.conf file – this will tell the OS to not try and not optimize the I/O with the underlying disks – this becomes especially important when running virtualized connected to a SAN.

    Also, Oracle has an oracle-validated RPM that will set all your OS kernel parameters and install any required RPMs you may be missing. The latest version is from March of 09 and sets everything for DBs thru 11gR1 – I’ve been told they’re still (still?!?) working on the 11gR2 version but it’ll do almost everything needed for 11gR2 – if I recall right, a sysctl.conf param or two needs to be modified, but it does make things easier.

    Final note – I don’t remember for sure, but in the past the Oracle installer needed to be started with -ignoreprereqs to work on Centos since technically Oracle 11g is only supported on RHEL, not Centos.

  2. Thanks Jay for the kind words and the extra notes.

    I have been writing code for Oracle, mySQL, postgreSQL and MSSQL for a long time as well now. So that certainly does help a bit when having to setup Oracle on a linux server.

    Having said that, I do not consider myself DBA worthy, I know my way around Oracle, but don’t spent enough time on a daily bases with it to know all the ins and outs about the product. I’m just a developer 😉

    So your encouragement is truly appreciated.

    FWIW I did not have to add the ignoreprereqs parameter, but maybe that’s because Oracle Linux is not technically RHEL either.

  3. I did the install a couple of times and thought is was pretty basic to be honest. Even when you don’t have all the pre-reqs in place the installer will tell you about this. All the kernel settings can be done from a script that the installer will provide you.

    I think it is key to install oracle from the account you created, so logoff. login with the oracle account and install it.

    Funny that I documented this complete procedure, as described above, two weeks ago 🙂

  4. Hi Duncan,

    Funny you should say that you bothered to document a pretty basic process 😉 and a pity you didn’t post it at your site.

    I ran the installer also a few times and sometimes the prerequisites just passed and then the install still failed on later. So not sure what is different with your setups.

    Also note that it is an install tweaked for minimums -which will run fine on your development laptop without overtaking it – and contains step by step what to do even if you are not very linux savvy.
    In addition it contains a lot of details where you can make a mistake configuration wise. Hereby saving you having to rerun the installer which -in the end- can save you a lot of time as it is not the fastest process in the world.

  5. I’m writing documentation for an upcoming project and it needs to be completely fool proof as always, hence the reason for the documentation. That’s also the reason I did not post it to my site as it is documentation for an unreleased product, the NDA police would kill me!

    Weird, that you needed to set them manually though… hmmmm,

  6. After I installed oracle 11gR2, dbconsole is not working. Help me!!!

    emctl start dbconsole is ok.

    But when I open em in browser, It is not working.

    I tried on RHEL, OEL and Centos. All same error.


Comments are closed.

%d bloggers like this: