Update: I’ve moved my setup process to Dockerize Oracle and APEX to Github. It will be maintained with the latest steps I’m using it. The repository is docker-oracle-setup.
I recently had a need to do a Proof of Concept (POC) on a new feature released in Oracle 12c R2 (12.2). My first instinct was to go to my DBAs and ask them to give me access to a 12.2 environment. Thankfully I was at the Oracle ACE annual Oracle Open World dinner and Gerald Venzl (aka Mr.Oracle-Docker) was there and convinced me otherwise. I must thank Gerald for both pushing me to start using Docker again and also for some support when I ran into issues.
The following post will cover how to get a 12.2 instance up and running using the Oracle Container Registry for your own personal instances
- If you haven’t already done so, go install Docker. If you’ve never heard of Docker before I suggest reading a bit about it so you have some understanding of what is and how it works.
- Go to container-registry.oracle.com and use your Oracle Technology Network (OTN) login and register.
- One logged in go to
Database > Enterpriseand read and if you agree to the Terms and Conditions click the
- One logged in go to
The following steps will pull the appropriate image(s) and setup your docker instance. I’ve added inline comments to describe each step. If you’re new to Docker please read my comments rather than blindly running the code.
# Some Docker versions may complain about login credentials when calling the pull command
Your docker container should now be running. The following code shows how to connect to the instance using SQLcl along with creating a test account on the PDB. You can take the connection strings in the SQLcl demos and apply to SQL Developer.
# Note on my laptop I renamed "sql" to "sqlcl". Adjust the scripts accordingly or call sqlplus
-- Create account to develop with
Connect to the PDB
sqlcl martin/[email protected]:32711/orclpdb1.localdomain
Note: In SQL Developer this connection looks like:
-- Create the emp and dept tables (note: only works in SQLcl / SQL Dev. Not SQL*Plus)
You can now do/test whatever you want to do in your PDB!
So now that you’ve started your Docker instance, and established a working connection to the PDB how do you manage the Docker container? Here are some useful Docker commands:
# See all containers (running or otherwise)
I’ve just started to use the Docker 12.2 image and may launch a 12.1 container as well (will blog instructions if I do it).
If I run into any issues doing my tests and “learning” development (i.e. kicking the 12.2 tires) I’ll write another article and link below. I also plan to look into upgrading APEX on the 12.2 container along with creating a simple web server container to test APEX with some 12.2 features. If I get this working I’ll blog about it.