It seems Oracle on linux is the only way to get Oracle on my Mac.

I recently switched from Ubuntu to OS X 10.5 (Leopard) as my main development OS and I quickly ran into a major hurdle, this being the fact that there is no reliable way to install an Oracle database server on Leopard. Oracle does offer a version for OS X but they are obviously not very serious about the Mac as a platform because it is an outdated version of 10g and, more importantly, it only really runs on OS X 10.3, a version that has been outdated for almost two years. I went on a Google hunt for information on how to install this older version on my shiny new Leopard-enabled MacBook Pro and I found some forum posts and an outdated site listing the tricks for getting it to work on 10.4, the previous version of OS X, but no clear instructions for getting it to work on Leopard.

So I went back to Ubuntu... or at least virtual Ubuntu. I installed Ubuntu's new JeOS (Just Enough Operating System) as a virtual machine on VMware Fusion. JeOS has been optimized to run on VMware so this seemed like the perfect host for running my database. Installing it was not as easy as I thought though, because my first two attempts at creating a new VM with the JeOS iso (mounted as a cd drive) resulted in systems that would not boot. It turns out that JeOS does not like virtual SCSI disks so I had to create my VM with an IDE disk. VMware made this a little harder than you would think since the only way I got this to work was to first create the VM with a SCSI disk (you can't choose IDE in the VM creation wizard), and then to delete that disk and create a new IDE disk.

When installing Ubuntu, make sure you create a swap partition at least twice the size of the amount of RAM you gave the VM since that's about the only system requirement that the Oracle XE installer enforces. I gave my VM 340 MB so I made the swap partition a nice round 800 MB. With the basic system installed the only extra thing I installed was an SSH server (sudo apt-get intall openssh-server) for easier remote management. I configured my VM with NAT networking so it always has a unique private IP address and connecting to it through SSH or JDBC is easy.

I wanted to install the full Oracle Enterprise edition because the XE version can be somewhat limiting but it turns out that to install it you need to have a full memory hogging Gnome desktop installed. I wanted to keep the memory footprint of my VM as small as possible so I changed my mind and went for Oracle XE, which is extremely easy to install on Ubuntu.

The instructions I found on the net are so simple that I'll reproduce them here:

Add the following line to your Ubuntu /etc/apt/sources.list file:

deb unstable main non-free

and then execute the following commands:

# wget -O- | sudo apt-key add -
# apt-get update
# apt-get install oracle-xe

After the installer has downloaded and installed everything, it will tell you to run a simple configuration script and after that you're basically done. You've got a small footprint VM with a fully functional Oracle database in it. You can install Oracle's SQL Developer for OS X to browse and manage your databases and Oracle also offers something they call an "instant client", which is a simple zip file containing good old SqlPlus.

So there you go, Oracle on OS X... sort of 🙂