Skip to content

Commit 9ba9ed7

Browse files
committed
add_gdd
1 parent bd226c8 commit 9ba9ed7

102 files changed

Lines changed: 28589 additions & 12 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.

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: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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+
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
66+
ORACLE_HOME=$GSM_HOME \
67+
ORACLE_BASE=$GSM_BASE \
68+
SCRIPT_DIR=$INSTALL_DIR/sharding \
69+
SHARD_SCRIPT_DIR=$INSTALL_DIR/sharding \
70+
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
71+
GSM_PATH=$GSM_HOME/bin:$PATH \
72+
GSM_LD_LIBRARY_PATH=$GSM_HOME/lib:/usr/lib:/lib
73+
74+
75+
# Copy files needed during both installation and runtime
76+
# ------------
77+
COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$GSM_ENV_SETUP_FILE $INSTALL_DIR/install/
78+
COPY $VERSION/$RUN_FILE $VERSION/$GSM_SETUP_FILE $VERSION/$CHECKLIVENESS $VERSION/$USER_SCRIPTS_FILE $SCRIPT_DIR/
79+
COPY $GSM_SCRIPTS $SCRIPT_DIR/scripts/
80+
81+
RUN chmod 755 $INSTALL_DIR/install/*.sh && \
82+
sync && \
83+
$INSTALL_DIR/install/$CHECK_SPACE_FILE && \
84+
$INSTALL_DIR/install/$SETUP_LINUX_FILE && \
85+
$INSTALL_DIR/install/$GSM_ENV_SETUP_FILE && \
86+
sync
87+
88+
#############################################
89+
# -------------------------------------------
90+
# Start new stage for installing the GSM
91+
# -------------------------------------------
92+
#############################################
93+
94+
from base AS builder
95+
ARG VERSION
96+
97+
COPY $VERSION/$INSTALL_FILE_1 $VERSION/$INSTALL_RSP $VERSION/$INSTALL_GSM_BINARIES_FILE $VERSION/$GSM_SETUP_FILE $INSTALL_DIR/install/
98+
99+
RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \
100+
sync && \
101+
sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
102+
sed -e '/ *nofile /s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
103+
su oracle -c "$INSTALL_DIR/install/$INSTALL_GSM_BINARIES_FILE" && \
104+
$INVENTORY/orainstRoot.sh && \
105+
$GSM_HOME/root.sh && \
106+
rm -rf $INSTALL_DIR/install && \
107+
rm -f /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf && \
108+
rm -f /etc/sysctl.d/99-sysctl.conf && \
109+
rm -f /etc/rc.d/init.d/oracle-database-preinstall-19c-firstboot && \
110+
rm -f /etc/security/limits.d/oracle-database-preinstall-19c.conf && \
111+
sync
112+
113+
#############################################
114+
# -------------------------------------------
115+
# Start new layer for GSM runtime
116+
# -------------------------------------------
117+
#############################################
118+
119+
FROM base
120+
121+
COPY --from=builder /u01 /u01
122+
123+
RUN test -x "$PYTHON3_FILE" && \
124+
ln -sf $PYTHON3_FILE $PYTHON_FILE && \
125+
rm -f $INSTALL_DIR/install/* && \
126+
cp $SCRIPT_DIR/scripts/cmdExec $SCRIPT_DIR/ && \
127+
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 \
128+
ln -sf scripts/$helper $SHARD_SCRIPT_DIR/$helper; \
129+
done && \
130+
ln -sf ../$CHECKLIVENESS $SCRIPT_DIR/scripts/$CHECKLIVENESS && \
131+
chown -R oracle:oinstall $SCRIPT_DIR && \
132+
chmod 755 $SCRIPT_DIR/*.sh && \
133+
chmod 755 $SCRIPT_DIR/scripts/*.py && \
134+
chmod 755 $SCRIPT_DIR/scripts/*.sh && \
135+
chmod 755 $SCRIPT_DIR/scripts/cmdExec && \
136+
chmod 755 $SCRIPT_DIR/cmdExec && \
137+
sync
138+
139+
USER oracle
140+
WORKDIR /home/oracle
141+
EXPOSE 1521
142+
143+
VOLUME ["$GSM_BASE/oradata"]
144+
145+
HEALTHCHECK --interval=2m --start-period=25m \
146+
CMD "$SCRIPT_DIR/$CHECKLIVENESS" >/dev/null || exit 1
147+
148+
# Define default command to start Oracle Database.
149+
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;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
export ORACLE_BASE=$GSM_BASE
7+
export ORACLE_HOME=$GSM_HOME
8+
9+
# Check whether ORACLE_BASE is set
10+
if [ "$ORACLE_BASE" == "" ]; then
11+
echo "ERROR: ORACLE_BASE has not been set!"
12+
echo "You have to have the ORACLE_BASE environment variable set to a valid value!"
13+
exit 1;
14+
fi;
15+
16+
# Check whether ORACLE_HOME is set
17+
if [ "$ORACLE_HOME" == "" ]; then
18+
echo "ERROR: ORACLE_HOME has not been set!"
19+
echo "You have to have the ORACLE_HOME environment variable set to a valid value!"
20+
exit 1;
21+
fi;
22+
23+
24+
# Replace place holders
25+
# ---------------------
26+
27+
sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$INSTALL_RSP && \
28+
sed -i -e "s|###ORACLE_BASE###|$GSM_BASE|g" $INSTALL_SCRIPTS/$INSTALL_RSP && \
29+
sed -i -e "s|###ORACLE_HOME###|$GSM_HOME|g" $INSTALL_SCRIPTS/$INSTALL_RSP
30+
31+
# Install Oracle binaries
32+
cd $INSTALL_SCRIPTS && \
33+
unzip $INSTALL_FILE_1 && \
34+
rm $INSTALL_FILE_1 && \
35+
$INSTALL_SCRIPTS/gsm/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$INSTALL_RSP -ignorePrereqFailure || true && \
36+
rm -rf gsm && \
37+
cd $HOME

0 commit comments

Comments
 (0)