This is how to easily setup an Oracle XE DB in a Virtual Machine that is accessible via localhost:1521.
So you don't have to install Oracle XE locally, but inside a VM.
We use VirtualBox, Vagrant and Docker for that.
First install VirtualBox https://www.virtualbox.org/wiki/Downloads
and Vagrant https://www.vagrantup.com/downloads.html
Run vagrant version
to check that vagrant is correctly installed.
Save the Vagrantfile
from this gist to a local directory.
Go inside the directory and run vagrant up
. The first startup will take a few minutes to download everything.
Then you have a ready to use Oracle XE DB on localhost:1521 :)
Your connection settings are
hostname: localhost
port: 1521
sid: xe
username: system
password: system
and default timezone is Europe/Berlin.
To change these defaults you have to edit the line starting with inline: "docker run -d
in the Vagrantfile.
See https://github.com/kekru/docker-oracle-xe-11g-extra-tablespace for more information.
To STOP, but not delete the VM run vagrant suspend
.
To DELETE the VM run vagrant destroy
.
Restart the VM with vagrant up
To reload/reprovision the Oracle comment in the lines
#config.vm.provision "shell",
# inline: "sh -c 'docker stop $(docker ps -aq) && docker rm $(docker ps -aq) && docker rmi myapp ; true'"
in the Vagrantfile and run vagrant provision
or vagrant up --provision
.
This will DESTROY YOUR DATABASE DATA.
Run vagrant ssh
to login to your VM.
On Windows you might have to put ssh.exe to your %PATH%. If you have installed git, you can use C:\Program Files\Git\usr\bin
You can also login via Putty on host: "localhost", Port "2222", login: "vagrant", password: "vagrant".
Now run docker exec -it oracledb /bin/bash
to get into the Docker Container where the Oracle DB is installed.
See https://github.com/kekru/docker-oracle-xe-11g-extra-tablespace for more information.