This repository contains the following components running inside docker containers:
Due to performance reasons, SQLDeveloper is not installed. It is easier to use Oracle Developer Tools for VS Code.
- Starter HR data is already configured
- Database in container is fully stateful
During my undergraduate studies of computer science, I was required to use OracleDB for my SQL courses. The installation process has always been a bit of a hassle, especially considering the only available free version is the 11g version which is quite outdated by now.
Having enrolled in an Engineering University for Computer science and not wanting to face the same experience again, I decided to run it all in docker containers and get on with life. And potentially helping people who face the same issue in the future.
I that it's not really that practical to run SQLDeveloper in a container (slight VNC server lags among other reasons) therefore I just ignore the service run by adding profiles[0]=donotstart to the service configuration.
Now I simply use it to run Oracle xe 11g with the HR database.
This guide was tested on Windows with git bash and on Linux running PopOS 22.04
make up
# This might take a while, tail the logs with
docker logs -f oracledbAnd you're all good! Simply use the following credentials to connect to your oracle database as shown in the screenshot with the password being oracle.
- To stop the containers without deleting any data
make down
Note that this will neither delete your OracleDB data nor your SQLDeveloper pereferences. In order to do just that, you would have to
make deleteThis step is not needed anymore since it's added to the compose file.
You might also want to unlock the HR account to have access to the HR (or Human Resources) schema which is just a collection of useful tables often used for testing.
HR and a bunch of other tables are now unlocked by default.
To use it simply
- Enter into the running container with the system account
make shell- Connect with the HR account
sqlplus HR/HRYou can now run queries against the HR database
SELECT TABLE_NAME FROM USER_TABLES;To connect to the database outside the docker network:
Hostname: localhost
Port: 1521
SID: xe- Default system account
user: system
password: oracle
- HR account (password is case sensitive)
user: HR
password: HR
-
SQLDeveloper: If you still have a "flashing screen" and the container exists, see the bottom section docker hub link of sqldeveloper to see how to solve it. You might also want to delete the
./tmpdirectory if it was created by docker and create it yourself. To test, you can simply re-runmake start -
Ports are not available: Either the port is in use or it is excluded by the system. See this and most importantly this for windows.
- Add persistance for the database
- Auto detect platform
- Expose a VNC Server instead of X11
- Add sample data and HR table on init
