docker-images: ERROR: ORA-12547: TNS:lost contact

So I have cloned this repo and built the oracle/database:12.2.0.1-ee image locally. Everything worked fine.

Now I am trying to run this built image with the following docker-compose file:

oracle:
    image: oracle/database:12.2.0.1-ee
    container_name: oracle
    volumes:
      - oracle:/opt/oracle/oradata # persistent oracle database data.
    ports:
      - 1521:1521
      - 8080:8080
      - 5500:5500

volumes:
  oracle:
    name: oracle

In the docker-compose file I am doing nothing special, just the standard stuff I saw in the sample docker-compose file in this repo. The only difference is that I am using a named value to get over the permissions issues that I’ve seen on the issues board. However, that being said, when I run the docker-compose file with docker-compose up, I receive the below.

ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: qLAVE9zSuQw=1

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 14-AUG-2020 22:59:35

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

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

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /opt/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/e7bde90b6c02/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.2.0.1.0 - Production
Start Date                14-AUG-2020 22:59:35
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.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/e7bde90b6c02/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
[WARNING] [DBT-11209] Current available physical memory is less than the required physical memory (2,048MB) for creating the database.
[WARNING] [DBT-10102] The listener configuration is not selected for the database. EM DB Express URL will not be accessible.
   CAUSE: The database should be registered with a listener in order to access the EM DB Express URL.
   ACTION: Select a listener to be registered or created with the database.
Copying database files
1% complete
2% complete
DBCA Operation failed.
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
[ 2020-08-14 22:59:40.071 UTC ] Copying database files
DBCA_PROGRESS : 1%
[ 2020-08-14 22:59:40.263 UTC ] ORA-12547: TNS:lost contact

DBCA_PROGRESS : 2%
[ 2020-08-14 22:59:40.421 UTC ] Error while cataloging RMAN Backups
[ 2020-08-14 22:59:40.526 UTC ] DBCA_PROGRESS : DBCA Operation failed.

SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 14 22:59:40 2020

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

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/spfileORCLCDB.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/orapwORCLCDB': 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 26: 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

FYI I have a storage driver of overlay2 (I’m running a mac using Catalina) which I’ve seen mentioned on a few issues, so I don’t think it’s that.

More information, the reason I am using this custom built image instead is because Partitioning is disabled on the pre-built image on DockerHub Store, and I just wanted to see if it was included in the image I built from this repository. However in efforts to just see if that was the case, I’ve spend the last few hours tackling with just getting this image to run.

I’ve seen across the issues that '/opt/oracle/product/12.2.0.1/dbhome_1/dbs/orapwORCLCDB': No such file or directory means that its a permissions issues however using the named volume I thought would resolve this. Open to suggestions.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

This issue is still present for me on an M1 mac using the latest docker desktop (3.3.1). Has there been any progress on this?

Just a note that Docker Desktop for Mac (and Windows) do weird things with the filesystem and networking due to their reliance on a hidden LinuxKit VM in which Docker is actually running.

You may have a better experience on a Mac or Windows using our Oracle Database Vagrant project instead, which leverages Vagrant to deploy Oracle Database inside an Oracle VM VirtualBox instance.

@mcaxtr Not yet, I’ve retried on a different laptop and get the same errors. I just awaiting @gvenzl response as he seems to be the main source of knowledge in this area.