Installing Oracle 11g Database on Linux (RHEL6)


Installing, setting-up & administering Oracle database is one of the most overwhelming things I have ever come across during my short career as a Linux Admin. While it is somewhat easier on a Windows platform, it a relatively tough nut to crack on Linux servers. A lot of tweakings need to be done 😦 But with a careful approach, installing Oracle 11g can become a cake-walk 😉 In this tutorial I will show you how to install it on an RHEL 6.5 Server. You are free to choose any similar Linux distribution, but a few things do vary. So, be careful 🙂 Let’s start with the tutorial. I assume, you have downloaded Oracle 11g zip file & extracted to hard-disk.

Lab Description : –

  • OS – Red Hat Enterprise Linux 6.5 64-bit
  • RAM – 3GB
  • Free Space on /opt – 25Gb
  • Oracle Database version – 11.2.0(11g)

Edit Kernel parameters.

Do it as root. Edit /etc/sysctl.conf file (always take backup of configuration files before editing them). Append with contents shown in the screenshot. I want you to type it manually & not paste, so that you get the idea what you are putting in. Once you have appended the file, save it & run the command sysctl -p to reload kernel parameters. If these values are incorrectly set, installer will throw an error & will show you what was the expected value. So, you can correct those values & continue with installation.

Sysctl kernel parameters

Sysctl kernel parameters

Edit /etc/security/limits.conf file.

Append the file with below contents.

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

Create required groups & oracle user.

Create oinstall & dba groups & oracle user.

groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle

Login as oracle user. Issue su - oracle to login as oracle user.

Run the Installer.

Go to the location where you extracted the tarball. It must be Oracle11g/database directory. You will find runInstaller.sh script here. Run it. It will open the installer GUI.

Installer Location

Installer Location

Installation Screen

Installation Screen

Click Next & you will be shown a warning message. Click Yes as its just a warning that you have not entered any email-address. You won’t need it anyway 😉

Install2

Click Next & then Skip Software Updates. Of Course, this is optional. Choose accordingly.

Install3

Click Next & proceed with selecting Create & Configure a database, since this is your first installation. I assume it to be on a test server or at home. This database can act as guide to create other databases, so I prefer using this option if this is your first ever experience of Oracle installation.

Install4

Click Next & choose Desktop Class as this allows for a minimal set-up.

Install5

Choosing Installation Location & Database Name.

This is very important step. Pay extra care here. I am explaining what needs to be done here. Oracle base is where your Oracle is installed. Choose a partition with at-least 12GB free space. While, it can be moved to any directory later on, I recommend choosing your partition wisely to simplify the things. Next 2 options will be dynamically changed based on option 1. Leave other fields as default. Then type in Administrator password. Do remember that Oracle doesn’t accept @ in passwords. Confirm it & Click Next.

Install6

If the password chosen is weak, it will display a warning message. Click Yes to continue.

Install7

Now choose an Inventory directory. You may leave it as default & then click Next.

Install8

Now the step that taught me a few things 😉 If kernel parameters were incorrectly set (step 1) & pre-required packages were not installed, you will see the error message shown below. Thank God, Oracle is intelligent enough to tell (refer to the screenshot below) us what should be the values in /etc/sysctl.conf 🙂 If you run into this issue, make sure to set the correct values & also to install required packages. I could have told this in the beginning, but I didn’t, since resolving errors is a good habit, rather than not getting any error 😉 It helps in learning. Once the dependencies are resolved, click Next.

Install9

The next screen shows the confirmation about the stuff we selected in the beginning. At this point, if your are satisfied with the parameters like installation directory, database name etc, you can click Install to begin installation process.

Install10

Below screenshots show you the installation progress. If you are patient enough, you can sit & watch the proceedings 😉 If you’re not, go get a cup of coffee 🙂 It will take some time.

Install11

Install12

Just before installation completion, you might see a warning message as seen below. It tells you that, to use a database, you must set ORACLE_SID to database name. I will cover Database creation part in next post. As of now, open your bash shell & issue :

ORACLE_SID=orcl export ORACLE_SID echo $ORACLE_SID

Install13

Execute Oracle Scripts. Now its time to run 2 scripts as root as shown in the below screenshots. Click Ok here & execute scripts.

Install17

Install15

Install16

That’s it. You will see below screen after successful completion of installation. Take a screenshot of the screen so as to have information about the web-console. If your memory is sharp, you may skip it 😉

Install14

So, you can see we have successfully installed Oracle 11g on our Linux server. Now, before you can start using Oracle, you need to do one last thing. Edit your .bash_profile file & add below text. Skip what’s already there. Make sure to enter your Oracle installation directory for ORACLE_BASE & HOME. Below is where mine was installed.

PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/opt/oracledb/u01/app/oracle
export ORACLE_HOME=/opt/oracledb/u01/app/oracle/product/11.2.0/db_home1
export LD_LIBRARY_PATH=$ORACLE_HOME/lob
PATH=$PATH:$ORACLE_HOME/bin

After doing this, save this file & then issue sql / as sysdba command. It will launch SQL > prompt telling you are connected to an Oracle Database (orcl). If these things are confusing, then don’t worry. Next tutorial explains all these things in detail along with how to create a new database 🙂 See you there 😉

Advertisements

One thought on “Installing Oracle 11g Database on Linux (RHEL6)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s