Wednesday, June 13, 2012

Trouble-shooting oracle 11g installation on Ubuntu

In my one of the previous post ( ) , I told you about steps for installation of Oracle 11g R2 express edition on Ubuntu. But I found out that many of you are facing problems in installing using the given steps. So, I came up with an idea of adding a trouble-shooter post which can enable you to have a hassle-free installation experience.
                Most of the time, if you followed the steps in previous post then you should be able to reach at least up to the configuration part ( Step # 6(ii) ). If you face any problem before this step then you must perform re-installation. For this do the following :
1) Enter the following command on terminal window :
sudo -s
/etc/init.d/oracle-xe stop
ps -ef | grep oracle | grep -v grep | awk '{print $2}' | xargs kill
dpkg --purge oracle-xe
rm -r /u01
rm /etc/default/oracle-xe
update-rc.d -f oracle-xe remove

2) Follow the steps given in the previous post to install the Oracle 11g XE again.

Now, once you have reached the configuration part. Do the following to avoid getting MEMORY TARGET error ( ORA-00845: MEMORY_TARGET not supported on this system ) :
sudo rm -rf /dev/shm
sudo mkdir /dev/shm
sudo mount -t tmpfs shmfs -o size=2048m /dev/shm

(here size will be the size of your RAM in MBs ).

The reason of doing all this is that on a Ubuntu system  /dev/shm is just a link to /run/shm but Oracle requires to have a seperate /dev/shm mount point.

Update: Few people have also reported ORA-01031: insufficient privileges error . To avoid this simply use "oracle" ( without quotes ) as your password for sys / system user while in configurations step.

3) Next you can proceed with the configuration and other consequent steps.

To make the change permanent do the following :

a) create a file named S01shm_load in /etc/rc2.d :

sudo vim /etc/rc2.d/S01shm_load

Now copy and paste following lines into the file :

case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
       touch /var/lock/subsys/listener
       rm /dev/shm 2>/dev/null
       mkdir /dev/shm 2>/dev/null
       mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
   exit 1 ;;

b) Save the file and provide execute permissions :

         sudo chmod 755 /etc/rc2.d/S01shm_load

This will ensure that every-time you start your system, you get a working Oracle environment.

If you face any other problem while installing Oracle 11g R2 XE on Ubuntu, please feel free to ask as comments.

1) Ubuntu man-page