Howto install Oracle 11XE Beta on Ubuntu 10.04 x64

I have just seen that the new 11G XE beta is out for Windows and Linux x64 and decided to try it out. You can download it at http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html.

Unfortunately there is just an RPM and no DEB file. Here is the way how I achieve to run it on my Ubuntu 10.04 LTS x64.

Create a .deb out of the RPM

I used alien for the conversion, the resulting .deb is not a perfect one but it is a good start:

sudo apt-get install alien
sudo alien -d --scripts oracle-xe-11.2.0-0.5.x86_64.rpm

Installation

Now I tried to install it but I got an error from /var/lib/dpkg/info/oracle-xe.postinst that /sbin/chkconfig does not exist. As I don't want to have Oracle started automatically on my laptop anyway I have just commented out the whole section of the script:

if [ -f /etc/SuSE-release ]
then
        /usr/lib/lsb/install_initd oracle-xe > /dev/null 2>&1
        /sbin/insserv oracle-xe > /dev/null 2>&1
        /sbin/SuSEconfig > /dev/null 2>&1
#else
#        /sbin/chkconfig --add oracle-xe
fi

then I ran the script again and it went fine:

# sudo /var/lib/dpkg/info/oracle-xe.postinst
Executing post-install steps...


You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.


Additional dependencies

Before doing the configuration I had to install the following dependency (which was not installed by apt-get)

sudo apt-get install libaio1

Sanity checks

Before you proceed I would advice to make some sanity checks and see if the installation was successful

Oracle user and group

grep oracle /etc/passwd
oracle:x:1001:1001::/u01/app/oracle:/bin/bash
grep dba /etc/group
dba:x:1001:

If you don't see the oracle user or/and the group dba, something went wrong and I would deinstall the package, remove /u01 (sudo rm -rf /u01), create them manually and start the installation again

Check if the placeholder in the init.ora file are correctly replaced

# grep sga /u01/app/oracle/product/11.2.0/xe/config/scripts/init*
/u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora:sga_target=805306368
/u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora:sga_target=805306368

If you see real numbers there then everything is OK, if you see %sga_target% instead of the numbers then the step with executing /var/lib/dpkg/info/oracle-xe.postinst was not ok

Check the owner and permissions

# ls -latr /u01/app/oracle/product/11.2.0/xe/bin/oracle
-rwsr-s--x 1 oracle dba 178499800 2011-03-23 07:05 /u01/app/oracle/product/11.2.0/xe/bin/oracle

