Skip to content

Commit b245460

Browse files
committed
add_gdd
1 parent bd226c8 commit b245460

103 files changed

Lines changed: 28592 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/super-linter.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ VALIDATE_BASH=true
55
VALIDATE_BASH_EXEC=true
66
VALIDATE_DOCKERFILE_HADOLINT=true
77
VALIDATE_GITHUB_ACTIONS=true
8-
VALIDATE_MARKDOWN=true

OracleDatabase/GDD/README.md

Lines changed: 338 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
###############################################################################
3+
## Copyright(c) Oracle Corporation 1998,2019. All rights reserved. ##
4+
## ##
5+
## Specify values for the variables listed below to customize ##
6+
## your installation. ##
7+
## ##
8+
## Each variable is associated with a comment. The comment ##
9+
## can help to populate the variables with the appropriate ##
10+
## values. ##
11+
## ##
12+
###############################################################################
13+
14+
#-------------------------------------------------------------------------------
15+
# Do not change the following system generated value.
16+
#-------------------------------------------------------------------------------
17+
oracle.install.responseFileVersion=/oracle/install/rspfmt_gsminstall_response_schema_v19.0.0
18+
19+
#-------------------------------------------------------------------------------
20+
# Unix group to be set for the inventory directory.
21+
#-------------------------------------------------------------------------------
22+
UNIX_GROUP_NAME=oinstall
23+
#-------------------------------------------------------------------------------
24+
# Inventory location.
25+
#-------------------------------------------------------------------------------
26+
INVENTORY_LOCATION=###INVENTORY###
27+
#-------------------------------------------------------------------------------
28+
# Complete path of the Oracle Home
29+
#-------------------------------------------------------------------------------
30+
ORACLE_HOME=###ORACLE_HOME###
31+
32+
#-------------------------------------------------------------------------------
33+
# Complete path of the Oracle Base.
34+
#-------------------------------------------------------------------------------
35+
ORACLE_BASE=###ORACLE_BASE###
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
###############################################################################
3+
## Copyright(c) Oracle Corporation 1998,2019. All rights reserved. ##
4+
## ##
5+
## Specify values for the variables listed below to customize ##
6+
## your installation. ##
7+
## ##
8+
## Each variable is associated with a comment. The comment ##
9+
## can help to populate the variables with the appropriate ##
10+
## values. ##
11+
## ##
12+
###############################################################################
13+
14+
#-------------------------------------------------------------------------------
15+
# Do not change the following system generated value.
16+
#-------------------------------------------------------------------------------
17+
oracle.install.responseFileVersion=/oracle/install/rspfmt_gsminstall_response_schema_v19.0.0
18+
19+
#-------------------------------------------------------------------------------
20+
# Unix group to be set for the inventory directory.
21+
#-------------------------------------------------------------------------------
22+
UNIX_GROUP_NAME=
23+
#-------------------------------------------------------------------------------
24+
# Inventory location.
25+
#-------------------------------------------------------------------------------
26+
INVENTORY_LOCATION=
27+
#-------------------------------------------------------------------------------
28+
# Complete path of the Oracle Home
29+
#-------------------------------------------------------------------------------
30+
ORACLE_HOME=
31+
32+
#-------------------------------------------------------------------------------
33+
# Complete path of the Oracle Base.
34+
#-------------------------------------------------------------------------------
35+
ORACLE_BASE=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0edb0a62772436083ec102f351b4c772 LINUX.X64_193000_gsm.zip
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# LICENSE UPL 1.0
2+
#
3+
# Copyright (c) 2018,2021 Oracle and/or its affiliates.
4+
#
5+
# ORACLE DOCKERFILES PROJECT
6+
# --------------------------
7+
# This is the Dockerfile for Oracle GSM 19c Release to build the container image
8+
# MAINTAINER <paramdeep.saini@oracle.com>
9+
#
10+
# This is the Dockerfile for Oracle GSM 19c
11+
#
12+
# REQUIRED FILES TO BUILD THIS IMAGE
13+
# ----------------------------------
14+
# (1) LINUX.X64_193000_gsm.zip
15+
# Download Oracle Database 19c GSM Software
16+
# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
17+
#
18+
# HOW TO BUILD THIS IMAGE
19+
# -----------------------
20+
# Put all downloaded files in the same directory as this Dockerfile
21+
# Run:
22+
# $ docker build -t oracle/gsm:19.3.0 .
23+
#
24+
# Pull base image
25+
# ---------------
26+
ARG BASE_OL_IMAGE=oraclelinux:7-slim
27+
28+
# Pull base image
29+
# ---------------
30+
FROM $BASE_OL_IMAGE AS base
31+
ARG VERSION
32+
33+
# Labels
34+
# ------
35+
LABEL "provider"="Oracle" \
36+
"issues"="https://github.com/oracle/docker-images/issues" \
37+
"volume.setup.location1"="/opt/oracle/scripts" \
38+
"port.listener"="1522"
39+
40+
# Argument to control removal of components not needed after db software installation
41+
ARG SLIMMING=false
42+
ARG INSTALL_FILE_1="LINUX.X64_193000_gsm.zip"
43+
44+
# Environment variables required for this build (do NOT change)
45+
# -------------------------------------------------------------
46+
ENV GSM_BASE="/u01/app/oracle" \
47+
GSM_HOME="/u01/app/oracle/product/19c/gsmhome_1" \
48+
INVENTORY="/u01/app/oracle/oraInventory" \
49+
INSTALL_DIR="/opt/oracle/scripts" \
50+
INSTALL_FILE_1=$INSTALL_FILE_1 \
51+
INSTALL_RSP="19c_gsm_install.rsp" \
52+
RUN_FILE="runOracle.sh" \
53+
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
54+
CHECK_SPACE_FILE="checkSpace.sh" \
55+
USER_SCRIPTS_FILE="runUserScripts.sh" \
56+
INSTALL_GSM_BINARIES_FILE="installGSMBinaries.sh" \
57+
GSM_SETUP_FILE="setupOshardEnv.sh" \
58+
GSM_ENV_SETUP_FILE="setupGSM.sh" \
59+
GSM_SCRIPTS="scripts" \
60+
MAINPY="main.py" \
61+
PYTHON_FILE="/usr/bin/python" \
62+
PYTHON3_FILE="/usr/bin/python3.6" \
63+
CHECKLIVENESS="checkLiveness.sh"
64+
# Use second ENV so that variable get substituted
65+
# hadolint ignore=DL3044
66+
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
67+
ORACLE_HOME=$GSM_HOME \
68+
ORACLE_BASE=$GSM_BASE \
69+
SCRIPT_DIR=$INSTALL_DIR/sharding \
70+
SHARD_SCRIPT_DIR=$INSTALL_DIR/sharding \
71+
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
72+
GSM_PATH=$GSM_HOME/bin:$PATH \
73+
GSM_LD_LIBRARY_PATH=$GSM_HOME/lib:/usr/lib:/lib
74+
75+
76+
# Copy files needed during both installation and runtime
77+
# ------------
78+
COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$GSM_ENV_SETUP_FILE $INSTALL_DIR/install/
79+
COPY $VERSION/$RUN_FILE $VERSION/$GSM_SETUP_FILE $VERSION/$CHECKLIVENESS $VERSION/$USER_SCRIPTS_FILE $SCRIPT_DIR/
80+
COPY $GSM_SCRIPTS $SCRIPT_DIR/scripts/
81+
82+
RUN chmod 755 $INSTALL_DIR/install/*.sh && \
83+
sync && \
84+
$INSTALL_DIR/install/$CHECK_SPACE_FILE && \
85+
$INSTALL_DIR/install/$SETUP_LINUX_FILE && \
86+
$INSTALL_DIR/install/$GSM_ENV_SETUP_FILE && \
87+
sync
88+
89+
#############################################
90+
# -------------------------------------------
91+
# Start new stage for installing the GSM
92+
# -------------------------------------------
93+
#############################################
94+
95+
from base AS builder
96+
ARG VERSION
97+
98+
COPY $VERSION/$INSTALL_FILE_1 $VERSION/$INSTALL_RSP $VERSION/$INSTALL_GSM_BINARIES_FILE $VERSION/$GSM_SETUP_FILE $INSTALL_DIR/install/
99+
100+
RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \
101+
sync && \
102+
sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
103+
sed -e '/ *nofile /s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
104+
su oracle -c "$INSTALL_DIR/install/$INSTALL_GSM_BINARIES_FILE" && \
105+
$INVENTORY/orainstRoot.sh && \
106+
$GSM_HOME/root.sh && \
107+
rm -rf $INSTALL_DIR/install && \
108+
rm -f /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf && \
109+
rm -f /etc/sysctl.d/99-sysctl.conf && \
110+
rm -f /etc/rc.d/init.d/oracle-database-preinstall-19c-firstboot && \
111+
rm -f /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
112+
sync
113+
114+
#############################################
115+
# -------------------------------------------
116+
# Start new layer for GSM runtime
117+
# -------------------------------------------
118+
#############################################
119+
120+
FROM base
121+
122+
COPY --from=builder /u01 /u01
123+
124+
RUN test -x "$PYTHON3_FILE" && \
125+
ln -sf $PYTHON3_FILE $PYTHON_FILE && \
126+
rm -f $INSTALL_DIR/install/* && \
127+
cp $SCRIPT_DIR/scripts/cmdExec $SCRIPT_DIR/ && \
128+
for helper in cmdExec main.py orapcatalog.py orapshard.py orascatalog.py oracommon.py demoapp.sql runOraShardSetup.sh oramachine.py oralogger.py orafactory.py oragsm.py orasshard.py oraenv.py; do \
129+
ln -sf scripts/$helper $SHARD_SCRIPT_DIR/$helper; \
130+
done && \
131+
ln -sf ../$CHECKLIVENESS $SCRIPT_DIR/scripts/$CHECKLIVENESS && \
132+
chown -R oracle:oinstall $SCRIPT_DIR && \
133+
chmod 755 $SCRIPT_DIR/*.sh && \
134+
chmod 755 $SCRIPT_DIR/scripts/*.py && \
135+
chmod 755 $SCRIPT_DIR/scripts/*.sh && \
136+
chmod 755 $SCRIPT_DIR/scripts/cmdExec && \
137+
chmod 755 $SCRIPT_DIR/cmdExec && \
138+
sync
139+
140+
USER oracle
141+
WORKDIR /home/oracle
142+
EXPOSE 1521
143+
144+
VOLUME ["$GSM_BASE/oradata"]
145+
146+
HEALTHCHECK --interval=2m --start-period=25m \
147+
CMD "$SCRIPT_DIR/$CHECKLIVENESS" >/dev/null || exit 1
148+
149+
# Define default command to start Oracle Database.
150+
CMD exec $SCRIPT_DIR/$RUN_FILE
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2020, Oracle Corporation and/or affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
# MAINTAINER <paramdeep.saini@oracle.com>
4+
#
5+
# This is the Dockerfile for Oracle Database 19c
6+
#
7+
# REQUIRED FILES TO BUILD THIS IMAGE
8+
# ----------------------------------
9+
# (1) LINUX.X64_193000_gsm.zip
10+
# Download Oracle Database 19c GSM Software
11+
# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
12+
#
13+
# HOW TO BUILD THIS IMAGE
14+
# -----------------------
15+
# Put all downloaded files in the same directory as this Dockerfile
16+
# Run:
17+
# $ docker build -t oracle/gsm:19.3.0 .
18+
#
19+
# Pull base image
20+
# ---------------
21+
FROM oraclelinux:7-slim as base
22+
23+
# Maintainer
24+
# ----------
25+
MAINTAINER Paramdeep Saini <paramdeep.saini@oracle.com>
26+
27+
# Environment variables required for this build (do NOT change)
28+
# -------------------------------------------------------------
29+
ENV GSM_BASE="/u01/app/oracle" \
30+
GSM_HOME="/u01/app/oracle/product/19c/gsmhome_1" \
31+
INVENTORY="/u01/app/oracle/oraInventory" \
32+
INSTALL_DIR="/opt/oracle/scripts" \
33+
INSTALL_FILE_1="LINUX.X64_193000_gsm.zip" \
34+
INSTALL_RSP="19c_gsm_install.rsp" \
35+
RUN_FILE="runOracle.sh" \
36+
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
37+
CHECK_SPACE_FILE="checkSpace.sh" \
38+
USER_SCRIPTS_FILE="runUserScripts.sh" \
39+
INSTALL_GSM_BINARIES_FILE="installGSMBinaries.sh" \
40+
GSM_SETUP_FILE="setupOshardEnv.sh" \
41+
GSM_ENV_SETUP_FILE="setupGSM.sh" \
42+
GSM_SCRIPTS="scripts"
43+
MAINPY="main.py" \
44+
# Use second ENV so that variable get substituted
45+
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
46+
ORACLE_HOME=$GSM_HOME \
47+
ORACLE_BASE=$GSM_BASE \
48+
SCRIPT_DIR=$INSTALL_DIR/startup \
49+
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \
50+
GSM_PATH=$GSM_HOME/bin:/usr/sbin:$PATH \
51+
GSM_LD_LIBRARY_PATH=$GSM_HOME/lib:/usr/lib:/lib
52+
53+
54+
# Copy files needed during both installation and runtime
55+
# ------------
56+
COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_RSP $GSM_ENV_SETUP_FILE $INSTALL_GSM_BINARIES_FILE $GSM_SETUP_FILE $INSTALL_DIR/install/
57+
COPY $RUN_FILE $GSM_SETUP_FILE $USER_SCRIPTS_FILE $INSTALL_DIR/sharding
58+
COPY $GSM_SCRIPTS $INSTALL_DIR/sharding/scripts
59+
60+
RUN chmod 755 $INSTALL_DIR/install/*.sh && \
61+
sync && \
62+
$INSTALL_DIR/install/$CHECK_SPACE_FILE && \
63+
$INSTALL_DIR/install/$SETUP_LINUX_FILE && \
64+
$INSTALL_DIR/install/$GSM_ENV_SETUP_FILE && \
65+
sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
66+
su oracle -c "$INSTALL_DIR/install/$INSTALL_GSM_BINARIES_FILE" && \
67+
$INVENTORY/orainstRoot.sh && \
68+
$GSM_HOME/root.sh && \
69+
rm -rf $INSTALL_DIR/install && \
70+
rm -f /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf && \
71+
rm -f /etc/sysctl.d/99-sysctl.conf && \
72+
rm -f /etc/rc.d/init.d/oracle-database-preinstall-19c-firstboot && \
73+
rm -f /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
74+
rm -f $INSTALL_DIR/install/* && \
75+
chown -R oracle:oinstall $SCRIPT_DIR && \
76+
chmod 755 $SCRIPT_DIR/*.sh && \
77+
sync
78+
79+
USER oracle
80+
WORKDIR /home/oracle
81+
EXPOSE 1521
82+
83+
VOLUME ["$GSM_BASE/oradata"]
84+
85+
HEALTHCHECK --interval=1m --start-period=10m \
86+
CMD "$INSTALL_DIR/sharding/scripts/MAINPY" >/dev/null || exit 1
87+
88+
# Define default command to start Oracle Database.
89+
CMD exec $INSTALL_DIR/startup/$RUN_FILE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
export PYTHON="/bin/python"
4+
GSM_STARTUP_FAILURE_MARKER="${GSM_STARTUP_FAILURE_MARKER:-/tmp/gsm-startup.failed}"
5+
ENABLE_DEBUG="${ENABLE_DEBUG:-false}"
6+
7+
if [ "${ENABLE_DEBUG}" = "true" ] && [ -f "$GSM_STARTUP_FAILURE_MARKER" ]; then
8+
echo "GSM startup failure marker found and ENABLE_DEBUG=true; bypassing liveness for debugging."
9+
exit 0
10+
fi
11+
12+
if [ -z "${SHARD_SCRIPT_DIR}" ]; then
13+
SHARD_SCRIPT_DIR=$SCRIPT_DIR
14+
fi
15+
16+
if [ -f "$SHARD_SCRIPT_DIR/$MAINPY" ]; then
17+
CHECK_SCRIPT="$SHARD_SCRIPT_DIR/$MAINPY"
18+
else
19+
CHECK_SCRIPT="$SHARD_SCRIPT_DIR/scripts/$MAINPY"
20+
fi
21+
22+
$PYTHON "$CHECK_SCRIPT" --checkliveness='true'
23+
retcode=$?
24+
25+
if [ ${retcode} -eq 0 ]; then
26+
exit 0
27+
else
28+
exit 1
29+
fi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# Copyright 2020, Oracle Corporation and/or affiliates. All rights reserved.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl
4+
# MAINTAINER <paramdeep.saini@oracle.com>
5+
6+
REQUIRED_SPACE_GB=2
7+
AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{ print $4 }'`
8+
9+
if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then
10+
script_name=`basename "$0"`
11+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
12+
echo "$script_name: ERROR - There is not enough space available in the docker container."
13+
echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB, but only $AVAILABLE_SPACE_GB GB are available."
14+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
15+
exit 1;
16+
fi;

0 commit comments

Comments
 (0)