Java/Ubuntu/JBoss/Oracle XE Part II: Installation

This is the second installment of part I of the previous blog.  It will deal with the implementation portion.  If you have not already done so, please read the previous post.

Background:

This stack is a great choice for corporate environments or for someone who wants to learn Oracle and the full J2EE stack.  Make sure that your Ubuntu Server is the 32 bit version.

Quick Downloads:

Install the JDK:

You have two choices for your jdk.  There’s an open source JDK, aptly named OpenJDK, a free-as-in-speech version of the jdk.  Most mid to large projects use the free-as-in-beer version.  Plus with Sun being pwned (sic) by Oracle, it makes sense.  That’s what I recommend for this exercise.  You can install Sun’s JDK via the command line, but I don’t like that route.  I only install the JDK via the command line if it’s the OpenJDK version.

  • Download the JDK here.  DO NOT CHOOSE any of the bundles.
  • Do choose Java SE Development Kit (pick the latest update).
  • Pick the Linux distribution (32 bit version).
  • It will be a .bin file and is an executable.
  • Run it from the command line.  You’ll have to agree to an SLA.  The result will be a folder.
  • Rename the folder to java.
  • Move the folder to your /opt folder.
  • Alter your .bash_profile, .bashrc or /etc/bash.bashrc file to include the following:
  • JAVA_HOME=/opt/java
  • PATH=$PATH:$JAVA_HOME/bin

Install JBoss:

  • Make sure you have unzip installed.  If not, type:   sudo apt-get install unzip.
  • Download JBoss here or from the sourceforge site.
  • It’s going to be a zip file.  Unzip it.  It will extract as a folder.
  • Rename the folder to jboss.
  • Move the jboss folder to /opt.

Install Oracle XE:

Refer to my previous blog on installing Oracle XE on Ubuntu Server (Jaunty), 32 bit version.

Conclusion:

There you have it.  A full implementation of the JBoss/Oracle XE stack.  Stay tuned for an implementation of Weblogic/Oracle XE stack.

References:

Oracle XE installation on Ubuntu Jaunty

These are my notes from installing Oracle Express Edition on my Ubuntu Server (Jaunty).  I am writing this partly because I will write a sequel to my other blog based on a Java/Ubuntu/JBoss/Oracle XE environment.  This sequel will be way too long if I include this in the same blog.  So here it is as a separate entry.

Background:

For your smaller projects, the Oracle database, even the Express Edition, probably isn’t your best choice.  Why?  Well, for one, Oracle is a beast.  Volumes of books have been written on the administrative portion alone.  The hardware requirements are pretty thick (Express Edition recommends half a gig of RAM, but I say at least a Gig, 1 will give your server more flexibility). Although queries are fairly easy to write (and I like the Oracle syntax over ANSII), writing packages and stored procs can be daunting.

Another thing you want to take seriously are the hardware requirements itself.  I wanted to install it in a 64 bit OS with OXE 32 bit binaries.  The 10g version does not support this.  Why?  Because Oracle does not want you to use this edition for production purposes.  It enforces this by limiting you to single core, 1 Gig of RAM and 4 Gigs of data.  I can see where they are coming from, but I think it’s kind of silly.

Lastly, I found this out the hard way, you’ll need a desk top so that you can finish the rest of the configuration.  I installed this on a 64 bit virtualized server host, so I didn’t want to use more memory than needed.  After hours of google-fu, I ended up deleting the host, reinstalling Ubuntu Server (Jaunty) as a 32 bit edition, upgraded to 2 gigs of RAM, with xfce as the desktop.  I lowered the number of processors to 1 since I didn’t need more due to Oracle XE’s 1 core limitiation.

Requirements:

  • Single core machine
  • Max of 1 Gig of RAM, but you can have more.  Oracle won’t use it.
  • 32 bit version of Ubuntu Server Edition
  • Comfortability with command line based terminal
  • root access

Installation:

So the installation process is pretty straight forward.  The notes below represents basically the documentation.  So I’ll make this as concise as possible.  For a more in depth documentation, please click here.

  • Download the Express Edition here.  You may have to sign up for a user account.
  • Choose the Western European character set.  For Ubuntu downloads, choose oracle-xe_10.2.0.1-1.0_i386.deb.
  • su as root.  If you don’t know how to do that, click here.
  • Go to the folder in which you downloaded the binary.  Type:
  • dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
  • Configure by typing:
  • /etc/init.d/oracle-xe configure
  • Go with defaults for http port, the listener and auto start
  • Pick a strong password (chars, CAPS, nums).  REMEMBER THIS PASSWORD!!!

Set your env vars:

  • in your terminal,  do the following:
  • type:   cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
  • make sure you have permission to execute  scripts on file oracle_env.sh
  • type:   ./oracle_env.sh

Alter bash.bashrc or .bash_profile or .bashrc to set your env automatically.  I prefer editing the bash.bashrc because I like my environments initialized at start up.

  • append to end of file with vi or nano:   /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

OK, so hopefully you installed Oracle XE on Ubuntu Server (instead of Desktop).  So you’ll need a desktop.  In your terminal, type the following:

  • sudo apt-get update
  • sudo apt-get install xubuntu-desktop
  • you may have to restart

A couple useful commands:

  • start:   /etc/init.d/oracle-xe start
  • stop:   /etc/init.d/oracle-xe stop

Make sure that OXE is started.  If not, type the start command in your terminal above.

On your desktop, pull up your favorite browser.  In the address bar, type:

  • http://localhost:8080/apex

You’ll have to login with your SYS or SYSTEM username and the password you defined above.

You’ll have to go to Administration–>Manage HTTP Access.  Choose:

  • Available from local server and remote clients
  • Click Apply Changes

Now you can do CRUD actions and write queries from remote computers.

You’re basically done.  You can install the oracle client, found here.  If you like TOAD (Windows), you can get it here.

References:

Follow

Get every new post delivered to your Inbox.