DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Integrate a Distributed Database With Event Streaming
  • Deploy an Application for Azure Container Registry
  • Create an Oracle Database Docker Image
  • How To Dockerize Mean Stack App

Trending

  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  • Measuring the Impact of AI on Software Engineering Productivity
  • Start Coding With Google Cloud Workstations
  1. DZone
  2. Data Engineering
  3. Databases
  4. Create an Oracle Database Docker Image

Create an Oracle Database Docker Image

In this article, I will explain how to download Oracle 12c image in Docker and how to start working on the Oracle database.

By 
Sathvik Vutukuri user avatar
Sathvik Vutukuri
·
Jul. 24, 18 · Tutorial
Likes (9)
Comment
Save
Tweet
Share
63.0K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, I will explain how to download Oracle 12c image in Docker and how to start working on the Oracle database.

As part of Integration testing, I have created a dummy database in Docker, which will help me store the tested data.

Before starting the installation, install the Docker on your PC. Refer to this article for how to install Docker on Windows. You need to create an account in Docker to download and start working.

After successful installation of Docker in Windows, please check to see whether Docker is up and running or not. You can see whether it is up in the taskbar as shown in the image below.

Image title

After Confirming Docker is up and running, open Windows PowerShell to start working on Docker.

After starting windows PowerShell, login to Docker with your Docker account information with the below command: 

docker login

Now, Docker will ask for your username and password details.

Image title

We can now start pulling the images and pushing our own created images to Docker Hub.

Oracle has 12c images in Docker Hub. Now, we will install 12c lighter image in Docker. Use the below command to install Oracle 12c image from Docker Hub.

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

In the above command, we are asking Docker to run oracle image on port number 1521 with the name "OracleDB". This command will first check whether the image is there in our local Docker or not, otherwise, it will download the image and start running the Oracle image.Image title

I already have Oracle image in my local Docker, and after the execution of the above command, Docker started running Oracle image and has given us an ID for reference.

We can see the running status of all the images or containers in Docker using the below command.

docker ps

I have only Oracle image running in my local Docker, where we can see the output of the command:Image title

The above image shows the status of running containers in Docker. Only one container (Oracle image) is running in Docker. We can see the container ID, created time, and port numbers of Oracle image.

Now execute the below command to start and mount the database.

 docker exec -it OracleDB bash -c "source /home/oracle/.bashrc; sqlplus /nolog"

After execution of the command:

Image title

Now, we can start working on the Oracle database. Follow the execution of the below commands to create a sample table in the database.

connect sys as sysdba;
-- Here enter the password as 'Oradoc_db1'
alter session set "_ORACLE_SCRIPT"=true;
create user dummy identified by dummy;
GRANT CONNECT, RESOURCE, DBA TO dummy;
--Now create a sample table.
create table Docker (id int,name varchar2(20));
--Start inserting values in to the table.

Now we have successfully installed the Oracle 12c database in Docker and created a table to start working. We can access this database in any SQL editor.

Below are the details of the database we installed:

  1. HostName: localhost (hostname will be System IP address if you installed in any Linux VM)

  2. Port: 1521

  3. UserName and Password: dummy

  4. Service Name: ORCLCDB.localdomain 

Use the below command to get the Service Name of the DB installed.

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

I have created a new connection in SQL developer with the above details and I can successfully access tables created in the Docker database from SQL developer.

Image title

Follow the above steps to install Oracle 12c in Docker and start working!

Docker (software) Database Oracle Database Command (computing)

Opinions expressed by DZone contributors are their own.

Related

  • How to Integrate a Distributed Database With Event Streaming
  • Deploy an Application for Azure Container Registry
  • Create an Oracle Database Docker Image
  • How To Dockerize Mean Stack App

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!