Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

16/01/2023, 08:58 Installing Oracle 12C as a Docker Container | by Firzhan Naqash | Medium

Firzhan Naqash
Sep 21, 2020 · 2 min read · 1:28

Save

Installing Oracle 12C as a Docker Container


While engaging in the development tasks in the local environment, it’s paramount to
have the local set up as closer to the customer’s environment. There is a significant
portion of giant financial institutions that uses Oracle as the primary data persistence
store.
Open in app Get unlimited access

Therefore, this post is intended for developers to quickly set up their Oracle RDBMS
Search Medium
instances in the local set up.

Prerequisites
Docker Installation.

Dockerhub Account

Agreeing to the Terms & Conditions of Developer Onlye license of Oracle Database
Enterprise Edition 12c over here.

Installation Process

Login to the docker & pull the Oracle Database Enterprise Edition 12c image.
0:00 1:29
docker login
1.0×

docker pull store/oracle/database-enterprise:12.2.0.1 Get Speechify Chrome Extension

Next the docker image could be executed with the following command;

https://medium.com/@firzhan/installing-oracle-12c-as-a-docker-container-44985b29bcae 1/4
16/01/2023, 08:58 Installing Oracle 12C as a Docker Container | by Firzhan Naqash | Medium

Note: In order to avoid data loss in the event of container is destroyed, the docker
volume is shared with the host volume.

docker run -d -it — name oracle -p 1521:1521 -v /Users/firzhannaqash/oracle-db-


data:/ORCL store/oracle/database-enterprise:12.2.0.1

The state of the docker container could be checked as below;

docker ps

Container ID of the Oracle Image

The log file of the Oracle container could be checked with following command;

docker logs <CONTAINER-ID> -f 129 1

Once the Oracle container is successfully started, the below command is executed to
mount the Database.

docker exec -it oracle bash -c “source /home/oracle/.bashrc; sqlplus /nolog”

This would enable you to access the sqlplus terminal. We can use the sqlplus terminal
to start creating the schema.

You have to execute following set of commands to create the user/schema to work on;

connect sys as sysdba;

The above command would prompt to enter the password. The default password of the
Oracle Container Database is Oradoc_db1.
0:00 1:29

Next, execute the following set of commands; 1.0×

alter session set “_ORACLE_SCRIPT”=true; Get Speechify Chrome Extension

create user <username/schemaname> identified by <password>;

https://medium.com/@firzhan/installing-oracle-12c-as-a-docker-container-44985b29bcae 2/4
16/01/2023, 08:58 Installing Oracle 12C as a Docker Container | by Firzhan Naqash | Medium

GRANT CONNECT, RESOURCE, DBA TO <username/schemaname>;

The Service Name of the above created schema would be defined as


ORCLCDB.localdomain.

Now, we can connect to the above-created Oracle schema using Oracle SQLDeveloper.

A basic SQLDeveloper configuration could be found over here.

References

[1] https://www.dontesta.it/en/2019/08/26/how-to-setup-docker-container-oracle-
database-12c-for-liferay-development-environment/
0:00 1:29

[2] https://technology.amis.nl/2017/12/30/oracle-database-in-a-docker-container-from-
1.0×
oracle-container-registry/
Get Speechify Chrome Extension

https://medium.com/@firzhan/installing-oracle-12c-as-a-docker-container-44985b29bcae 3/4
16/01/2023, 08:58 Installing Oracle 12C as a Docker Container | by Firzhan Naqash | Medium

Oracle Database

0:00 1:29

1.0×

Get Speechify Chrome Extension

https://medium.com/@firzhan/installing-oracle-12c-as-a-docker-container-44985b29bcae 4/4

You might also like