At Dockercon last month, Oracle released its flagship databases, middleware and developer tools into the Docker Store marketplace via the Docker Certification Program. What does it mean to developers like me? It means that now you can pull OFFICIAL images of Oracle products in Docker and quickly start developing, testing and deploying modern enterprise applications. Isn’t it cool?
The Docker Certification Program (DCP) framework is gaining a lot of attention among partners which is a single platform allowing them to integrate and certify their technology to the Docker EE commercial platform. As of today, Oracle published Oracle Instant Client, Oracle Java 8 SE (Server JRE), Oracle Coherence, Oracle Database Enterprise Edition & Oracle Linux. You can directly view the solutions offered under this link.
Under this post, I will demonstrate how to get started with Oracle Database Enterprise Edition 126.96.36.199 in very simplified way:
Step-1: Logging / Registering to Docker Store
You will need Dockerhub Account to login to Docker Store and pull Oracle Database EE Docker Image as shown below:
Step-2: Pulling Oracle Database Enterprise Docker Image
Let us verify once the image has been pulled:
Its 5.27 GB in size and hence might take long time based on your network connectivity. I have pulled other Oracle products too as shown above.
Step-3: Preparing Environment File
To create a database container, we need to use the environment file below to pass configuration parameters into container:
## Specify the basic DB parameters
## db sid (name)
## default : ORCL
## cannot be longer than 8 characters
## db passwd
## default : Oracle
## db domain
## default : localdomain
## db bundle
## default : basic
## valid : basic / high / extreme
## (high and extreme are only available for enterprise edition)
The above is just an example file. You can make changes accordingly. I have changed DB_DOMAIN, DB_SID and DB_PASSWD according to my infrastructure. Save the file by name “env”.
Step-4: Running the Oracle Database Enterprise Container
env is the path to the environment file you created using above example.
1521 is the port on host machine to map the container’s 1521 port (listener port).
5500 is the port on host machine to map the container’s 5500 port (http service port).
oracledb is the container name you want to create.
12g is the memory size for the container to run. The minimum requirement is 4GB (–shm-size=”4g”).
store/oracle/database-enterprise:188.8.131.52 is the image that you use to create a container.
Step-5: Verify that the oracleDB container is running or not:
As shown above, the container ID starting with d88 indicates Oracle Database container running.
“…We are not yet done. ..”
You can enter into the container and verify that Oracle Linux Server is the base image for this container.
Step-6: Running the required script to start Oracle Database
The database setup and startup are executed by running “
/bin/bash /home/oracle/setup/dockerInit.sh“, which is the default CMD instruction in the images.
This will take about 5 to 8 minutes to be up and running. You can check logs which are kept under /home/oracle/setup/log location.
You can verify log file placed under “
/home/oracle/setup/log/setupDB.log“. If “
Done ! The database is ready for use .” is shown, the database setup was successful.
Let us switch to oracle user and try testing the DB connectivity using SQLPLUS command:
Multitenant: Connecting to Container Databases (CDB) & Pluggable Databases (PDB)
If you are new to Oracle D12c, the multitenant option introduced in Oracle Database 12c allows a single container database (CDB) to host multiple separate pluggable databases (PDB). I couldn’t just wait to test this out & see how to connect to container databases (CDB) and pluggable databases (PDB).
By default, PDB1 gets automatically created during the database installation. You can check that through the below command:
V$SERVICES views can be used to display available services from the database as shown below:
Let us see how to connect to one of the container database.
Before you connect to the container database, let us setup a user first:
Follow the below commands to connect to PDB1 using the above user account:
Hence, we are now connected to one of database container running inside Oracle Database Enterprise Edition.
In the future post, we will look how does Oracle Client Instant connect to Oracle Database Enterprise Docker container.