Installing Oracle 11g ( DB On Ubuntu 10.10 32 Bit

Having recently created an Ubuntu 10.10 VirtualBox image for my Oracle databse installation I have decided to bring my notes together as a simple blog entry that I hope will allow other people to quickly do the same. The reason for this entry is because the information required to successfully complete the installation is spread around the documention. Hence I felt some short concise, I hope, instructions would be useful. I assume that the user does have an understanding of Ubuntu and Oracle database installation and hence do not go into details on all the commands.

Update Packages

apt-get update
apt-get update

apt-get install elfutils libaio1 libaio-dev libstdc++6-4.4-dev numactl pdksh sysstat unixODBC-dev unixODBC build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm

Create Groups

groupadd oinstall
groupadd dba
groupadd nobody

usermod -g nobody nobody

Create / Update oracle User

useradd -s /bin/bash -m -g oinstall -G dba oracle passwd oracle

The following command is required to successfully run the installer.

xhost local:oracle

Configure Limits for oracle

sudo gedit /etc/security/limits.cong

Add :

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

Configure System

sudo gedit /etc/sysctl.conf

Add :

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 = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304

Make Directories

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

Link command to location expected by oracle installer

ln -s /usr/bin/awk /bin/awk  
ln -s /usr/bin/rpm /bin/rpm  
ln -s /usr/bin/basename /bin/basename

Run Installer

I assume here that the user has previously installed the oracle database. If not simply follow the default options when the database installer executes.


Post Install

Add the following to /etc/profile

export ORACLE_BASE=/u01/app/oracle  
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1  
export ORACLE_OWNR=oracle  

Start Script

Create /etc/init.d/oracledb with the following contents:

# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab
export ORACLE_OWNR=oracle
export ORACLE_OWNER=oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
    echo "Oracle startup: cannot start"
    exit 1

case "$1" in
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        touch /var/lock/oracle
        echo "OK"
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        rm -f /var/lock/oracle
        echo "OK"
        $0 stop
        $0 start
        echo "Usage: `basename $0` start|stop|restart|reload"
        exit 1

exit 0

Execute :

cd /etc/init.d
update-rc.d oracledb defaults 99

The above will create links within the rc\*.d directories.

Edit oratab Script

Modify /etc/oratab so that the db is started with the os the sid line should look like the following:

# This file is used by ORACLE utilities.  It is created by
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
# Entries are of the form:
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
# Multiple entries with the same $ORACLE_SID are not allowed.

Checking it all works

Shutdown your VirtualBox Ubuntu and change the Network Configuration to Host Only Adapter, this is used to provide and internal loop back with VirtualBox and the os it is running on, and then restart. Once that instance is running log on and execute the following:


It should return something like the following:

oracle@ubuntu-oracle-11g:~$ /sbin/ifconfig
eth1      Link encap:Ethernet  HWaddr 08:00:27:c7:f4:7b 
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a00:27ff:fec7:f47b/64 Scope:Link
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3355 (3.3 KB)  TX bytes:7381 (7.3 KB)

lo        Link encap:Local Loopback 
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:710 errors:0 dropped:0 overruns:0 frame:0
          TX packets:710 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:53972 (53.9 KB)  TX bytes:53972 (53.9 KB)

As you can see this shows that the IP address is On your system add an entry to the "hosts" file (oracle11gdb) and then use your favourite DB tool to access the database at :


This should connect and allow you access to the database.


Was the installation done using or ? 32-bit or 64-bit ?

Posted by Jeroen on December 26, 2010 at 05:02 PM GMT # on Ubuntu 10.10 32 Bit

Posted by Andrew on January 04, 2011 at 01:42 AM GMT #

great work
it helps a lot
thank you!!

Posted by bcsachith on January 31, 2011 at 10:52 AM GMT #

regarding startup script...

why youre not using the oraenv script?

Posted by nuttijay on February 12, 2011 at 08:53 AM GMT #

Hello What happens if oracle user name is different from "oracle"? What should I change? Thank You JCV

Posted by guest on June 09, 2011 at 03:21 AM GMT #

If your user is not oracle then you will need to replace "oracle" with you user in the following: 1) Configure Limits 2) xhost 3) chown 4) Start / Stop script That should do it.

Posted by guest on June 09, 2011 at 04:18 AM GMT #

Thank's for your reply. Made what you said,bet did not work. When I execute: /etc/init.d/oracledb start I get the answer : "command not found" JCV

Posted by JCV on June 09, 2011 at 08:14 AM GMT #

I assume your start script looks something like that below: export ORACLE_OWNR=<YOUR NAME> export ORACLE_OWNER=<YOUR NAME> .... export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 If so can you try sudo bash and then execute su <YOUR NAME> -c "<ORACLE HOME DIR>/bin/lsnrctl start" su <YOUR NAME> -c "<ORACLE HOME DIR>/bin/dbstart <ORACLE HOME DIR>" then we can see which command is not found.

Posted by Andrew on June 09, 2011 at 08:54 AM GMT #

When trying dbstart as you said, I get the folowing message: pam_mount(spawn.c:128): error setting uid to 0 JCV

Posted by JCV on June 09, 2011 at 09:14 AM GMT #

Seems like this could be a bug in ubuntu ( although I have not seen it myself. I'll see if I can find a work around.

Posted by Andrew on June 09, 2011 at 10:28 AM GMT #

Thanks a lot

Posted by JCV on June 09, 2011 at 11:25 AM GMT #

Thank you for your support, I'm going to delete the VM and setup a new one with "oracle" user. Yours José Carlos Vieira

Posted by JCV on June 13, 2011 at 01:27 AM GMT #

Post a Comment:
Comments are closed for this entry.

As a member of the Oracle A-Team we specialise in enabling and supporting the Oracle Fusion Middleware communities.


« April 2014