docker-images icon indicating copy to clipboard operation
docker-images copied to clipboard

Database 19.3.0-ee: wrong fixed ORACLE_HOME in dbca?

Open rammpeter opened this issue 5 years ago • 22 comments

After building the docker image for 19.3.0-ee it is not possible to install database instance by "docker run" because:

  • Script $ORACLE_HOME/dbca uses a fixed ORACLE_HOME "/u01/app/oracle/product/19.0.0/dbhome_1"
  • the real ORACLE_HOME used in Docker-Image is "/opt/oracle/product/19c/dbhome_1"
39 # Define ORACLE_HOME -> OH
40 OH=/u01/app/oracle/product/19.0.0/dbhome_1
41 PLATFORM=Linux
42 ORACLE_HOME=$OH
43 export ORACLE_HOME;
134 #call platform_common script
135 . $ORACLE_HOME/bin/platform_common

Line 135 in dbca crashes during a "docker run" with /opt/oracle/product/19c/dbhome_1/bin/dbca: line 135: /u01/app/oracle/product/19.0.0/dbhome_1/bin/platform_common: No such file or directory

This happened if building the docker image on Mac-OS with Docker Engine v 18.09.2. Building the docker image on Linux generates the exact current ORACLE_HOME in dbca in line 40.

rammpeter avatar Apr 29 '19 11:04 rammpeter

Hello, Any thoughts as when this can be fixed? Thanks for help.

benbkim avatar May 17 '19 12:05 benbkim

Hm, I cannot reproduce this:

[oracle@localhost ~]$ docker run --name oracle-ee -p 1521:1521 -v oradata:/opt/oacle/oradata oracle/database:19.3.0-ee
ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: Qw7GB9coLLY=1

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-AUG-2019 03:52:51

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

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

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/a4916a818cc6/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 19.0.0.0.0 - Production
Start Date                09-AUG-2019 03:52:51
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/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/a4916a818cc6/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
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Aug 9 04:16:32 2019
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>
System altered.

SQL>
System altered.

SQL>
Pluggable database altered.

SQL>
PL/SQL procedure successfully completed.

SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2019-08-09T04:16:32.593466+00:00
ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' SCOPE=SPFILE;
2019-08-09T04:16:32.736374+00:00
ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
   ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
Completed:    ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE

XDB initialized.

Could you please share the output of the docker run command and also the output of the build of the image itself? I suspect that something went already wrong during the build and that this is a follow on error.

gvenzl avatar Aug 09 '19 04:08 gvenzl

I just ran into this - Docker version 19.03.1, build 74b1e89 on MacOS 10.14.5 runLog.txt buildLog.txt

vadakr avatar Aug 12 '19 17:08 vadakr

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

no-response[bot] avatar Aug 23 '19 04:08 no-response[bot]

The bot appears to be confused. I’ve uploaded the required information in https://github.com/oracle/docker-images/issues/1257#issuecomment-520515937

vadakr avatar Aug 23 '19 05:08 vadakr

Weird. Not sure why your comment didn't remove the tag. Re-opening the issue.

Djelibeybi avatar Aug 23 '19 05:08 Djelibeybi

Any news on this? I experience the same issue as @vadakr with 19.3.0-ee. Cloned the github repository to my local server and build the image with:

./buildDockerImage.sh -v 19.3.0 -e

Build was successful:

Successfully built f657f2ee78be Successfully tagged oracle/database:19.3.0-ee

Oracle Database Docker Image for 'ee' version 19.3.0 is ready to be extended:

--> oracle/database:19.3.0-ee

Build completed in 1373 seconds.

Then I tagged the image for my local registry and pushed it (because I am running in swarm mode):

docker tag oracle/database:19.3.0-ee localhost:5001/oracle/database:19.3.0-ee
docker push localhost:5001/oracle/database:19.3.0-ee

I took the run command from documentation...

docker run --name <container name> \
-p <host port>:1521 -p <host port>:5500 \
-e ORACLE_SID=<your SID> \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:19.3.0-ee

... and translated it into a compose-file for my swarm service:


services:
  db1-t:
    image: localhost:5001/oracle/database:19.3.0-ee
    environment:
      - ORACLE_SID=TEST
      - ORACLE_PDB=TESTPDB
      - ORACLE_CHARACTERSET=AL32UTF8
    ports:
      - 1521:1521
      - 5500:5500
    volumes:
      - db1-t_data:/opt/oracle/oradata
    deploy:
      placement:
        constraints:
          - node.role == worker

