Radu Cotescu's professional blog

g33k w17h pa45510n

How to Install Oracle Database 10g XE and OC4J on Ubuntu

Starting to work on my diploma project my setup required that I installed Oracle 10g XE and OC4J. For a while now Oracle has started to offer *.deb packages and to host a repository for Debian-based Linux distributions, which means that they have gained the maturity to be used in enterprise environments.

The installation of both servers is painless, unless you want them on the same machine (which actually should be avoided unless you have powerful hardware). But if that’s the only way to have them, you must avoid setting the ORACLE_HOME environment variable required by OC4J because it will mess with the scripts used to start / stop the DB server. Instead create the ORACLE_HOME variable only inside the bin/oc4j script inside OC4J’s installation folder.

Keeping that as an important side note, to install those two servers follow these steps:

  1. Oracle Database 10g Express Edition

    • add Oracle’s repository to your /etc/apt/sources.list file

        echo -e "\n# Oracle repository\ndeb http://oss.oracle.com/debian unstable main non-free | sudo tee -a /etc/apt/sources.list
      
    • get the key for the repository

        echo -e "\n# Oracle repository\ndeb http://oss.oracle.com/debian unstable main non-free | sudo tee -a /etc/apt/sources.list
      
    • update your packages information

        sudo apt-get update
      
    • install the database (I recommend using the universal package so that you get Unicode character support)

        sudo apt-get install oracle-xe-universal
      
    • configure the DB instance

        sudo /etc/init.d/oracle-xe configure
      
    • to administer the DB either use the menu entries from Applications - Oracle Database 10g Express Edition, either use the scripts from /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/

        sudo adduser your_user dba
      
  2. OC4J

    • download one of the OC4J containers from here
    • extract the archive where you want to have the server installed (let’s call this OC4J_HOME)
    • change the file permissions for $OC4J_HOME/bin/oc4j to 744

        chmod 744 $OC4J_HOME/bin/oc4j
      
    • edit the script located at $OC4J_HOME/bin/oc4j so that right after the configuration section you have something like:

        #########################################################
        ########## START CONFIGURATION SECTION ##################
        #########################################################
      
        ORACLE_HOME=OC4J_HOME
        J2EE_HOME=$ORACLE_HOME/j2ee/home
      

    but replace OC4J_HOME with the actual folder path

    • start the server and add the credentials for the oc4jadmin user

If you used the default ports for both installations, you can access the OC4J EM at http://127.0.0.1:8888/em and the DB at http://127.0.0.1:8080/apex (note that APEX is not installed).

Start developing!

How To, Linux, Oracle, Ubuntu

« I have moved my feed Put your latest tweet as Pidgin's status on Ubuntu (Linux) »

Comments