File tree 4 files changed +12
-3
lines changed
OracleDatabase/SingleInstance/dockerfiles/21.3.0
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 \
55
55
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
56
56
CHECK_SPACE_FILE="checkSpace.sh" \
57
57
CHECK_DB_FILE="checkDBStatus.sh" \
58
+ DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \
58
59
USER_SCRIPTS_FILE="runUserScripts.sh" \
59
60
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
60
61
RELINK_BINARY_FILE="relinkOracleBinary.sh" \
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ ENV ORACLE_BASE=/opt/oracle \
47
47
CONF_FILE="oracle-xe-21c.conf" \
48
48
CHECK_SPACE_FILE="checkSpace.sh" \
49
49
CHECK_DB_FILE="checkDBStatus.sh" \
50
+ DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \
50
51
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
51
52
CONFIG_TCPS_FILE="configTcps.sh" \
52
53
INSTALL_DIR="$HOME/install" \
Original file line number Diff line number Diff line change 73
73
# ############### MAIN #######################
74
74
# ############################################
75
75
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
+
76
81
# Setting up ORACLE_PWD if podman secret is passed on
77
82
if [ -e ' /run/secrets/oracle_pwd' ]; then
78
83
export ORACLE_PWD=" $( cat ' /run/secrets/oracle_pwd' ) "
Original file line number Diff line number Diff line change 280
280
" $ORACLE_BASE " /" $CREATE_DB_FILE " $ORACLE_SID " $ORACLE_PDB " " $ORACLE_PWD " || exit 1;
281
281
282
282
# 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
284
284
# Create a checkpoint file if database is successfully created
285
285
# Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode
286
286
echo " $( date -Iseconds) " > " $ORACLE_BASE " /oradata/.${ORACLE_SID} " ${CHECKPOINT_FILE_EXTN} "
303
303
fi ;
304
304
305
305
# Check whether database is up and running
306
- " $ORACLE_BASE " /" $CHECK_DB_FILE "
306
+ IGNORE_DB_STARTED_MARKER=true " $ORACLE_BASE " /" $CHECK_DB_FILE "
307
307
status=$?
308
308
309
309
# Check whether database is up and running
@@ -317,7 +317,9 @@ if [ $status -eq 0 ]; then
317
317
318
318
# Execute custom provided startup scripts
319
319
" $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 "
321
323
else
322
324
echo " #####################################"
323
325
echo " ########### E R R O R ###############"
You can’t perform that action at this time.
0 commit comments