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: