Skip to content

usersina/oracle-xe-11g-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle xe 11g in Docker

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.

Main Features

  • Starter HR data is already configured
  • Database in container is fully stateful

Motivation

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.

Note

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.

Getting started

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 oracledb

And 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.

sqldeveloper-login

  • 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 delete

Initializing databases

This step is not needed anymore since it's added to the compose file.

II. Extra setup

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.

1. Unlocking HR

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/HR

You can now run queries against the HR database

SELECT TABLE_NAME FROM USER_TABLES;

Accounts

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

Troubleshooting

  • 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 ./tmp directory if it was created by docker and create it yourself. To test, you can simply re-run make 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.

Roadmap

About

Oracle xe 11g as a container with HR and persistent data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published