volumes:
  db1-t_data:
    driver: local
    driver_opts:
      o: bind
      device: /mnt/docker-data/services/db/oracle/db1-t/oradata
      type: none

I started it with

docker stack deploy --compose-file /mnt/docker-data/services/db/oracle/db1-t/compose.yml --with-registry-auth db1-t

The startup process takes extremely long (about 15 minutes, may be caused by my nfs mounted filesystem where the volume is located) and shows some errors:

db1-t_db1-t.1.w66t4eyn6q4a@worker2-p | Creating and starting Oracle instance db1-t_db1-t.1.w66t4eyn6q4a@worker2-p | 32% complete db1-t_db1-t.1.w66t4eyn6q4a@worker2-p | 36% complete db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | cp: cannot stat '/opt/oracle/oradata/dbconfig/TEST/oratab': No such file or directory

db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | SQLPlus: Release 19.0.0.0.0 - Production on Tue Jan 7 14:50:16 2020 db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | Version 19.3.0.0.0 db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | Copyright (c) 1982, 2019, Oracle. All rights reserved. db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | Connected to an idle instance. db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | SQL> ORA-01078: failure in processing system parameters db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | LRM-00109: could not open parameter file '/opt/oracle/product/19c/dbhome_1/dbs/initTEST.ora' db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | SQL> Disconnected db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | information is not available for the current user ID . db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | You can set ORACLE_BASE manually if it is required. db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | Resetting ORACLE_BASE to its previous value or ORACLE_HOME db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | The Oracle base remains unchanged with value /opt/oracle db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | /opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ##################################### db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ########### E R R O R ############### db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | DATABASE SETUP WAS NOT SUCCESSFUL! db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | Please check output for further info! db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ########### E R R O R ############### db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ##################################### db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | The following output is now a tail of the alert.log: db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | tail: cannot open '/opt/oracle/diag/rdbms///trace/alert.log' for reading: No such file or directory db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | tail: no files remaining db1-t_db1-t.1.eo8vq4zd8j2l@worker2-p | cp: cannot stat '/opt/oracle/oradata/dbconfig/TEST/oratab': No such file or directory

Does someone hav an idea what I am doing wrong? I am wondering about

cp: cannot stat '/opt/oracle/oradata/dbconfig/TEST/oratab': No such file or directory

and about

db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this db1-t_db1-t.1.ci8qdqtke4mn@worker2-p | information is not available for the current user ID .

ORACLE_HOME is set in the image, which i built with the script from github.

Kind regards, looking forward to some feedback

gutschet avatar Jan 07 '20 14:01 gutschet

I finally figured out that my problem was caused by the HEALTHCHECK in the Dockerfile. Because I am running the image as a docker swarm service, the scheduler restarts it, because first healthcheck is executed after 5 minutes. But at this point of time, the creation of the database is not ready and therefor, CheckDBStatus.sh fails and the healthcheck restarts the container, which results in errors because then he tries to start the database which was not created successfully. This will then cause the container to crash.

gutschet avatar Jan 27 '20 16:01 gutschet

I'm hitting this issue as well. So it seems I'll need to spin up a Linux VM to build the image, export, and then import it to my Mac if I want to run this on a Mac.

elijahgagne avatar Mar 05 '20 15:03 elijahgagne

I don't know if it is the exactly same issue, but I have problems when execute docker run.

% docker run --name oracle19c -p 1521:1521 oracle/database:19.3.0-ee

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

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-MAY-2020 13:25:08

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

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

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/393f0f63e7b4/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 19.0.0.0.0 - Production
Start Date                14-MAY-2020 13:25:08
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/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/393f0f63e7b4/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
/opt/oracle/product/19c/dbhome_1/bin/dbca: line 135: /u01/app/oracle/product/19.0.0/dbhome_1/bin/platform_common: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB.log: No such file or directory
mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/spfileORCLCDB.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/orapwORCLCDB': No such file or directory
mv: cannot stat '/opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora': 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

ecost4 avatar May 14 '20 13:05 ecost4

Hi there, i have the same issue /opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found

is there a workaround? Thanks

EvilClay avatar May 26 '20 13:05 EvilClay

Hi everyone,

I have encountered the same issue as well. One thing I noticed is due to lack of memory. I am running docker on Windows 10 with WSL2. After setting the RAM in .wslconfig be 4GB (previously 2GB), the issue was resolved. I hope that helps

muhd-zunurain avatar Aug 18 '20 13:08 muhd-zunurain

Faced this issue when building on MacOS as well, dealt with it by building on a Linux-based instance

bryan831 avatar Oct 22 '20 03:10 bryan831