If the owner is not oracle:dba then probably the user and the group were not created correctly so I would create them manually, remove the installation and the files and reinstall again (see further how to create the user and the group

Configure the database

Run

sudo /etc/init.d/oracle-xe configure

It will ask you for a password, ports for the listener and for the APEX server, you can accept the defaults. After some time it will say that everything is fine.

(Optional) Create the oracle user and dba group manually

Create the dba group and oracle user:

sudo /usr/sbin/groupadd dba

 sudo /usr/sbin/useradd -M -g dba -d /u01/app/oracle -s /bin/bash oracle

Create a profile for the oracle user (vi/u01/app/oracle/.bash_profile and put the following settings)

export ORACLE_SID=XE
alias vi='vim'
export ORACLE_BASE=$HOME
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe
export ORACLE_TERM=xterm
export _EDITOR=vim
export NLS_LANG=american_america.utf8
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH

Verify the database

Login with the user oracle and run some select statement

sudo su - oracle
sqlplus / as sysdba

select count(1) from all_objects;

If everything is fine you should get around 17901 objects.

Now you can try APEX too: goto http://localhost:8080/apex (if you have accepted the default port during the installation)

official Documentation

Update

Thanks to the feedback in the comments, it seems that there is a short cut to install chkconfig before you try to install the .deb package.

So here is the short sequence (copied from Kamran's comment):

if you don't like to have the oracle-xe started automatically on every boot, you have to disable it:

Alexander Penev
ByteSource Technology Consulting GmbH http://bytesource.net

  1. Apr 11, 2011

    Anonymous

    Great tutorial, thanks!

  2. Apr 16, 2011

    Anonymous

    Nice job, this is a big help.

    Note - I think in the "Configure" section the "configure" argument needs to be added:
    /etc/init.d/oracle-xe configure

    1. Apr 17, 2011

      Sure, thank you for the correction.

  3. Apr 25, 2011

    Anonymous

    hi, i'm following your step above, i even try more than 3 times, and still doesnt work (sad) ....

    Starting Oracle Net Listener...Done
    Configuring database...grep: /u01/app/oracle/product/11.2.0/xe/config/log/*.log: No such file or _directory
    grep: /u01/app/oracle/product/11.2.0/xe/config/log/*.log: No such file or directory

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

    also i still have %sga_target%

    1. grep sga /u01/app/oracle/product/11.2.0/xe/config/scripts/init*

    i do installing libaio1 too

    did i miss something important step??
    thanks

    1. Apr 26, 2011

      Have you edited the /var/lib/dpkg/info/oracle-xe.postinst file, commented out the following line:

      and rerun /var/lib/dpkg/info/oracle-xe.postinst ?

      1. Apr 27, 2011

        Anonymous

        hi, thanks for your reply..

        actually i intend to, but my oracle-xe.postinst only contain following

        /var/lib/dpkg/info/oracle-xe.postinst

        #!/bin/sh
        set -e

        #Automatically added by dh_makeshlibs
        if [ "$1" = "configure" ]; then
        ldconfig
        fi
        #End automatically added section

        and still after i rerun sudo /etc/init.d/oracle-xe configure

        Starting Oracle Net Listener...Done
        Configuring database...
        Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

        i tried to run sqlplus and come with following result

        $ORACLE_HOME/bin$ sqlplus "/as sysdba"

        SQL*Plus: Release 11.2.0.2.0 Beta on Wed Apr 27 16:50:13 2011

        Copyright (c) 1982, 2010, Oracle. All rights reserved.

        Connected to an idle instance.

        SQL> startup
        ORA-01078: failure in processing system parameters
        LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/xe/dbs/initXE.ora'

        its really painful installing Oracle XE on Ubuntu instead of Enterprise edition, but i'm still trying.. hehehehe

        1. Apr 28, 2011

          very strange, here is the file /var/lib/dpkg/info/oracle-xe.postinst should be a copy of the POSTIN from the rpm script an looks like that:

          /var/lib/dpkg/info/oracle-xe.postinst

          I must admit I have no idea where your file comes from. You could try to to create this file manually and run it.
          After that the sga_target should be replaced by the calculated values. Please try this and tell me if you database starts successfully after that.

          Can you write which versions of ubuntu and alien you are using?

          Best regards,
          Alex

          1. Apr 28, 2011

            Anonymous

            hi, thanks for the full script!

            running script /var/lib/dpkg/info/oracle-xe.postinst is now fine
            also /etc/init.d/oracle-xe configure ... great...

            all above instruction is goin smoothly

            except the last one..

            i still get error when verified the database...

            sqlplus "/as sysdba"

            SQL*Plus: Release 11.2.0.2.0 Beta on Thu Apr 28 16:45:28 2011

            Copyright (c) 1982, 2010, Oracle. All rights reserved.

            ERROR:
            ORA-09925: Unable to create audit trail file
            Linux-x86_64 Error: 2: No such file or directory
            Additional information: 9925

            i check the group permission and its seems good .. oracle dba

            ls -lad $ORACLE_HOME/rdbms/audit
            drwxr-xr-x 2 oracle dba 4096 2011-04-27 14:24 /u01/app/oracle/product/11.2.0/xe/rdbms/audit

            i'm keep looking if there is any direction into solving it somewhere..

            btw i'm using ubuntu maverick 10.10
            and alien version 8.81

            1. May 09, 2011

              I have just created a new VM with a stock ubuntu 10.10 64 bit. Then followed my howto step by step and everything went perfect (smile)
              The VM is with 2G RAM, 20G disk space (just 6G used after the install).
              So I would suggest to remove everything (deinstall the .deb, remove /u01) and start from scratch but really sticking 100% to the steps. Very important is to comment the 2 lines of /var/lib/dpkg/info/oracle-xe.postinst and run it again, then do the sanity checks and the rest will work for sure.

              Hope you succeed this time.

              best regards,
              Alex

  4. May 09, 2011

    Anonymous

    thanks alot. this tutorial just made my day.

  5. May 15, 2011

    Anonymous

    There is a wrapper /sbin/chkconfig script around update-rc command:

    http://www.directadmin.com/forum/showthread.php?t=22842

    (NOTE: the script in that web page has double ""s and ""s which should be replaced by single "" and "")

    With this script, there is no need to modify the postinst script.

  6. May 15, 2011

    Anonymous

    Worked perfectly! Thanks for taking the time and making our lives easier...Oracle hasn't got around to it yet (wink)

  7. May 25, 2011

    Anonymous

    Kiss principle....thanks man!

  8. Jun 14, 2011

    Anonymous

    worked for me - thanks allot!

  9. Jun 27, 2011

    Anonymous

    I tried to follow and for strange reason everything probably worked except there is no command to actually "Install RPM". So sudo alien will extract everything from RPM and bundle it into .deb file and does take some time. Once completed you need to run following command sequence.

    $sudo dpkg -i oracle-xe-11.2.0-0.5.x86_64.rpm

    Perhaps the owner of this article could add it to the instructions, unless I am missing it somewhere.

    Kamran Shah

    1. Jun 27, 2011

      Anonymous

      Also...

      Since the installer does require /sbin/chkconfig, it may be worth adding the #sudo apt-get install chkconfig before you do anything. My command sequence was simply below four commands and following the instructions and it worked like magic.

      $sudo apt-get install alien libaio1 chkconfig
      $sudo alien -d --scripts oracle-xe-11.2.0-0.5.x86_64.rpm
      $sudo dpkg -i oracle-xe-11.2.0-0.5.x86_64.rpm
      $sudo /etc/init.d/oracle-xe configure

      Kamran Shah

      1. Jun 28, 2011

        Thanks Kamran, I added an update at the end of the blog!

        Alex

  10. Jul 13, 2011

    Anonymous

    It is possible not to modify installation script with simple adding chkconfig script to the system via
    sudo apt-get install chkconfig

    1. Jul 14, 2011

      sure, it is written as an update at the end of the blog

  11. Jul 26, 2011

    Anonymous

    On Natty Narwhal 11.04 64bit, wasn't able to follow to follow this track successfully. Instead I seem to have Oracle XE 10g working via
    the attack outlined at http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/#comment-196553755 fyi
    – george herson

    1. Jul 27, 2011

      Hi George,

      What kind of problems did you get? Could you paste some more info here?

      Thanks,
      Alex

      1. Jul 27, 2011

        Anonymous

        /etc/init.d/oracle-xe configure

        would either complain that Oracle wasn't available or, if it was available, that it couldn't be started because of a port conflict!

        – george h

        1. Jul 27, 2011

          Can you put a dump of "netstat -nap" run as root here? Probably you have really a port conflict with another service

          1. Jul 28, 2011

            Anonymous

            $ sudo netstat -nap|grep 1521
            tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 1044/tnslsnr
            tcp 0 0 127.0.1.1:1521 127.0.0.1:44318 ESTABLISHED 1044/tnslsnr
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52510 ESTABLISHED 6838/oracleXE
            tcp 0 0 127.0.0.1:44318 127.0.1.1:1521 ESTABLISHED 2940/xe_pmon_XE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52511 ESTABLISHED 6840/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52509 ESTABLISHED 6836/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52505 ESTABLISHED 6828/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52512 ESTABLISHED 6842/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52506 ESTABLISHED 6830/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52508 ESTABLISHED 6834/oracleXE
            tcp 0 0 127.0.0.1:1521 127.0.0.1:52507 ESTABLISHED 6832/oracleXE
            tcp6 0 0 127.0.0.1:52510 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52509 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52512 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52505 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52507 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52511 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52508 127.0.0.1:1521 ESTABLISHED 3140/java
            tcp6 0 0 127.0.0.1:52506 127.0.0.1:1521 ESTABLISHED 3140/java

            From my memory of a week ago and looking at my command history of the time:
            544 ps -ef|grep -i ora
            545 kill 1702
            546 sudo kill 1702
            547 netstat -a --numeric-ports|grep 1521
            548 sudo /etc/init.d/oracle-xe configure
            I believe I confirmed that killing Oracle process 1702 freed up my port 1521 but that i again ran into the issue that
            sudo /etc/init.d/oracle-xe configure
            failed complaining Oracle wasn't available ("ORA-01034: ORACLE not available" litters my /u01/app/oracle/product/11.2.0/xe/config/log/ files). That's when I finally changed tact to trying the Oracle 10g .deb download.

            – george h

            1. Jul 28, 2011

              Hi George,

              Thanks for the listing but this seems to be the status after installing and running the XE. In order to find the reason why the 11G XE is not installing we would need the listing of ports without running Oracle.

              Best regards,
              Aex

              1. Jul 28, 2011

                Anonymous

                Last week I wasn't running Oracle 10g so this probably isn't what I'd have gotten then, but after clicking Oracle XE 10g's Stop Database and exiting NetBeans:

                $ sudo netstat -nap|grep 1521
                tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 1044/tnslsnr
                tcp6 1 0 127.0.0.1:50444 127.0.0.1:1521 CLOSE_WAIT 8448/java

                – george h

  12. Aug 21, 2011

    Anonymous

    Thanks for these instructions, I was able to install 11g Express on Ubuntu. I found /var/lib/dpkg/info/oracle-xe.postinst to be the main culprit. After downloading the RPM and converting to deb via alien, install the debian package once and you will see the error related to oracle-xe.postinst. Then comment out the part in that script as instructed and execute the script again. After that run oracle script to configure the database and you are done!

  13. Oct 13, 2011

    Anonymous

    It doesn't work for me. The error is "Database configuration error" in "/etc/init.d/oracle-xe configure".

    In the init.ora file there isn't any placeholder. Maybe this is the problem?

    1. Oct 14, 2011

      Can you give some more information, which OS version, output of some log files?

  14. Oct 19, 2011

    Anonymous

    hi.

    i does not work for me too.
    the output for sudo /etc/init.d/oracle-xe configure is:

    Starting Oracle Net Listener...Done
    Configuring database...
    Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

    i installed oracle without an error, then i modified the /var/lib/dpkg/info/oracle-xe.postinst file and commented out those two lines, run it but configuring as above lead to the error message. i also tried installing chkconfig and ran the original oracle-xe.postinst script without an error. but i get the same failure when running "oracle-xe configure".

    the only difference i see is when doing your the sanity checks:

    1. grep sga /u01/app/oracle/product/11.2.0/xe/config/scripts/init*
      does not list me any files. in fact, the scripts in my installations are named init.ora and initXETemp.ora, so this files do not contain any placeholders!! could that be the problem?

    i am using a fresh ubuntu 11.10 64bit desktop edition.

    thanks, harald

  15. Dec 04, 2011

    Anonymous

    Alexander,

    thanks, nice tutorial.
    Oracle have now released the production version of 11gXE. The installation steps are more or less the same as you have here ( apart from a few issues with NLS_LANG settings for some languages).
    The steps I followed for installing are at http://mikesmithers.wordpress.com/2011/11/26/installing-oracle-11gxe-on-mint-and-ubuntu/

    HTH

    Mike

  16. Jan 28, 2012

    Anonymous

    Hi,

    oracle@swapnil-VPCEB46FG:~$ sqlplus / as sysdba

    sqlplus: command not found

    oracle@swapnil-VPCEB46FG:~$

    I have followed all the steps mentioned above but I am getting above error. Can anyone please help here?

    1. Jan 29, 2012

      Can you give some more details? Which Ubuntu version are you using? Did you get some errors during the installation?

      Does the file /u01/app/oracle/product/11.2.0/xe/bin/sqlplus exists?

  17. Feb 16, 2012

    Anonymous

    You get a lot of repscet from me for writing these helpful articles.
Skip to end of sidebar Go to start of sidebar