This article represents instructions on how to install & configure Oracle 11g Database (Enterprise Edition) on Docker.
Well, I could have lived with installing Oracle 11g express edition, had I have the requirement of testing my application with Oracle database for single user. The primary reason for installing Oracle enterprise edition was to test the high availability using Oracle Data Guard solution. As we may knowing that Oracle Data Guard does not come with Oracle XE Database, thus, it becomes mandatory to work with Oracle EE Database edition which comes bundled with Data Guard solution.
The primary challenge in installing Oracle EE database on Docker is the disk space problem the installation runs into. To get around that problem, I would suggest you to read the page below and configure your docker environment appropriately.
Let’s get started with installing and configuration of oracle database.
- Download the following Oracle 12c docker image from https://github.com/wscherphof/oracle-12c. The image consist of three steps. Each step is a folder consisting of a Dockerfile and a couple of scripts which would be referred when Dockerfile gets executed.
- Download the Oracle 11G Database: One would be required to download the oracle linux 11g file from Oracle website (this Oracle 11G Linux Download page)
- Configure Boot2docker for greater Disk Space: Before getting started, you would want to take care of “disk space” issue which you would eventually run into, if you do not take care. For this purpose, one would require to configure boot2docker to allow image of larger size. This page, https://docs.docker.com/articles/b2d_volume_resize/ consists of instructions to configure boot2docker. Based on the instructions on the page, I increased the disksize to 100000.
- Customize the image for Oracle 11G: As the image is for building Oracle 12c (EE) database, one would require to make few changes to the Dockerfiles and scripts to make it work for Oracle 11g (EE) database. Following is required to be done.
- Place the downloaded Oracle 11g zipped files (two files) in step1 folder.
- Go to step1/Dockerfile, and change the oracle downloaded zip file names.
- In step1 folder, change the db_install.rsp to 11.2.0 compatible db_install.rsp file. One could get a sample response file for 11g from web.
- In step2 folder, change the step2/Dockerfile, step2/create and step2/initORCL.ora such that 12.1.0 is replaced with 11.2.0
- Once done with above, go ahead and build and commit step 1, step2 and step 3 as per the instructions on the page.
- You are all set to run the Oracle DB.
- Run the image into Docker Container: Individual oracle DB instance (docker run –privileged -ti -d -P –name primary -v /c/Users:/mnt/Users oracle-12c:step3 /bin/bash). This would expose 1521, 5050, 8080 on random ports which could be used to connect to database. As a result of installation, “start” script is placed in “/tmp” folder. Thus, every time you start and attach the docker, execute the following command, “/tmp/start” to start the Oracle DB instance. In case, you want to start in the background, you could use following command: “nohup /tmp/start &”.
- Multiple oracle DB instance requiring to connect each other (docker run –privileged -ti -d -P –name standby -v /c/Users:/mnt/Users –link primary:primary oracle-12c:step3 /bin/bash)
Hope the instructions above would help you install, configure and run with Oracle 11g (EE) database on your laptop. Let me know if you needed any help.
Follow him on Twitter and Google+.
Latest posts by Ajitesh Kumar (see all)
- MongoDB – How to Enable Authentication on Mongo Database - August 21, 2017
- MongoDB Command to Evaluate Query Performance - August 20, 2017
- Spring Boot with JSP Pages – Code Example - August 19, 2017