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

Oracle Database XE 18.4.0 on M1

Open Peipi98 opened this issue 5 years ago • 14 comments

I run this command: docker run --name myxedb -d -p 1521:1521 -e ORACLE_PWD=system -e ORACLE_CHARACTERSET=AL32UTF8 oracle/database:18.4.0-xe

Then I check on Docker that gives me this result:


Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:

Confirm the password:

Configuring Oracle Listener.

Listener configuration succeeded.

Configuring Oracle Database XE.

#

# A fatal error has been detected by the Java Runtime Environment:

#

#  Internal Error (safepoint.cpp:310), pid=195, tid=0x000000403d91a700

#  guarantee(PageArmed == 0) failed: invariant

#

# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)

# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode linux-amd64 compressed oops)

# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

# An error report file with more information is saved as:

# /tmp/hs_err_pid195.log

#

# If you would like to submit a bug report, please visit:

#   http://bugreport.java.com/bugreport/crash.jsp

#

qemu: uncaught target signal 6 (Aborted) - core dumped

/bin/bash: line 1:   193 Done                    ( echo 'system'; echo 'system'; echo 'system' )

       195 Aborted                 | /opt/oracle/product/18c/dbhomeXE/bin/dbca -silent -createDatabase -gdbName XE -templateName XE_Database.dbc -characterSet AL32UTF8 -createAsContainerDatabase true -numberOfPDBs 1 -pdbName XEPDB1 -sid XE -emConfiguration DBEXPRESS -emExpressPort 5500 -J-Doracle.assistants.dbca.validate.DBCredentials=false -sampleSchema true -customScripts /opt/oracle/product/18c/dbhomeXE/assistants/dbca/postdb_creation.sql -initParams sga_target=596M,pga_aggregate_target=198M


Database configuration failed. Check logs under '/opt/oracle/cfgtoollogs/dbca'.

/usr/bin/mv: cannot stat '/opt/oracle/product/18c/dbhomeXE/dbs/spfileXE.ora': No such file or directory

/usr/bin/mv: cannot stat '/opt/oracle/product/18c/dbhomeXE/dbs/orapwXE': 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

#####################################

########### 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:

/usr/bin/tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory

