Oracle 11g release 2 XE on Ubuntu 14.04

There are many, many links, threads, bugs and discussions related to this since oracle 11g installation is no longer breeze at it was the case with oracle 10g, at least on Ubuntu. This is my short, minimal list of things to do to have oracle running on Ubuntu 14.04 12.04.

Last updated 2014-05-01, install on 14.04
Last updated 2013-12-25, install on 12.04.3.

0. backup. If you have a previous oracle install backup your databases with expdp. Warn: move the dumps to a safe location since the apt-get remove –purge could delete them.

1. download the package

2. unzip it


3. convert it to a deb and install it

cd Disk1
alien --scripts oracle-xe-11.2.0-1.0.x86_64.rpm
apt-get remove --purge oracle-xe-universal #remove 10g if needed
apt-get install libaio1 #oracle needs this
dpkg -i oracle-xe_11.2.0-2_amd64.deb

(you might get a missing chkconfig error which can be ignored)
4. until now everything is simple, now the trouble begins. The main oracle problem is with the missing /dev/shm which, in 12.04 is a link to /run/shm. The fix for this is to remove the link and mount it yourself:

rm /dev/shm
mkdir /dev/shm
mount -t tmpfs shmfs -o size=2048m /dev/shm
sysctl kernel.shmmax=1073741824 #also edit /etc/sysctl.conf and set the same value to persist the change

ln -s /usr/bin/awk /bin/awk #small fix to eliminate some errors
It might also be necessary to create /var/lock/subsys if it does not exist (created by another package).

4.1 the above changes can be integrated in /etc/init.d/oracle-xe

  • change the AWK path
  • change /var/lock/subsys with /var/lock
  • add the /dev/shm lines

The diff from the old and new files looks as following:

< if [ -z "$AWK" ]; then AWK=/usr/bin/awk; fi
> if [ -z "$AWK" ]; then AWK=/bin/awk; fi
< 	touch /var/lock/listener
> 	touch /var/lock/subsys/listener
< 	touch /var/lock/oracle-xe
> 	touch /var/lock/subsys/oracle-xe
< 	if [ -L /dev/shm ]; then
< 	    rm -rf /dev/shm
< 	    mkdir /dev/shm
< 	    mount -t tmpfs shmfs -o size=2048m /dev/shm
< 	fi
< 			touch /var/lock/listener
> 			touch /var/lock/subsys/listener
< 		touch /var/lock/oracle-xe
> 		touch /var/lock/subsys/oracle-xe
<     if [ $RETVAL -eq 0 ] && rm -f /var/lock/listener
>     if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/listener
< 	rm -f /var/lock/oracle-xe
> 	rm -f /var/lock/subsys/oracle-xe

5. run the configure

/etc/init.d/oracle-xe configure

There will be some errors but the process will succeed finally.

Thats it. Oracle will now run and no more:

ORA-27101: shared memory realm does not exist

Before restarting the machine add the /dev/shm related lines from point 4 to /etc/init.d/oracle-xe in the start function somewhere around line 555.

6. If you are used to apex and don’t know what an workspace is you first need to access: http://localhost:9090/apex/apex_admin and use admin/[password provided to configure script] to login

7. Env vars for oracle are:

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/ #you should know already that the last / is very important

8. If you get an:

UDI-01034: operation generated ORACLE error 1034
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
UDI-00003: all allowable logon attempts failed

for impdb note that this is due to the fact that impdp no longer uses the ORACLE_SID variable. To fix just use for instance:

impdp system@XE/blabla

… instead of

impdp system/blabla ...

9. links:

7 Responses

  1. really helped! thank you!

  2. Worked like a charm. Thanks.

  3. Eduardo Rebouças

    You saved my day. Thanks.

  4. It worked in Ubuntu 14.04 also.
    Thanks: really useful and straightforward.

  5. Great!

    One of the best step-by-step procedure which I have come across, works like a charm!


    Thanks much!

  6. Thanks. Great and very helpful post.

    One thing

    Under 4.1, looking at the diff file, did you mean &lt or &gt ?

    I thought it should be

    > if [ -L /dev/shm ]; then
    > rm -rf /dev/shm
    > mkdir /dev/shm
    > mount -t tmpfs shmfs -o size=2048m /dev/shm
    > fi

    instead of

    < if [ -L /dev/shm ]; then
    < rm -rf /dev/shm
    < mkdir /dev/shm
    < mount -t tmpfs shmfs -o size=2048m /dev/shm
    < fi

  7. Great post, thanks! Worked for me on Ubuntu 14.04. Saved me so much time!

Leave a Reply