When running docker run -it --name ora12c-r2 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=ORCL -e ORACLE_PWD=123456 -e ORACLE_CHARACTERSET=AL32UTF8 -v /home/DATA/oracle_12c/sharedData:/opt/oracle/oradata oracle/database:12.2.0.1-se2 I get the following:
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCL.log" for further details.
cat: /opt/oracle/cfgtoollogs/dbca/ORCL/ORCL.log: No such file or directory
[ 2018-03-08 08:05:15.774 UTC ] Cannot create directory "/opt/oracle/oradata/ORCL".
SQL*Plus: Release 12.2.0.1.0 Production on Thu Mar 8 08:05:15 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL> ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCL/control01.ctl' scope=spfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> Disconnected
mkdir: cannot create directory '/opt/oracle/oradata/dbconfig': Permission denied
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/spfileORCL.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/orapwORCL': No such file or directory
mv: cannot move '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/sqlnet.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
mv: cannot move '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
mv: cannot move '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/tnsnames.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
cp: cannot create regular file '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
ln: failed to create symbolic link '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/sqlnet.ora': File exists
ln: failed to create symbolic link '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora': File exists
ln: failed to create symbolic link '/opt/oracle/product/12.2.0.1/dbhome_1/network/admin/tnsnames.ora': File exists
cp: cannot stat '/opt/oracle/oradata/dbconfig/ORCL/oratab': No such file or directory
ls: cannot access /opt/oracle/oradata//*/: No such file or directory
ORACLE_HOME = [/home/oracle] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID .
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle
/opt/oracle/checkDBStatus.sh: line 27: sqlplus: command not found
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
tail: no files remaining
if i delete "-v /home/DATA/oracle_12c/sharedData:/opt/oracle/oradata " ,it's successful,but add it that is failed..why..
I was strugling with the same issue, but it seems the host directory requires the same uid (and guid maybe) ownership as the oracle user inside the container.
A workaround before starting the container:
chown -R 54321:54321 /oradata/path/on/host
Indeed, this is a permission error with your folder on your host. You have to make sure that user 54321 has write permissions on folder /home/DATA/oracle_12c/sharedData or you could just use named volumes, i.e. docker volume create ....
I have updated the FAQ accordingly.
I'm closing this issue for now as there is nothing that we can do here. It's just how Docker volumes work.