Dockerizing Oracle Database
Docker is a next buzzword on the net now. While a lot of work has been done in dockerizing various applications under docker softwares like Oracle still poses challenges during installation / configuration / execution. This blog entry gives the users a flavour in integrating Oracle Database for running in Dockerized environment.
Are you sure this can be done ?
Yes. Not only can be done, when its available you'll hardly notice any difference as compared to instance / database available on a bare metal / VM.
Should this be done ?
For running Oracle Database production Instances we suggest NOT. Oracle will not support this officially.
So, what are the ideal use case ?
The use cases for this could be, creating an environment for testing PSU or CPU patch provided by Oracle or think of it as an environment for your developers who has a specific requirement or even when you want to create a training environment. Even your experienced DBA's will find it handy as a sandbox for personal testing.
What does the flow looks like ?
In the POC environment we made this a multi step process for better understanding and granular control over the process. Here is the basic flow.
Platform Image (PI) is the base image on which customization's are done using Dockerfile. PI is read only in nature hence in order to customize it, Docker creates an intermediate container which holds only the changes made to PI. These intermediate containers when saved they'll save the state in the form of read-only images. The process continues till a ORACLE_HOME image is created containing Oracle binaries.
Database instances are spanned using this image. In order to create / save the database on a persistent storage, a data only container can be created. The data container together with container based on ORACLE_HOME will be used to create database instance and database underneath.
Here is how the final picture will look like. In this environment two 12c docarized database instances are running. The CDB database looks like the as shown in the picture above. In order to create / clone / plug in the PDB's a NFS mount point is mapped from Storwize V7000 system on Docker host.
What do you say are the advantages of this ?
There are several advantages of this. Although there are multiple images, each of this image being read only gives a consistent starting point every time a container is spawned on the image. Each container has its own namespace isolation consisting of PID, Network, Control groups (CGROUPS). Thus each container when running behaves like a independent host in-spite of the fact that it is based on same image. The images can be saved or pushed to an on premise repository thus making them readily available to another docker host. The images can be moved across various platforms such as servers across a network, laptop or even on public cloud space such as Amazon Web Services.