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.58k stars 5.43k forks source link

Using podman on a Mac with local volumes. #2470

Open seanleblancicdtech opened 2 years ago

seanleblancicdtech commented 2 years ago

I'm trying to use podman on a mac with this image. What I'd like to do is have two volumes and be able to place stuff into /opt/oracle/admin, and preserve data in /opt/oracle/oradata as well, so I try to start like this:

docker run -v $HOME/oradata:/opt/oracle/oradata -v $HOME/oraadmin:/opt/oracle/admin -p 1521:1521 oracle/database:19.3.0-ee

(I have a soft link from docker to podman by the way, so it's really using podman)

This runs for some time, then I get this error:

51% complete
54% complete
Creating Pluggable Databases
[WARNING] ORA-65028: Unable to open plugin data file at path /opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
ORA-27041: unable to open file

[FATAL] ORA-65104: operation not allowed on an inactive pluggable database

ORA-65104: operation not allowed on an inactive pluggable database

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.
[ 2022-09-23 03:45:05.694 UTC ] Prepare for db operation
DBCA_PROGRESS : 8%
[ 2022-09-23 03:45:05.896 UTC ] Copying database files
DBCA_PROGRESS : 31%
[ 2022-09-23 03:46:15.281 UTC ] Creating and starting Oracle instance
DBCA_PROGRESS : 32%
DBCA_PROGRESS : 36%
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 43%
DBCA_PROGRESS : 46%
[ 2022-09-23 03:56:49.757 UTC ] Completing Database Creation
DBCA_PROGRESS : 51%
DBCA_PROGRESS : 54%
[ 2022-09-23 03:59:11.363 UTC ] Creating Pluggable Databases
[ 2022-09-23 03:59:14.378 UTC ] [WARNING] ORA-65028: Unable to open plugin data file at path /opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
ORA-27041: unable to open file

Update: I went through this and confirmed that I can see a volume (or volumes) with a podman docker container:

https://medium.com/@butkovic/favoring-podman-over-docker-desktop-33368e031ba0

More details:

I do this:

podman machine init --cpus=4 --disk-size=80 --memory=8192 -v $HOME:$HOME

Then build the image like this:

export BUILDAH_FORMAT=docker;export BUILDAH_ISOLATION=chroot;./buildContainerImage.sh -i -e -v 19.3.0

Then try to start up:

ORACLE EDITION: ENTERPRISE

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-SEP-2022 05:38:12

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/c7baa531bbd5/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                23-SEP-2022 05:38:12
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/c7baa531bbd5/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
[WARNING] ORA-03135: connection lost contact

[FATAL] ORA-03114: not connected to ORACLE

54% complete
100% complete
[FATAL] ORA-03114: not connected to ORACLE

46% complete
31% complete
8% complete
0% complete
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
[ 2022-09-23 05:38:23.553 UTC ] Prepare for db operation
DBCA_PROGRESS : 8%
[ 2022-09-23 05:38:23.811 UTC ] Copying database files
DBCA_PROGRESS : 31%
[ 2022-09-23 05:39:33.163 UTC ] Creating and starting Oracle instance
DBCA_PROGRESS : 32%
DBCA_PROGRESS : 36%
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 43%
DBCA_PROGRESS : 46%
[ 2022-09-23 05:52:02.485 UTC ] Completing Database Creation
DBCA_PROGRESS : 51%
[ 2022-09-23 05:53:58.635 UTC ] [WARNING] ORA-03135: connection lost contact

[ 2022-09-23 05:53:58.638 UTC ] [FATAL] ORA-03114: not connected to ORACLE

DBCA_PROGRESS : 54%
DBCA_PROGRESS : 100%
[ 2022-09-23 05:53:58.658 UTC ] [FATAL] ORA-03114: not connected to ORACLE

DBCA_PROGRESS : 46%
DBCA_PROGRESS : 31%
DBCA_PROGRESS : 8%
DBCA_PROGRESS : 0%

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 23 05:54:06 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL>    ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' scope=spfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    ALTER SYSTEM SET local_listener=''
*
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> BEGIN DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); END;

*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL> SQL>    ALTER SESSION SET "_oracle_script" = true
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    CREATE USER OPS$oracle IDENTIFIED EXTERNALLY
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    GRANT CREATE SESSION TO OPS$oracle
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    GRANT SELECT ON sys.v_$pdbs TO OPS$oracle
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    GRANT SELECT ON sys.v_$database TO OPS$oracle
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL>    ALTER USER OPS$oracle SET container_data=all for sys.v_$pdbs container = current
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL> SQL> Disconnected
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
mv: cannot stat '/opt/oracle/product/19c/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:
Instance terminated by USER, pid = 1577
2022-09-23T05:53:59.867564+00:00
Warning: 2 processes are still attacheded to shmid 15:
 (size: 16384 bytes, creator pid: 1535, last attach/detach pid: 1558)
2022-09-23T05:53:59.936349+00:00
License high water mark = 11
2022-09-23T05:54:00.938388+00:00
USER(prelim) (ospid: 2484): terminating the instance
2022-09-23T05:54:00.939442+00:00
Instance terminated by USER(prelim), pid = 2484

Any ideas here? If I don't set any volume flag(s), it will start up.

russgold commented 2 years ago

This isn't actually an issue about about oracle docker images, but one of our engineers suggests that this article might be helpful. https://medium.com/intuit-engineering/how-to-getting-podman-to-correctly-mount-a-native-folder-on-a-mac-73eb2a4ee317