Installing Oracle 10g on Ubuntu 9.10 (Karmic Koala) Server 64-bit

27 Apr

Source: Installing Oracle 10g On Ubuntu Karmic 64 Bit or OtherwiseInstalling Oracle 10g On Ubuntu Karmic 64 Bit Or Otherwise (Part 2)

So apparently I needed to install Oracle 10g to Ubuntu, and ran through a lot of hassles. I found a guide that’s well written but had some trouble with 64-bit server, and am writing for this for others who will encounter some trouble as well.

I’m breaking this down the following sections:

  1. Installing Required Libraries
  2. Setting Up Users and Groups
  3. Setting Kernel Parameters
  4. Emulating SUSE and Red Hat
  5. Setting Up the Oracle Environment
  6. Installing Oracle
  7. Creating the Listener
  8. Creating a Database
  9. Creating Startup/Shutdown Scripts

Installing Required Libraries

Since Ubuntu is not an officially supported OS, we need to emulate those that are, and since Oracle mixes 32-bit and 64-bit libraries, we need to install i386, and even ia32 libraries. Run the following:

sudo apt-get install libaio1 rpm gcc-multilib libc6-dev-i386 libc6-dev-i386 libc6-i386 ia32-libs

In addition, doesn’t come with LIBSTDC++5, so you have to install manually installing the package. Run the following:

wget ""
ar vx libstdc++5_3.3.6-17ubuntu1_amd64.deb
tar zxvf data.tar.gz
file usr/lib/
sudo install usr/lib/ /usr/lib32/
cd /usr/lib32
sudo ln -s
cd /usr/lib
sudo ln -s /usr/lib32/

Setting Up Users and Groups

We need to create the group oinstall, dba, and nobody, and create a user named oracle. Run the following:

sudo groupadd oinstall
sudo groupadd dba
sudo groupadd nobody
sudo useradd -m oracle -g oinstall -G dba -s /bin/bash

And don’t forget to change the password.

sudo passwd oracle

Take note of the oinstall group ID as you will need this in setting the Kernel Parameters later. Do this by running the code below:

cat /etc/group | grep oinstall

The ID should be in the format 10XX. If it’s a newly installed system, it should be 1002.

Setting Kernel Parameters

We need to override the kernel parameters by running the following:

sudo vi /etc/sysctl.conf

And add the settings below at the bottom of the file. Take note that the [oinstall_group_id] should be replaced with what you got in the steps above (1002).

vm.hugetlb_shm_group = [oinstall_group_id]
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

Reload the parameters by running the following:

sudo /sbin/sysctl -p

We also need to edit limits of the system. Edit the limits.conf file by running:

sudo vi /etc/security/limits.conf

Add add the settings below to the bottom of the file.

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

Emulating SUSE and Red Hat

We emulate SUSE by creating symbolic links of the following:

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

We emulate Red Hat by creating the redhat-release file to trick the Oracle Installer that we are using Red Hat. =) Edit the file:

sudo vi /etc/redhat-release

And add the following:

Red Hat Enterprise Linux AS release 3 (Taroon)

Setting Up the Oracle Environment

I normally install my oracle database inside /opt so from hereon, you have to take note that /opt/oracle/10g will be the oracle home, and /opt/oracle will be the oracle base. The SID I will be using here will be orcl. Run the following:

sudo mkdir -p /opt/oracle/10g
sudo chown -R oracle:oinstall /opt/oracle
sudo chmod -R 775 /opt/oracle

Update environment profile by editing the global profile.

sudo vi /etc/profile

And add the following settings at the bottom.

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/10g
export ORACLE_SID=orcl

Installing Oracle

Proceed with installation. My install directory is in /home/installers Unpack the downloaded oracle installer:

gunzip 10201_database_linux_x86_64.cpio.gz
cpio -id < 10201_database_linux_x86_64.cpio
sudo chown -R oracle:oinstall .

Normally, Ubuntu Server doesn’t have X server installed, so you will have problems running the installer as it actuallly has GUI. The easiest way to install this is to access a desktop with X server, and create a connection with SSH forwarding.

