Skip to content

Permission denied error for oracle/database:12.2.0.1-se2 container #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zneil123 opened this issue Mar 8, 2018 · 4 comments
Closed
Assignees
Labels
database invalid The issue has nothing to do with the provided Dockerfiles

Comments

@zneil123
Copy link

zneil123 commented Mar 8, 2018

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
@zneil123
Copy link
Author

zneil123 commented Mar 8, 2018

if i delete "-v /home/DATA/oracle_12c/sharedData:/opt/oracle/oradata " ,it's successful,but add it that is failed..why..

@ichundu
Copy link

ichundu commented Mar 8, 2018

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

@gvenzl gvenzl changed the title 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 Permission denied error for oracle/database:12.2.0.1-se2 container Mar 8, 2018
@gvenzl gvenzl self-assigned this Mar 8, 2018
@gvenzl gvenzl added the database label Mar 8, 2018
@gvenzl
Copy link
Member

gvenzl commented Mar 8, 2018

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.

@gvenzl gvenzl added the invalid The issue has nothing to do with the provided Dockerfiles label Mar 8, 2018
@gvenzl
Copy link
Member

gvenzl commented Mar 8, 2018

I'm closing this issue for now as there is nothing that we can do here. It's just how Docker volumes work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database invalid The issue has nothing to do with the provided Dockerfiles
Projects
None yet
Development

No branches or pull requests

3 participants