/usr/bin/tail: no files remaining```

Peipi98 avatar Nov 11 '21 11:11 Peipi98

I've got the same problem on my MacBook Pro M1. I need this database for work so it would be amazing and it would really make my life easier.

horavamartin avatar Nov 18 '21 16:11 horavamartin

Please paste the output of docker info

yunus-qureshi avatar Dec 09 '21 15:12 yunus-qureshi

The same problem occurs but with version 11.2.0.2

Running the command:

docker run --name oratest -d -p 1521:1521 -e ORACLE_PWD=system -e ORACLE_CHARACTERSET=AL32UTF8 --shm-size=1G oracle/database:11.2.0.2-xe fails, here you can see error log for this execution docker_oracle_error.log

And my docker info is docker_info.txt

The image was compiled using this command ./buildContainerImage.sh -v 11.2.0.2 -x -o “--platform=linux/amd64” becasue if you use ./buildContainerImage.sh -v 11.2.0.2 -x the image compilation fails build_image_fails.log

amari-at4 avatar Dec 10 '21 11:12 amari-at4

i solve that executing in terminal ulimit -c unlimited

jaiodoo avatar Dec 25 '21 12:12 jaiodoo

@jaiodoo Have you really been able to run an Oracle Database in a Docker container on Apple Silicon by just using the “--platform=linux/amd64” flag? That would be great! If so, could you elaborate on the exact environment and setup and how is the performance?

doberkofler avatar Feb 02 '22 08:02 doberkofler

I happened to resolve this (or a very similar issue) by accident - the docker container got restarted after a failed DB setup until the setup was eventually successful.

TL;DR steps (or follow this longer SO answer) :

  • I installed docker inside Lima with arch: "x86_64" (the slow mode - better for compatibility)
  • Enter Lima VM: (lima)
  • Inside Lima run: ./buildContainerImage.sh -v 18.4.0 -x
    • no --platform flag necessary as I am on x86_64 already
    • this took a really long time (about 6 hours !!!) - now you know why it's called slow mode
  • docker run --name myxedb -d -p 1521:1521 -e ORACLE_PWD=system -e ORACLE_CHARACTERSET=AL32UTF8 oracle/database:18.4.0-xe
  • Oracle Database configuration failed and docker got restarted ... until, finally, it succeeded!

Oracle DB doesn't feel slow in my normal day-to-day use (no heavy use).

pavestru avatar Feb 21 '22 13:02 pavestru

@Peipi98 Oracle database docker images are not compatible on ARM platform (Apple M1) currently. Many guys are successful in running the docker images on Lima. Please use the method mentioned above to run the image.

Additionally, we are working on the compatibility of Oracle Database with ARM platform and the release expectation is later this year. So, closing this issue for now. Please feel free to reopen in case you have any further queries.

abhisbyk avatar Mar 22 '22 07:03 abhisbyk

@abhisbyk can you give me an idea how I can run Oracle Db 19c Docker image on Mac M1 using Lima.

Furqan-Iqbal avatar Apr 20 '22 15:04 Furqan-Iqbal

Complete Log is here: @yunus-qureshi @abhisbyk qbal@MBP-von-furqan hiqs % docker run --name hiqsnew
-p 1500:1500
-e ORACLE_SID=orcl
-e ORACLE_PWD=pass
-v /Users/iqbal/hiqs//opt/oracle/oradata
doctorkirk/oracle-19c WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested cat: /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory cat: /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory /opt/oracle/runOracle.sh: line 102: [: -lt: unary operator expected ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: pass

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-APR-2022 14:07:05

Copyright (c) 1991, 2020, 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/80536a439375/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-APR-2022 14:07:05 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/80536a439375/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-06208] The 'SYS' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [FATAL] [DBT-05509] Failed to connect to the specified database (ORCL). CAUSE: OS Authentication might be disabled for this database (ORCL). ACTION: Specify a valid sysdba user name and password to connect to the database. cat: /opt/oracle/cfgtoollogs/dbca/ORCL/ORCL.log: No such file or directory cat: /opt/oracle/cfgtoollogs/dbca/ORCL.log: No such file or directory mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/spfileORCL.ora': No such file or directory mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/orapwORCL': 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/orac

Furqan-Iqbal avatar Apr 20 '22 15:04 Furqan-Iqbal

Hey everyone, I am going to try running Oracle Database XE 18.4.0 on a new M1 MacBook Pro, as mentioned in this thread using one of these SO answers

There is also another thread discussing this topic here: https://github.com/oracle/docker-images/discussions/1951

Fingers crossed at some point will see support for M1-based Macs in the future!!

OliHarris avatar Jul 11 '22 15:07 OliHarris

@OliHarris Do you have any updates about the issue? I have tried the solution with Colima described in this article on my M1 Max and got nothing in result.

artemzi avatar Jul 12 '22 08:07 artemzi

@artemzi You'll never guess what I've been working on today 😅

There's been some wild trial and error but fingers crossed this will help - here are my notes!!

~ Currently am experimenting with using Colima container-runtime tech, as per these commands: https://stackoverflow.com/a/72256556/19528210 brew install colima brew install docker Corporate proxy (VPN) was proving a pain to circumvent, so had to edit file: ~/.colima/default/colima.yaml My additions were the following - you might not need to mount any location though..?

cpu: 4
 
memory: 4
 
mounts:
  - location: ~/workspace
    writable: true
 
env:
  http_proxy: http://your-proxy-details.com:80
  https_proxy: http://your-proxy-details.com:80
  no_proxy: localhost,*.docker.internal,etcetc

~ Can now use commands:

colima start Can then execute docker scripts to successfully get building the Docker image... However mounting the entire workspace as volume - you will probably have to increase the memory you give Colima.

colima stop Will stop the container-runtime and Docker - do this after mounting the entire workspace as volume to decrease the memory back down to 4 if necessary, then colima start again. From here you can bring the DB back online with:

docker ps -a
docker start <container-id>

~ Further debug for error when using docker compose scripts "unknown flag: --project-name"; ie. running Kafka... brew install docker-compose Then executed these commands noted here, as per: https://github.com/docker/compose/issues/8630#issuecomment-1169537632 mkdir -p ~/.docker/cli-plugins ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose Finally removed this from this file: ~/.docker/config.json "credsStore" : "desktop",

~ If it still fails when mounting the entire workspace as volume then try increasing the memory you give Colima memory: 16

Here are some other useful commands as you debug: colima status docker info docker images docker ps -a docker start <container-id> docker container prune source ~/.zshrc

~ Fingers crossed this is helpful in some way 😸

OliHarris avatar Jul 12 '22 16:07 OliHarris

@OliHarris Thanks for the detailed description! Unfortunately, this solution doesn't work for me, all I got - "cannot create a database connection" when trying to use org.testcontainers.jdbc.ContainerDatabaseDriver jdbc driver. But at least I can run an oracle-xe container with the usual docker run command and connect with oracle.jdbc.OracleDriver.

artemzi avatar Jul 12 '22 17:07 artemzi

Hi @artemzi I updated my comment above - I didn't need to update my .zshrc file - basically run Colima with a lot of memory; if 8 does not work then go for 16. Then after the DB builds you can colima stop and then colima start with a more sensbile memory allocation. You can then bring the build DB back online with:

docker ps -a
docker start <container-id>

Thanks and good luck!!

OliHarris avatar Jul 15 '22 09:07 OliHarris