File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed
OracleDatabase/SingleInstance/dockerfiles/21.3.0 Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ ENV ORACLE_BASE=/opt/oracle \
5555 SETUP_LINUX_FILE="setupLinuxEnv.sh" \
5656 CHECK_SPACE_FILE="checkSpace.sh" \
5757 CHECK_DB_FILE="checkDBStatus.sh" \
58+ DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \
5859 USER_SCRIPTS_FILE="runUserScripts.sh" \
5960 INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
6061 RELINK_BINARY_FILE="relinkOracleBinary.sh" \
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ ENV ORACLE_BASE=/opt/oracle \
4747 CONF_FILE="oracle-xe-21c.conf" \
4848 CHECK_SPACE_FILE="checkSpace.sh" \
4949 CHECK_DB_FILE="checkDBStatus.sh" \
50+ DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \
5051 SETUP_LINUX_FILE="setupLinuxEnv.sh" \
5152 CONFIG_TCPS_FILE="configTcps.sh" \
5253 INSTALL_DIR="$HOME/install" \
Original file line number Diff line number Diff line change 7373# ############### MAIN #######################
7474# ############################################
7575
76+ if [ " $IGNORE_DB_STARTED_MARKER " != true ] && [ ! -f " $DB_STARTED_MARKER_FILE " ]; then
77+ echo " Database was not started yet." >&2
78+ exit 1
79+ fi
80+
7681# Setting up ORACLE_PWD if podman secret is passed on
7782if [ -e ' /run/secrets/oracle_pwd' ]; then
7883 export ORACLE_PWD=" $( cat ' /run/secrets/oracle_pwd' ) "
Original file line number Diff line number Diff line change 280280 " $ORACLE_BASE " /" $CREATE_DB_FILE " $ORACLE_SID " $ORACLE_PDB " " $ORACLE_PWD " || exit 1;
281281
282282 # Check whether database is successfully created
283- if " $ORACLE_BASE " /" $CHECK_DB_FILE " ; then
283+ if IGNORE_DB_STARTED_MARKER=true " $ORACLE_BASE " /" $CHECK_DB_FILE " ; then
284284 # Create a checkpoint file if database is successfully created
285285 # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode
286286 echo " $( date -Iseconds) " > " $ORACLE_BASE " /oradata/.${ORACLE_SID} " ${CHECKPOINT_FILE_EXTN} "
303303fi ;
304304
305305# Check whether database is up and running
306- " $ORACLE_BASE " /" $CHECK_DB_FILE "
306+ IGNORE_DB_STARTED_MARKER=true " $ORACLE_BASE " /" $CHECK_DB_FILE "
307307status=$?
308308
309309# Check whether database is up and running
@@ -317,7 +317,9 @@ if [ $status -eq 0 ]; then
317317
318318 # Execute custom provided startup scripts
319319 " $ORACLE_BASE " /" $USER_SCRIPTS_FILE " " $ORACLE_BASE " /scripts/startup
320-
320+
321+ # Create marker file for the health check
322+ touch " $DB_STARTED_MARKER_FILE "
321323else
322324 echo " #####################################"
323325 echo " ########### E R R O R ###############"
You can’t perform that action at this time.
0 commit comments