Docker-images: XEPDB Persistence Problem ( product/18c/dbhomeXE )

Created on 15 Apr 2020  路  2Comments  路  Source: oracle/docker-images

Hi,
I've found the databases created in container XEPDB1 are not persistent on container restart.

Procedure of DB/USER creation:

sqlplus / as sysdba
ALTER SESSION SET container=XEPDB1;
CREATE TABLESPACE tbs_user DATAFILE 'tbs_user.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;

CREATE USER user_demo IDENTIFIED BY PASSWORD DEFAULT TABLESPACE tbs_user;
GRANT connect to user_demo;
GRANT resource to user_demo;

ALTER USER user_demo QUOTA UNLIMITED ON tbs_user;

In this case .dbf files are stored on:
/opt/oracle/product/18c/dbhomeXE/dbs/tbs_user.dbf
but /opt/oracle/product is not persistent acording to the current documentation.

My enviroment is:
Oracle Database 18c (18.4.0) Express Edition (XE)

The build process was made with:

git clone https://github.com/oracle/docker-images/

cd docker-images/OracleDatabase/SingleInstance/dockerfiles/
 ./buildDockerImage.sh -x -v 18.4.0

mkdir -p /docker/oracle-xe/oradata
chmod a+w /docker/oracle-xe/oradata

docker run -d -it --name oracle -p 1521:1521 -v /docker/oracle-xe/oradata:/opt/oracle/oradata oracle/database:18.4.0-xe
docker logs -f oracle
database help wanted

All 2 comments

This solve the issue, I don't think this is a "help wanted".
Adding this volume fix the persistence problem of pdb

    volumes:
      - ./data/oradata:/opt/oracle/oradata
      - ./data/dbs:/opt/oracle/product/18c/dbhomeXE/dbs

I think this should be in the official documentation.

Was this page helpful?
0 / 5 - 0 ratings