Installing Oracle 11g on Ubuntu

This article clearly describes installation of Oracle 11g release 2 on Ubuntu 10.10 desktop

Pre-requisites
1. Operating system – Ubuntu 10.10 32 bit operating system (Maverick Meerkat)
2. Hard disk space – 2 GB free space
3. System RAM – At least 512 MB

1) How to install Ubuntu 10.10
Go to Ubuntu Home page Ubuntu and download Ubuntu 10.10 desktop and install.

2) Download Oracle 11g release 2
1Go to Oracle website 
2. Log in. You need to have an oracle account to download
3. Make sure you are downloading Oracle 11g release 2 for 32 bit operating system.
(Direct link – Oracle 11g R2 linux 32 bit opertaing system )
4. Extract both zip files into one folder
E:- Create a Oracle11g folder in desktop and copy both folders into it.

Now we have Ubuntu operating system and Oracle installations files ready.

3) X Server configuration
For Oracle installation in Linux machines need X server configuration.

Steps
1. Open a terminal
2. Connect as root ( You need to have root account )
root@ubuntu$ su – root
3. run ifconfig
root@ubuntu$ ifconfig
Find the ip address. (find for inet addr looks like xxx.xxx.x.x format )
Say,  ip address is 192.120.1.1
4. run  below command
root@ubuntu$ xhost + 192.120.1.1
5. To verify X Server configuration you can use xclock command
root@ubuntu$ xclock
If a clock pop ups server configuration is fine.

4)  Updating packages
If you ave the fresh install of Ubuntu you can skip this step.
Otherwise run below commands

root@ubuntu$ apt-get update
root@ubuntu$ apt-get dist-upgradeRestart
root@ubuntu$ reboot

Install missing libraries
root@ubuntu$ apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm

5) Updating shell and system configurations
Run below commands in sequential order and enter password for your oracle user

root@ubuntu$ cd /bin

root@ubuntu$ ls -l /bin/sh
root@ubuntu$ ln -sf bash /bin/sh
root@ubuntu$ ls -l /bin/sh
root@ubuntu$ lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash
root@ubuntu$ cd /root
root@ubuntu$ addgroup oinstall
root@ubuntu$ addgroup dba
root@ubuntu$ addgroup nobody
root@ubuntu$ usermod -g nobody nobody
root@ubuntu$ useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
root@ubuntu$ passwd oracle
root@ubuntu$ mkdir /home/oracle
root@ubuntu$ chown -R oracle:dba /home/oracle

root@ubuntu$ ln -s /usr/bin/awk /bin/awk
root@ubuntu$ ln -s /usr/bin/rpm /bin/rpm
root@ubuntu$ ln -s /usr/bin/basename /bin/basename
root@ubuntu$ mkdir /etc/rc.d
root@ubuntu$ for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done

root@ubuntu$ mkdir -p /u01/app/oracle
root@ubuntu$ chown -R oracle:dba /u01

Change the run level if it is 2 or 3 (It should be 5 for oracle install)
root@ubuntu$ telinit 5

Now we need to update few configuration files

1. /etc/sysctl.conf
Run below command and add the following entries at the end of the file.
root@ubuntu$ gedit /etc/sysctl.conf

fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

2. /etc/security/limits.conf
Run below command and add the following entries at the end of the file.
root@ubuntu$ gedit /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

3. /etc/pam.d/login

Run below command and add the following entries at the end of the file.
root@ubuntu$ gedit  /etc/pam.d/login

session required /lib/security/pam_limits.so
session required pam_limits.so
Run below command or re-start
root@ubuntu$ sysctl -p

6) Oracle Installation
Now we are almost ready for Oracle Installation.
Log in as oracle user.

user@ubuntu$ su – oracle
Password:

For oracle user also need x server setup. Try to run xclock command. If it pop ups we are fine. Otherwise go to step 3)

oracle@ubuntu$ xclock

Go to the folder we have extracted the Oracle 11g.
oracle@ubuntu$ cd /home/user/Desktop/Oracle11g
oracle@ubuntu$ cd database1
oracle@ubuntu$ ./runInstaller

Wait few seconds. It will launch Oracle 11g installation wizard.

Starting Oracle Universal Installer…

Checking Temp space: must be greater than 80 MB.   Actual 80115 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3917 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall

Click Next. Chose custom installation. Enter database configuration parameters while prompting. In pre-requisite check it will show there are some library files are missing. Just ignore those and continue installation.

6) Setting environment variables


First make sure
1) /u01/app/oracle/product/11.2.0/dbhome_1 is exists
2) /u01/app/oracle/product/11.2.0/dbhome_1/bin exists
3) orcl is the tnsname specified at installation.
 
Add the below entries in /etc/profile as root user

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin
export ORACLE_SID=orcl

7) Running Oracle 11g first time
Log in as oracle

oracle@ubuntu$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1

oracle@ubuntu$ echo $ORACLE_SID
orcl

oracle@ubuntu$ sqlplus /nolog
It connect to SQL as idle instance. Execute below commands. Enter password created for sys at installation. Start database using startup command

SQL >

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> startup

SQL> select count(*) from all_objects;

COUNT(*)
————–
70778

Congratulations ! You have successfully installed Oracle 11g on Ubuntu.

Related posts

Install Oracle 11g on Windows 7
Oracle interview questions and answers

Please post your comments below, share this link and click like button.
Advertisements

Author: sqlandplsql

To learn more about the Oracle, SQL, PL SQL, Performance Tuning, Database Modeling, Ubuntu, MySQL etc .Suggestions, comments, feedbacks and referrals are highly appreciated.

13 thoughts on “Installing Oracle 11g on Ubuntu”

  1. Hello! Thank you for this post, it is very useful!
    But i have a problem:
    I installed software, and then i want to create database, but I have exception:

    oracle@server:
    cd $ORACLE_HOME/bin
    dbca

    An unexpected error has been detected by HotSpot Virtual Machine:
    #
    # SIGSEGV (0xb) at pc=0x9cfe935e, pid=1778, tid=3076716224
    #
    # Java VM: Java HotSpot(TM) Server VM (1.5.0_17-b02 mixed mode)
    # Problematic frame:
    # C [libnnz11.so+0x3c35e]
    #
    # An error report file with more information is saved as hs_err_pid1778.log

    I don’t have need experience for fix it, please help me.

      1. Sorry, I don’t save this file. I found on forum reason of trouble: I installed 32-bit software on 64-bit hardware

  2. Hi,
    Everything works well for me till 6) Oracle Installation step. After that i login as a oracle user i am not able to setup x server setup for oracle user, i try step 3 as a oracle user, but i am not able to do ifconfig it tells me permission denied (infact none of the command runs as were running as root user) It says that the oracle user needs administrative access. Hence i added oracle user to the group of admin users. Need help what to do? I desperately need to setup oracle on my ubuntu system. I am not the admin of my system, but i am a 2nd user who has root access.

      1. Hi,

        The error is below:
        $ xclock
        No protocol specified
        Error: Can’t open display: :0

        The oracle use has no permission to run the xhost command. I got around this by running the below from root:
        $ xhost +
        access control disabled, clients can connect from any host

  3. Hi, I got the error – “semmi does not the correct – estimated:128 real:0”, but I now that this value i had in the /etc/sysctl.conf with “kernel.sem = 250 32000 100 128”.

    I got this value with #ipcs -ls

    I don’t understand why or where is the error..

    Could you help me?

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