oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.51k stars 5.41k forks source link

Cannot start OracleDB image #246

Closed ggrimbert closed 7 years ago

ggrimbert commented 7 years ago

Hi,

I have create a docker image for Oracle DB 12.1.0.2 EE.

When I run the following command

docker run \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_SID=sequelize \
-e ORACLE_PDB=test_sequelize \
-v /home/kimgit/oracle:/opt/oracle/oradata \
oracle/database:12.1.0.2-ee

I got the following logs :

ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: LuZvF9abF3U=1

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 30-DEC-2016 09:51:28

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Starting /opt/oracle/product/12.1.0.2/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/e786bd61093f/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                30-DEC-2016 09:51:28
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/e786bd61093f/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
Look at the log file "/opt/oracle/cfgtoollogs/dbca/test_seq.log" for further details.
cat: /opt/oracle/cfgtoollogs/dbca/test_sequelize/test_sequelize.log: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/test_sequelize.log: No such file or directory

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 30 09:51:44 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>    ALTER SYSTEM SET control_files='/opt/oracle/oradata/test_sequelize/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 test_sequelize SAVE STATE
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL> Disconnected
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/spfiletest_sequelize.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/orapwtest_sequelize': No such file or directory
#########################
DATABASE IS READY TO USE!
#########################
tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
tail: no files remaining

And the container is down.

After some researches, i defined the ORACLE_HOME to : /opt/oracle/product/12.1.0.2/dbhome_1

Now I have the following :

ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: wJ8UFdnvhZE=1

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 30-DEC-2016 10:03:01

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Starting /opt/oracle/product/12.1.0.2/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/b5176ab3d961/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                30-DEC-2016 10:03:01
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/b5176ab3d961/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
Copying database files
1% complete
DBCA Operation failed.
Look at the log file "/opt/oracle/cfgtoollogs/dbca/sequelize/sequeliz.log" for further details.
cat: /opt/oracle/cfgtoollogs/dbca/sequelize/sequelize.log: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/sequelize.log: No such file or directory

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 30 10:03:41 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>    ALTER SYSTEM SET control_files='/opt/oracle/oradata/sequelize/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 test_sequelize SAVE STATE
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL> Disconnected
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/spfilesequelize.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/orapwsequelize': No such file or directory
#########################
DATABASE IS READY TO USE!
#########################
PMON (ospid: 143): terminating the instance due to error 12752
Fri Dec 30 10:03:31 2016
System state dump requested by (instance=1, osid=143 (PMON)), summary=[abnormal instance termination].
System State dumped to trace file /opt/oracle/diag/rdbms/sequelize/sequelize/trace/sequelize_diag_157_20161230100331.trc
Fri Dec 30 10:03:32 2016
Dumping diagnostic data in directory=[cdmp_20161230100331], requested by (instance=1, osid=143 (PMON)), summary=[abnormal instance termination].
Fri Dec 30 10:03:32 2016
ORA-1092 : opitsk aborting process
Fri Dec 30 10:03:32 2016
Instance terminated by PMON, pid = 143

The container is now running.

But when I try to connect with SqlPlus I get : ORA-12162: TNS:net service name is incorrectly specified

And I can't connect with sqldeveloper on the DB ORA-12505 TNS:listener does not currently know of SID given in connect descriptor

gvenzl commented 7 years ago

Your database is not created correctly during the startup of the container as indicated by:

The command completed successfully Copying database files 1% complete DBCA Operation failed. Look at the log file "/opt/oracle/cfgtoollogs/dbca/sequelize/sequeliz.log" for further details.

Does the container start successfully if you omit the following and use the default?

-e ORACLE_SID=sequelize \ -e ORACLE_PDB=test_sequelize \

ggrimbert commented 7 years ago

After reinstalling / pulling everything and without the -e parameters, it works.

gvenzl commented 7 years ago

I think the error is related to the length of the ORACLE_SID, in your example it exceeded 8 bytes which would work if those first 8 bytes would be unique. I'll do additional testing and see whether I'm right and if so whether I can add a check to prevent this.

gvenzl commented 7 years ago

I leave this open for now for tracking purposes.

gvenzl commented 7 years ago

Ok, the error is actually the _ of the ORACLE_SID. The first 12 characters of the ORACLE_SID must be alphanumeric. I've added a check that will only allow alphanumeric characters for the ORACLE_SID.

gvenzl commented 7 years ago

Fixed.