Installing Oracle in a Vagrant Machine
Install Vagrant
If you have not already, download and install vagrant. Since I am using a mac, I use VirtualBox for vagrants VMs.
Download Oracle
Since oracle is a commercial product, it can not be packaged in with the git repository, or directly downloaded automatically. You will need an Oracle account in order to downoald it, so if you do not already have one, sign up for one next, and then download Oracle 11g zip file for Linux x64. Download the 64bit, regardless of what the host OS is running, the virtual machine will be running a 64 bit OS.
Fetch the vagrant definitions
Clone the vagrant-ubuntu-oracle-xe repository from GitHub.
git clone git://github.com/hilverd/vagrant-ubuntu-oracle-xe
Copy the Oracle 11g zip file that you downloaded to the directory vagrant-ubuntu-oracle-xe expects to find it in, using this command:
cp ~/Downloads/oracle-xe-11.2.0-1.0.x86_64.rpm.zip ~/vagrant-ubuntu-oracle-xe/modules/oracle/files
Install vbguest
VBGuest is a plug in for virutalbox to install guest additions automatically. It is very handy, and it is required for this virtual machine to function normally. You install Vagrant plug-ins using vagrant:
vagrant plugin install vagrant-vbguest
Start the Vagrant virtual machine. It will configure itself, install oracle and be ready to run, once this command finishes. It takes quite a while on most macs to finish, so be patient.
cd ~/vagrant-ubuntu-oracle-xe vagrant up
After a few minutes your local machine will be running an Oracle 11g server on a virtual instance of Ubuntu 12.04
Using the virtual Machine.
If your connecting with a java based tool (or java code), the JDBC connection url is:
jdbc:oracle:thin:system/manager@localhost:1521:XE
If your connecting via an oracle tool, like sqlplus the connection string is:
system/manager@//<a class="external-link" href="http://localhost:1521/XE" rel="nofollow">localhost:1521/XE
So for instance, to connect with SQL*Plus from your mac, you could use
sqlplus system/manager@//<a class="external-link" href="http://localhost:1521/XE" rel="nofollow">localhost:1521/XE</a>
Thanks to Glenn Sudduth for this wonderful git repository!
, andAlso, I just found this gitHub repository that has an excellent explanation of what is going on, and has been updated. https://github.com/hilverd/vagrant-ubuntu-oracle-xe