Wednesday, June 13, 2012

Trouble-shooting oracle 11g installation on Ubuntu

In my one of the previous post ( http://meandmyubuntulinux.blogspot.com/2012/05/installing-oracle-11g-r2-express.html ) , 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 :

#!/bin/sh
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 ;;
esac

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.

Reference:
1) Ubuntu man-page 

29 comments:

  1. Thank you for your tutorial!!! It is really the only working one :)

    In addition to this steps I had to:

    1) Create folder /etc/sysconfig

    2) Create file /etc/init.d/functions:
    success()
    {
    echo " [ok]"
    }
    failure()
    {
    echo " [failed]"
    }

    from post http://goo.gl/zYi3T

    ReplyDelete
    Replies
    1. Neither me nor my any of the friends ( in whose system i installed oracle 11g XE ) needed these extra steps which you mentioned / used . So, it may not be needed to use these extra steps on all systems.

      Delete
  2. I had to do these steps to get my Oracle XE running in Ubuntu 12.04 Virtual machine. Thanks a lot for this troubleshooting steps.

    ReplyDelete
  3. Thanks Manish :)

    ReplyDelete
  4. Hi thanks for you tutorial I was trying to install oracle xe and I got the next trouble while i was trying to start the service

    Error:
    Oracle Database 11g Express Edition is not configured. You must run
    '/etc/init.d/oracle-xe configure' as the root user to configure the database.

    could you help me please?




    ReplyDelete
    Replies
    1. Have you already run the above command ( sudo /etc/init.d/oracle-xe configure ) ?? If not, then you have to perform the steps 6(ii) and onwards of the post " http://meandmyubuntulinux.blogspot.com/2012/05/installing-oracle-11g-r2-express.html " to get the Oracle 11g XE running.

      Please feel free to re-post if you still get the error.

      Delete
    2. Hi I ran the 6 (ii) step but Listner got started but the Configuration failed with the log file mentioned following:

      CloneRmanRestore.log
      cloneDBCreation.log
      postDBCreation.log
      postScripts.log

      Delete
    3. Same thing for me, any solution for this one?

      Delete
  5. Hi Manish Raj here i am again thanks for replaying, I've tried what you said but when I'm doing the configuration part i get the following error:

    Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

    i don't know if it is because i did something wrong or miss a step... hope you could help again please i really need it.. thanks for your time....

    ReplyDelete
    Replies
    1. I think it's better if you start over again and re-install the entire Oracle 11g XE. The procedure is given in starting of this post.

      Delete
  6. fantastic post! thank you for sharing.

    ReplyDelete
  7. Hi. Thank you for the post. However, i ran into some problems. When i try to delete shared memory folder it says device or resource too busy. I am basically uninstalling and reinstalling it.

    ReplyDelete
    Replies
    1. That's perfectly normal . You actually don't need to delete the shared memory folder for un-installing or re-installing the Oracle 11g XE. Keeping that folder won't do any harm to the normal working of the system.

      Delete
  8. Hi Manish,

    Again there seems to be a problem. I uninstalled and reinstalled again. Immediately i created another user through sys("gokul") granted all privilege. However, when i logged out and restarted the system. I keep getting the error:

    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    Session ID: 0 Serial number: 0

    I really dont understand what happened?

    Sorry to bug you,

    thanks,
    gokul.

    ReplyDelete
  9. Hi again,

    I resolved that problem. It seems that the instance was down. so started up and it started running. however if i try to restart the listener it throws the following error:
    Starting /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr: please wait...

    TNSLSNR for Linux: Version 11.2.0.2.0 - Production
    System parameter file is /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
    Log messages written to /u01/app/oracle/diag/tnslsnr/gocool/listener/alert/log.xml
    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    TNS-12555: TNS:permission denied
    TNS-12560: TNS:protocol adapter error
    TNS-00525: Insufficient privilege for operation
    Linux Error: 1: Operation not permitted

    ReplyDelete
    Replies
    1. Seems like you are trying to re-start the listener using normal user. Do the same using root ( Hint... try appending your command with sudo ).

      Delete
  10. It says lsnrctl : command not found. Also, the strange thing i noticed is there was a oracle user created, when i finished installing Oracle 11g express edition for Ubuntu.

    ReplyDelete
    Replies
    1. Seems like you haven't added the lines ( as I wrote in my post ( http://meandmyubuntulinux.blogspot.com/2012/05/installing-oracle-11g-r2-express.html ) to your .bashrc . You have to add those lines to both root's .bashrc as well as the user which you use to access the Oracle 11g db .

      For the oracle user, it's all fine because it is the default user for oracle 11g.

      Delete
  11. Hi Manish, I installed it and it installed successfully. However, when trying to start the database, I got the following error:

    muqhtar@muqhtar-HP-620:~$ sudo service oracle-xe startStarting Oracle Net Listener.
    Starting Oracle Database 11g Express Edition instance.
    Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.

    I then tried to start the listener manually:

    muqhtar@muqhtar-HP-620:~$ sudo /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr
    /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

    Thanks for reverting..

    ReplyDelete
    Replies
    1. Dear Friend,

      Seems like you haven't installed the libaio1 package as per the instructions in Step 3 of http://meandmyubuntulinux.blogspot.com/2012/05/installing-oracle-11g-r2-express.html. Kindly do the same and you will not get this error. You will also need to re-configure the Oracle XE . For this do the following :
      1) sudo apt-get install libaio1
      2) sudo /etc/init.d/oracle-xe stop
      3) sudo rm /etc/default/oracle-xe
      4) sudo /etc/init.d/oracle-xe configure
      After this you can proceed with starting the database.
      Hope this will help...

      Delete
  12. Dear Manish,

    Thank you for the tip. It did work.
    My regards...

    ReplyDelete
  13. Where are emca and emcl scripts ??

    ReplyDelete
  14. Excelent tutorial!!! thanks from Dominican Republic...

    ReplyDelete
  15. Hi, thanks for your tutorial. I was trying to install oracle xe and I got the next trouble while i was trying to start the service

    Error:
    Oracle Database 11g Express Edition is not configured. You must run
    '/etc/init.d/oracle-xe configure' as the root user to configure the database.

    Also I already run the command: sudo /etc/init.d/oracle-xe configure. Could you help me???

    ReplyDelete
    Replies
    1. Did you do the steps of the troubleshooting part? It happened to me as well, the toubleshooting part is a must ;)

      Delete
  16. Después de googlear tanto di con este post, buenísimo, me funcionó perfectamente.

    After google a lot i found this post, the best, it works perfect

    ReplyDelete
  17. This saved my evening. Thank you!

    ReplyDelete
  18. I was able to install finally. Thanks for this post man. Saved lot of time :)
    Chandan

    ReplyDelete