diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe index 4e157640ea..845293980e 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe @@ -50,7 +50,8 @@ ENV ORACLE_BASE=/u01/app/oracle \ CONFIG_RSP="xe.rsp" \ RUN_FILE="runOracle.sh" \ PWD_FILE="setPassword.sh" \ - CHECK_DB_FILE="checkDBStatus.sh" + CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" # Use second ENV so that variable get substituted ENV PATH=$ORACLE_HOME/bin:$PATH diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh index df473ab922..00a572a287 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh @@ -12,6 +12,11 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + POSITIVE_RETURN="OPEN" ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh index babd0235c0..fb7c6d00ae 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh @@ -190,7 +190,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -199,6 +199,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee index 82e80ec245..5527c8adac 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee @@ -52,6 +52,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 index 28e8c126f7..dba2d0d7da 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 @@ -52,6 +52,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh index a96fe77e91..26573ced04 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh @@ -12,6 +12,11 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" ORAENV_ASK=NO diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh index cb94a9f00f..dd5c4dee85 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile index 71df07b58f..fd30203ea7 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile @@ -46,6 +46,7 @@ ENV ORACLE_BASE=/opt/oracle \ RUN_FILE="runOracle.sh" \ START_FILE="startDB.sh" \ CREATE_DB_FILE="createDB.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh index a96fe77e91..26573ced04 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh @@ -12,6 +12,11 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" ORAENV_ASK=NO diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh index cb94a9f00f..dd5c4dee85 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile index 608cb49f12..57427eec63 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile @@ -49,6 +49,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh index a96fe77e91..26573ced04 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh @@ -12,6 +12,11 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" ORAENV_ASK=NO diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh index 00b81a5db5..56b21eb2ac 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh index ba803718e7..ee83f082b1 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh @@ -12,6 +12,11 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" ORAENV_ASK=NO diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh index fbff9cf649..7619855138 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh @@ -201,7 +201,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -210,6 +210,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile index 04c2704694..e1695ed48b 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile @@ -56,6 +56,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ RELINK_BINARY_FILE="relinkOracleBinary.sh" \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh index 1743029a4d..a9436f3a84 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh @@ -73,6 +73,11 @@ EOF ################ MAIN ####################### ############################################# +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + # Setting up ORACLE_PWD if podman secret is passed on if [ -e '/run/secrets/oracle_pwd' ]; then export ORACLE_PWD="$(cat '/run/secrets/oracle_pwd')" diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh index 2a5bcc2908..04b6e6a7b0 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh @@ -272,7 +272,7 @@ else "$ORACLE_BASE"/"$CREATE_DB_FILE" "$ORACLE_SID" "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; # Check whether database is successfully created - if "$ORACLE_BASE"/"$CHECK_DB_FILE"; then + if IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE"; then # Create a checkpoint file if database is successfully created # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode date -Iseconds > "$ORACLE_BASE"/oradata/."${ORACLE_SID}""${CHECKPOINT_FILE_EXTN}" @@ -295,7 +295,7 @@ else fi; # Check whether database is up and running -"$ORACLE_BASE"/"$CHECK_DB_FILE" +IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE" status=$? if [ $status -eq 0 ]; then @@ -308,6 +308,8 @@ if [ $status -eq 0 ]; then # Execute custom provided startup scripts "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile index 0ba206efc3..6f89cb63c1 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile @@ -55,6 +55,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ RELINK_BINARY_FILE="relinkOracleBinary.sh" \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe index 34c16357dc..fa5926556f 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe @@ -47,6 +47,7 @@ ENV ORACLE_BASE=/opt/oracle \ CONF_FILE="oracle-xe-21c.conf" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CONFIG_TCPS_FILE="configTcps.sh" \ INSTALL_DIR="$HOME/install" \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh index 26e5e2a7e9..38d1b750f5 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh @@ -73,6 +73,11 @@ EOF ################ MAIN ####################### ############################################# +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + # Setting up ORACLE_PWD if podman secret is passed on if [ -e '/run/secrets/oracle_pwd' ]; then export ORACLE_PWD="$(cat '/run/secrets/oracle_pwd')" diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh index c8f1d734a7..6bc626a03d 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh @@ -280,7 +280,7 @@ else "$ORACLE_BASE"/"$CREATE_DB_FILE" $ORACLE_SID "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; # Check whether database is successfully created - if "$ORACLE_BASE"/"$CHECK_DB_FILE"; then + if IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE"; then # Create a checkpoint file if database is successfully created # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode echo "$(date -Iseconds)" > "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" @@ -303,7 +303,7 @@ else fi; # Check whether database is up and running -"$ORACLE_BASE"/"$CHECK_DB_FILE" +IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE" status=$? # Check whether database is up and running @@ -317,7 +317,9 @@ if [ $status -eq 0 ]; then # Execute custom provided startup scripts "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup - + + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/Containerfile.free b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/Containerfile.free index 7af0793213..3971f5084c 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/Containerfile.free +++ b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/Containerfile.free @@ -46,6 +46,7 @@ ENV ORACLE_BASE=/opt/oracle \ CONF_FILE="oracle-free-23ai.conf" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ DECRYPT_PWD_FILE="decryptPassword.sh" \ CONFIG_TCPS_FILE="configTcps.sh" \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/checkDBStatus.sh index e66feeb655..bfa8d22662 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/checkDBStatus.sh @@ -77,6 +77,11 @@ EOF ################ MAIN ####################### ############################################# +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + ORACLE_PWD=$($ORACLE_BASE/$DECRYPT_PWD_FILE) export ORACLE_PWD diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/runOracle.sh index 275f68735a..dc72b196c9 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.5.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.5.0/runOracle.sh @@ -273,7 +273,7 @@ else "$ORACLE_BASE"/"$CREATE_DB_FILE" $ORACLE_SID "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; for i in 1 2 4 8; do - "$ORACLE_BASE"/"$CHECK_DB_FILE"; + IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE"; ret=$? # Check whether database is successfully created if [ $ret -eq 0 ]; then @@ -308,7 +308,7 @@ fi; for i in 1 2 4 8; do # Check whether database is up and running - "$ORACLE_BASE"/"$CHECK_DB_FILE" + IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE" status=$? if [ $status -eq 5 ]; then # PDB is in mounted state @@ -331,6 +331,8 @@ if [ $status -eq 0 ]; then # Execute custom provided startup scripts "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############"