Docker-images: How to make database instance persistent?

Created on 8 Aug 2016  路  16Comments  路  Source: oracle/docker-images

Hi!

Is there any documentation, how I can separate the database installation in docker container from the database instance data in a persistent volume?
Is this possible with this images?

Kind regards
Torsten

database enhancement

Most helpful comment

With the latest commit we now have containers that provide persistence for all database editions.

All 16 comments

Hi @tkleiber,

At this point in time this isn't possible with those images but this is something that we are investigating.

I'll leave this issue open to act as a tracker for this.

Thanks,

This guy builds a oracleDB image and uses persistence storage.
https://fritshoogland.wordpress.com/2015/08/11/installing-the-oracle-database-in-docker/

He volumes the folder "/u01/app/oracle/data" inside the container. No clue wich one will be in this installation.

@sigaELwebeo you tryed the solution using volumes? I tryed creating a volume for the folder "/u01/app/oracle/oradata/XE" and "/u01/app/oracle/",but don't work, the oracle instance could not be mounted. I tryed with this: docker create --name oracle -v /Users/ramon/Development/docker/database/oracle:/u01/app/oracle --shm-size=1g -p 1521:1521 -p 8080:8080 -p 1234:22 oracle/database:11.2.0.2-xe .

Y did persistent data but in an awful way!!!
1
Create a container1 with volume:
/docker/volumes/oradb:/opt/oracle/oradata
and it was empty.
2
Create a container2 with volume /docker/volumes/oradb:/data
Docker exec on it and copy the entire ORCLCDB folder to /data
3
Docker exec into container 1, chown and chmod on ORCLCDB
Copy and replace file /opt/oracle/oradata/ORCLCDB/control01.ctl to /opt/oracle/fast_recovery_area/ORCLCDB/control02.
restart container1 so the database load again
4
Delete container2.

I'm waiting to have more availability to modify Dockerfile to build oradata folder and expose as volume.

With this image, https://github.com/MaksymBilenko/docker-oracle-xe-11g , I can mount a volume with the way I want, but I really want is use the official image. @ratroncoso I will try your solution,thank you.

@ratroncoso Your solution is for oracle 12c, right? I'm asking because the folders hierarchy are different on Oracle 11g XE.

Oracle Database Enterprise Edition 12C

@ratroncoso did you try with Oracle 11g XE or just Oracle 12c?

@ramonPires only on Oracle12c

@gvenzl any update about this issue? I found other solution, http://marceloochoa.blogspot.com.br/2016/06/is-time-for-oracle-xe-on-docker.html ,but I don't test yet.

With the latest commit we now have containers that provide persistence for all database editions.

When starting the xe docker container in vagrant box via

docker run ... --restart unless-stopped

and calling

vagrant halt
vagrant up

the docker container comes up after this, as I can see via docker ps, but database is not available.

Have to do to make the database available again via

docker stop container
docker start container

@tkleiber can you provide logs of what's happening? really hard to figure out what's going on.

We'd also appreciate if you could post a new issue with these logs.

How can I find this logs?

$ docker logs should be a good start

@brunoborges I have some problems with oracle https://github.com/oracle/docker-images/issues/1480

Was this page helpful?
0 / 5 - 0 ratings