DEV Community

Cover image for Oracle database and Docker
Ștefan Vîlce
Ștefan Vîlce

Posted on • Edited on

3 2

Oracle database and Docker

Oracle DBA 12 Container and Docker

For my job I had to install an Oracle database on my Windows. And I thought that perhaps it is much better to get this database in a container. Because I need many databases to handle with.

And this solution with containers gives me the independence I need for every each of them. And I can play with different versions of Oracle whithout having problems.

I have decided to write this post because it was kind of difficult to find something really helpfull on internet.

I had Docker already installed on my PC Windows. And then I run this:

docker run -d -p 8080:8080 -p 1521:1521 --name OracleDB store/oracle/database-enterprise:12.2.0.1-slim

In my Docker Dashboard i got this:
Docker Dashboard woth Oracle 12 database
As you can see there is the newest container in my Docker, OracleDB. I got the Oracle 12 slim for this project.
With this command
docker ps
i get this
docker container ID
So, i could see that the container ID is: 5d365b3daa70. Then i run:
docker exec -it 5d365b3daa70 /bin/bash
and then
sqlplus / as sysdba
sqlplus terminal

Here I can run this:

alter session set "_ORACLE_SCRIPT"=true;
create user newDB identified by newDB;
GRANT CONNECT, RESOURCE, DBA TO newDB;

And then I run this:

select value from v$parameter where name='service_names';

I open the sql developer and connect to this schema:
sql developer connection

Now I can start create tables in this schema, newDB.

What's next

I'll try to get the same thing but with Oracle 19.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay