Tag Archives: start additional container

Oracle 12c on Docker – Part 2 – Usage Notes

In my previous post, Oracle 12c on Docker, you have seen how to install a docker image for the Oracle 12c database and how to run a container.

In this post, I will  review some useful Docker commands, that you can use.

The command docker images shows all the docker images that are present on your host.

docker112

The command docker exec -it <containername|containerid> bash can be used to login to a specific container.

docker212

The command docker stats can be used to see the cpu and memory usage statistics of the containers.

docker222

The command docker stop <containername|containerid> can be used to stop a container

docker142

You can start a second container on the same host using the same image. (Please refer to the previous post for the command we used to start the first container). When we are starting a second container, we are just changing the host ports that the listener and EM-Express ports are Exposed to.

The command to use is docker run -p 1522:1521 -p 5501:5500 oracle/database:12.1.0.2-ee

docker102

Then you can login using a oracle database client tool, to the database in this second container.

docker8-2

One important point to note is that any changes you make to the databases in the containers (As we have set it up) are lost once you shutdown the container. If you want to persist the changes made to the database, you can use the docker commit command to create a new image that has the changes in it.