ssh -X oracle@oracle-server

From there, fire up the installer:

cd /home/installers/database

The GUI should come out on your client machine. Once the installer is up, uncheck the “Create Starter Database” option, and keep clicking on Next to accept the defaults.

If you encounter some error about the “collector” you can just ignore this as Ubuntu is not supported.

After the installation, the installer will ask you to run two scripts as root. Run them as is.

Oracle is Installed! X_X

Creating the Listener

We create the listener by running the Network Configuration Assistant (needs X server). As with the installer, we need to have X forwarding enabled. The command should be in the oracle path, if not, there might have been a problem with setting up the oracle environment. Run the following as oracle user:


Just use the defaults and create the listener.

Creating the Database

We create a database by running the Database Configuration Assistant (needs X). We also need X forwarding enabled here. Run the assistant with the following:


Create the database as you please. Although you have to take note of the Database Name/SID, and it should match the ORACLE_SID environment variable you set on the /etc/profile file.

Creating Startup/Shutdown Scripts

First, we need to edit the /etc/oratab file.

sudo vi /etc/oratab

My oratab file contains the following:


Change the last character, N, to Y.

Next, we edit dbstart as oracle user. Run the following:

vi $ORACLE_HOME/bin/dbstart

Look for the following line:


Just change that to your ORACLE_HOME (/opt/oracle/10g) and save the file.

Create a startup script found in /etc/init.d/ named dbora. The following script is taken here. Take note of the ORACLE_HOME and ORACLE_SID variables.

# /etc/init.d/dbora
# Startup script for Oracle databases

export ORACLE_HOME=/opt/oracle/10g
export ORACLE_SID=orcl

case "$1" in
echo -n "Starting Oracle: "
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle

su oracle -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
echo "Usage: 'basename $0' start|stop"
exit 1
exit 0

Modify the file so it is executable

sudo chmod 775 /etc/init.d/dbora

Register it in Ubuntu’s startup script by running the following:

sudo update-rc.d dbora defaults 99

Everything should be working as is. Try to access Enterprise Manager by accessing port 1158 (default) through HTTP.


Tags: , , , , , , , , ,

Leave a Reply


  1. vadil

    2010/05/11 at 12:21 PM

    how if i want to install on /etc/installer not at /home/installer ? is ok ? because /home directory is small. thnaks !!!

  2. dukz

    2010/05/11 at 2:38 PM

    @vadil: The /home/installer directory is actually where the installer is. The location of the oracle home folder (where it will be installed) is defined by the environment variables $ORACLE_HOME and $ORACLE_BASE, in this post, it assumes that oracle will be installed in /opt/oracle.

  3. Installing Oracle Database 10g Release 2 On GNU/Linux Ubuntu 10.04.1 Lucid Lynx 32 bit » Andrey Ferriyan

    2010/12/29 at 9:14 AM

    [...] di blog ini. Masih seputar installasi Oracle 10g di GNU/Linux. Rujukan artikel ini bisa dilihat di ObsessiveCoder, requirement yang digunakan pada hardware dan softwarenya sedikit berbeda. Tadinya mau install yang [...]

  4. yoso

    2011/05/10 at 3:50 PM

    that’s good,, thank you :-)

  5. Cheap Webhost

    2011/11/24 at 7:44 AM

    Great items from you, man. I’ve consider your stuff prior to and you are just too wonderful. I really like what you’ve bought right here, really like what you are saying and the way by which you are saying it. You make it entertaining and you continue to care for to keep it sensible. I cant wait to read much more from you. That is actually a great site.

  6. Ejaculation trainer: how to last long in bed

    2011/12/22 at 11:33 PM

    wonderful points altogether, you simply received a new reader. What could you recommend about your publish that you just made some days ago? Any positive?

  7. i’m

    2013/06/03 at 1:45 PM

    Good site! I really love how it is simple on my eyes and the data are well written. I’m wondering how I could be notified whenever a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a great day!

  8. Patriot

    2013/06/20 at 4:56 PM

    Article writing is also a excitement, if you be familiar
    with after that you can write if not it is difficult to write.