MaksymBilenko / docker-oracle-12c

:whale: Docker image with Oracle Database 12c on board
Apache License 2.0
680 stars 285 forks source link

Database dump (.dmp) import fails #70

Closed viktor-isaev closed 6 years ago

viktor-isaev commented 6 years ago

After adding Oracle DB dump (.dmp) file to /docker-entrypoint-initdb.d/, I get the following error during container startup.

Import: Release 12.1.0.2.0 - Production on Thu Dec 7 10:28:08 2017

Copyright (c) 1982, 2015, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

This happens due to lack of permissions on /docker-entrypoint-initdb.d/ directory:

root@77c0dae5dcba:/# ls -l
total 80
drwxr-xr-x   2 root root 4096 Nov 27  2015 bin
drwxr-xr-x   2 root root 4096 Apr 10  2014 boot
drwxr-xr-x   5 root root  360 Dec  7 10:31 dev
drwxr-xr-x   2 root root 4096 Dec  7 10:31 docker-entrypoint-initdb.d
...

RUN chown -R oracle:dba docker-entrypoint-initdb.d in Dockerfile does not work. However, if the same is done in entrypoint.sh, it works. So, the solution is, probably, to add appropriate chown to entrypoint.sh.

MaksymBilenko commented 6 years ago

Thanks for PR, have you tested with a new build?

viktor-isaev commented 6 years ago

Tested with new build. The problem is solved!