Skip to content

Oracle 11g Entreprise Edition in docker for educational purposes

Notifications You must be signed in to change notification settings

usersina/oracle-ee-11g-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle EE 11g in Docker

This repository contains the following components running inside docker containers:

You can use SQLDeveloper or use Oracle Developer Tools for VS Code.

If you want the XE version, see this repository for Oracle XE 11g.

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 that the 11g version 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.

Getting started

This guide was tested on Windows with git bash and on Linux running CachyOS 6.11

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.

hostname: localhost
port: 1521
sid: EE
service name: EE.oracle.docker
username: system
password: oracle

sqldeveloper-login

  • To stop the containers without deleting any data
make down

Note that this will not delete the OracleDB data. In order to do just that, you would have to

make delete

Connect to Oracle Enterprise Management console with following settings:

http://localhost:8080/em
user: sys
password: oracle
connect as sysdba: true

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: EE.oracle.docker
  • Default system account
user: SYSTEM
password: oracle
  • HR account (password is case sensitive)
user: HR
password: HR

More

Connecting as sysdba

Initially, you will get an error if you attempt to do it

SQL> connect /as sysdba

ERROR: ORA-01031: insufficient privileges

For this, you have to first make shell then add the default user (root) to the dba group.

[root@container-id-abc /]# usermod -aG dba root
[root@container-id-abc /]# newgrp dba

After that, you can sqlplus SYSTEM/oracle and run the same command again

[root@container-id-abc /]# sqlplus SYSTEM/oracle
SQL> connect /as sysdba

Connected.

Troubleshooting

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

About

Oracle 11g Entreprise Edition in docker for educational purposes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published