Today, we will cover the topic of setting up an Oracle database in Docker and running it in a Linux environment. There are several reasons why you might want to deploy an Oracle database using Docker:

  • Cost minimization: Docker containers can be run on-premises as well as in the cloud. On-premises means on your own server, computer—whatever suits your setup. As for the cloud, Docker is compatible with AWS, Azure, and GCP. Using Docker outside of the cloud can help avoid incurring additional costs.

  • Portability: Containers can be easily transferred from one machine to another or from one environment to another, offering flexibility and quick deployment. This makes it simple to move applications across development, testing, and production environments.

  • Isolation: Running the database in Docker enables isolation from the host system, reducing potential conflicts with other applications or processes running on the same host.

docker pull container-registry.oracle.com/database/free:latest
sudo docker run --name oracle_db -p 1521:1521 -e ORACLE_PWD=<...> -v \
/opt/oracle/oradata:/opt/oracle/oradata container-registry.oracle.com/database/free:latest

The above command will start the Oracle Database with default settings and configurations. It is recommended to refer to the official Oracle Database documentation and also to Oracle’s licensing policy before deploying in production.

for ORACLE_PWD=, you need to provide the password that will be used to connect to the database.

After the startup is completed, you should see DATABASE IS READY TO USE in the output. Also this gives you the SID of the started DB which is FREE in that case.

The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
2024-11-10T09:39:29.242913+00:00
FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
Completed: Pluggable database FREEPDB1 opened read write 
Completed: ALTER DATABASE OPEN
2024-11-10T09:39:29.902016+00:00

Connecting to the database

SQL Developer
SQL Developer

My site is free of ads and trackers. Was this post helpful to you? Why not BuyMeACoffee


Reference:

  1. Oracle website
  2. Database SQL Developer