@bryan831 I had the same issue on MacOS. I had to increase memory in the docker preferences. After the change, I had to rebuild the image again. Similar issue that @zunurain222 had to manage on Windows.

evoltafreak avatar Feb 03 '21 14:02 evoltafreak

Hey @bryan831 Indeed it`s just increase the memory in docker preferences, it solved for me as well! Thanks! 😊

klesiossss avatar Oct 07 '21 03:10 klesiossss

I am still having that issue.

Is there anyone who already succeed to run oracle 19c docker container?

hendisantika avatar Oct 31 '21 12:10 hendisantika

I got it to work by spinning up a Linux VM to build the image, export it, and then import it to my Mac.

elijahgagne avatar Oct 31 '21 20:10 elijahgagne

I am unable to reproduce this. @hendisantika Can you pull latest changes and see if you are able to reproduce the error. If the same error persists, please send me the build logs along with container run logs ??

abhisbyk avatar May 24 '22 10:05 abhisbyk

Wait.. I'll try it later. I'll let you know @abhisbyk

hendisantika avatar May 24 '22 12:05 hendisantika

This is happening to me right now on Ubuntu 22 LTS.

Image & container were built without any error, then...

ORACLE EDITION: ENTERPRISE

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-JUN-2022 15:40:54

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

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

TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/dbc3456e9d3f/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 19.0.0.0.0 - Production Start Date 20-JUN-2022 15:40:56 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/19c/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/dbc3456e9d3f/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 /opt/oracle/product/19c/dbhome_1/bin/dbca: line 135: /u01/app/oracle/product/19.0.0/dbhome_1/bin/platform_common: No such file or directory cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log: No such file or directory cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB.log: No such file or directory

eyp avatar Jun 20 '22 15:06 eyp

@eyp is the external volume that you are specifying using -v empty or has pre-existing datafiles?

yunus-qureshi avatar Jun 20 '22 16:06 yunus-qureshi

Ok, it seems it happens when there isn't enough memory. I've changed to another machine with more RAM and now it works fine.

eyp avatar Jun 21 '22 08:06 eyp

I bumped the ram up to 8 GB in the .wslconfig and I still get the same message.

docker run --name oracledb -p 1521:1521 -p 5500:5500 -e ORACLE_SID=xe -e ORACLE_PWD=somePassword -v /oracle/mnt:/opt/oracle/oradata oracle/database:19.3.0-ee

Delamater avatar Aug 27 '22 09:08 Delamater

On Apple M1, 16go Can you confirm that this is a memory issue? To check with my management a upgrade to 32go (replacement in this case ;) )

`version: "3.8"

services:

test-service-utility-database: image: oracle2130ee deploy: resources: limits: memory: 3000M container_name: test-service-utility-database ports: - "1599:1521" environment: - ORACLE_SID=ORCLCDB - ORACLE_PDB=ORCLPDB - ORACLE_PWD=Oracle4System - ORACLE_MEM=2000 volumes: - ./database/OracleDB/oradata:/opt/oracle/oradata - ./database/scripts/system/network/admin:/opt/oracle/homes/OraDB21Home1/network/admin/ networks: - test-app-network

networks: test-app-network:`

❯ docker compose up [+] Running 1/0 ⠿ Container test-service-utility-database Created 0.0s Attaching to test-service-utility-database test-service-utility-database | ORACLE EDITION: ENTERPRISE test-service-utility-database | /opt/oracle/product/21c/dbhome_1/bin/dbca: line 186: /scratch/app/user/product/21.0.0/dbhome_1/bin/platform_common: No such file or directory test-service-utility-database | cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log: No such file or directory test-service-utility-database | cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB.log: No such file or directory test-service-utility-database exited with code 1

maquejp avatar Oct 31 '22 13:10 maquejp

Hello, For this issue, you need to set up the volumes for the container

volumes:
      - ./oracle_data:/u01/app/oracle

Here is my docker-compose.yml:

  oracledb:
    image: oracle/database:19.3.0-ee
    environment:
      - "ORACLE_PWD:password"
    volumes:
      - ./oracle_data:/u01/app/oracle 
    ports:
      - 1522:1521
      - 5500:5500

sitranv avatar Jun 13 '23 04:06 sitranv

@bryan831 I had the same issue on MacOS. I had to increase memory in the docker preferences. After the change, I had to rebuild the image again. Similar issue that @zunurain222 had to manage on Windows.

Thanks - Rebuilding the image after increasing the memory was key for me on MacOS.

nickmcdowall avatar Sep 08 '23 08:09 nickmcdowall