These install instructions are adapted from Me and My Ubuntu blog.
Download the VirtualBox application for your host machine type from the virtual box download site.
Doubleclick on the downloaded installer and follow the instructions.
Download Ubuntu Desktop Edition (14.04 64 bit version). Note the directory where you downloaded it.
Make sure that you set the memory of the VM to be greater than 2GB and the storage of the VM to be at least 10GB. See screencast
See screencast
See screencast
See screencast, but note that the screencast did not include the last step before REBOOT listed below. You should execute the commands in the last step.
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
sudo apt-get install alien libaio1 unixodbc
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
sudo pico /sbin/chkconfig
The pico text editor is started and the commands are shown at the bottom of the
screen. Now copy and paste the following into the file and save:
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01
sudo chmod 755 /sbin/chkconfig
sudo pico /etc/sysctl.d/60-oracle.conf
Copy the following into the file and save:
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
Verify the change using the command:
sudo cat /etc/sysctl.d/60-oracle.conf
You should see what you entered earlier.
Now load the kernel parameters:
sudo service procps start
Verify the new parameters are loaded using:
sudo sysctl -q fs.file-max
You should see the file-max value that you entered earlier.
sudo pico /etc/rc2.d/S01shm_load
Copy the following into the file and save.
#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;
esac
Change the permissions of the file using the command:
sudo chmod 755 /etc/rc2.d/S01shm_load
sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys
sudo touch /var/lock/subsys/listener
See screencast for a recording of the following steps.
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
sudo /etc/init.d/oracle-xe configure
Enter the following information:
pico ~/.bashrc
Add the following lines to the end of the file:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
Load the changes by executing your profile:
. ~/.profile
sudo service oracle-xe start
sudo usermod -a -G dba YOURUSERNAME
See screencast for a recording of the following steps.
sudo service oracle-xe start
This step is most likely not necessary, but I am documenting the command here anyway.
sqlplus sys as sysdba
Enter the password that you gave while configuring Oracle earlier.
You will now be placed in a SQL environment that only understands SQL commands.
create user USERNAME identified by PASSWORD;
Replace USERNAME and PASSWORD with the username and password of
your choice. Please remember this username and password.
If you had error executing the above with a message about resetlogs, then execute the following SQL command and try again:
alter database open resetlogs
grant connect, resource to USERNAME;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password.
exit;
sqlplus
You will be prompted for a username and password. Once authenticated, you will be able to type in the standard SQL commands learned in class.