Skip to content

Cmanchanges #2939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ export TRULESTR=" (rule=
(action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))
)"

export LOCAL_CMCTL_CONN_STR=" (rule=(src=###CMAN_HOSTNAME###.###DOMAIN###)(dst=127.0.0.1)(srv=cmon)(act=accept))"

all_check()
{
if [ -z ${DB_HOSTDETAILS} ]; then
error_exit "DB_HOSTDETAILS not set. Exiting"
print_message "DB_HOSTDETAILS not set. Setting to default"
else
print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}"
get_dbhost_details
fi

get_dbhost_details
check_cman_env_vars
}

Expand Down Expand Up @@ -305,7 +307,11 @@ if [ -f $DB_HOME/network/admin/$CMANORA ]; then
cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA
else
cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA
sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null
if [ ! -z ${DB_HOSTDETAILS} ]; then
sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null
# Add the local CMCTL connection
sh -c "echo $'/(rule_list=\n\Eo${LOCAL_CMCTL_CONN_STR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null
fi
fi

sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA
Expand Down Expand Up @@ -391,6 +397,7 @@ eval $cmd
start_cman ()
{
local cmd
export ORACLE_HOME=$DB_HOME
cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN"
eval $cmd
}
Expand All @@ -399,13 +406,15 @@ stop_cman ()
{
local cmd
cmaninst=$1
export ORACLE_HOME=$DB_HOME
cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst"
eval $cmd
}

status_cman ()
{
local cmd
export ORACLE_HOME=$DB_HOME
cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN"
eval $cmd

Expand Down Expand Up @@ -502,4 +511,4 @@ print_message "Checking CMAN Status"
status_cman
print_message "################################################"
print_message " CONNECTION MANAGER IS READY TO USE! "
print_message "################################################"
print_message "################################################"
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#


#env > /tmp/envfile
env > /tmp/envfile

#chmod 755 /tmp/envfile
#source /tmp/envfile
chmod 755 /tmp/envfile
source /tmp/envfile
source $SCRIPT_DIR/functions.sh

########### SIGINT handler ############
Expand Down Expand Up @@ -75,4 +75,4 @@ fi

tail -f /tmp/orod.log &
childPID=$!
wait $childPID
wait $childPID
4 changes: 2 additions & 2 deletions OracleDatabase/RAC/OracleRealApplicationClusters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ podman tag localhost/oracle/database-rac:21.3.0-slim localhost/oracle/database-r
### Building Oracle RAC Database Container Base Image
In this document, an `Oracle RAC Database Container Base Image` refers to a container image that does not include installation of Oracle Grid Infrastructure and Oracle Database Software Binaries during the Oracle RAC Database Container Image creation. This image is extended to build patched image or extensions. To build an Oracle RAC Database Container Base Image run the following command:
```bash
./buildContainerImage.sh -v <Software Version> -i -b
./buildContainerImage.sh -v <Software Version> -b
```
Example: To build Oracle RAC Database Container Base Image for version 21.3.0, use the below command:
```bash
./buildContainerImage.sh -v 21.3.0 -i -b
./buildContainerImage.sh -v 21.3.0 -b
```
To build an Oracle RAC Database Container Base Image, you need to use `-b`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
usage() {
cat << EOF

Usage: buildContainerImage.sh -v [version] -t [image_name:tag] [-o] [-i]
Usage: buildContainerImage.sh -v [version] -t [image_name:tag] [-b] [-o] [-i]
It builds a container image for a DNS server

Parameters:
-v: version to build
-i: ignores the MD5 checksums
-t: user defined image name and tag (e.g., image_name:tag)
-o: passes on container build option (e.g., --build-arg SLIMMIMG=true for slim)
-b: build base stage only (Used by extensions)

LICENSE UPL 1.0

Expand Down Expand Up @@ -55,14 +56,15 @@ if [ "$#" -eq 0 ]; then
fi

# Parameters
VERSION="12.2.0.1"
VERSION="21.3.0"
SKIPMD5=0
BASE_ONLY=0
DOCKEROPS=""
IMAGE_NAME=""
SLIM="false"
DOCKEROPS=" --build-arg SLIMMING=false"

while getopts "hiv:o:t:" optname; do
while getopts "hibv:o:t:" optname; do
case "$optname" in
"h")
usage
Expand All @@ -73,6 +75,10 @@ while getopts "hiv:o:t:" optname; do
"v")
VERSION="$OPTARG"
;;
"b")
BASE_ONLY=1
SKIPMD5=1
;;
"o")
DOCKEROPS="$OPTARG"
if [[ "$DOCKEROPS" != *"--build-arg SLIMMING="* ]]; then
Expand All @@ -97,20 +103,23 @@ while getopts "hiv:o:t:" optname; do
done

# Oracle Database Image Name
if [ "${IMAGE_NAME}"x = "x" ] && [ "${SLIM}" == "true" ]; then
IMAGE_NAME="oracle/database-rac:${VERSION}-slim"
if [ "${BASE_ONLY}" -eq 1 ]; then
IMAGE_NAME="oracle/database-rac:${VERSION}-base"
DOCKEROPS=" --build-arg SLIMMING=true"
elif [ "${IMAGE_NAME}"x = "x" ] && [ "${SLIM}" == "true" ]; then
IMAGE_NAME="oracle/database-rac:${VERSION}-slim"
elif [ "${IMAGE_NAME}"x = "x" ] && [ "${SLIM}" == "false" ]; then
IMAGE_NAME="oracle/database-rac:${VERSION}"
IMAGE_NAME="oracle/database-rac:${VERSION}"
else
echo "Image name is passed as an variable"
echo "Image name is passed as a variable"
fi

echo "Container Image set to : ${IMAGE_NAME}"
echo "Container Image set to : ${IMAGE_NAME}"

# Go into version folder
#cd "$VERSION" || exit

if [ ! "$SKIPMD5" -eq 1 ]; then
if [ ${BASE_ONLY} -eq 0 ] && [ ! "${SKIPMD5}" -eq 1 ]; then
checksumPackages
else
echo "Ignored MD5 checksum."
Expand Down Expand Up @@ -143,6 +152,25 @@ if [ "$PROXY_SETTINGS" != "" ]; then
echo "Proxy settings were found and will be used during the build."
fi

# ############################# #
# BUILDING THE BASE STAGE IMAGE #
# ############################# #

if [ ${BASE_ONLY} -eq 1 ]; then
echo "Building base stage image '${IMAGE_NAME}' ..."
# BUILD THE BASE STAGE IMAGE (replace all environment variables)
docker build --force-rm=true \
--no-cache=true ${DOCKEROPS} ${PROXY_SETTINGS} --build-arg VERSION="${VERSION}" --target base \
-t "${IMAGE_NAME}" -f "${VERSION}"/Containerfile . || {
echo ""
echo "ERROR: Base stage image was NOT successfully created."
exit 1
}
# Remove dangling images (intermitten images with tag <none>)
yes | docker image prune > /dev/null || true
exit
fi

# ################## #
# BUILDING THE IMAGE #
# ################## #
Expand All @@ -151,7 +179,7 @@ echo "Building image '$IMAGE_NAME' ..."
# BUILD THE IMAGE (replace all environment variables)
BUILD_START=$(date '+%s')
# shellcheck disable=SC2086
docker build --force-rm=true --no-cache=true ${DOCKEROPS} ${PROXY_SETTINGS} --build-arg VERSION="${VERSION}" -t ${IMAGE_NAME} -f "${VERSION}"/Containerfile . || {
docker build --force-rm=true --no-cache=true ${DOCKEROPS} ${PROXY_SETTINGS} --build-arg VERSION="${VERSION}" --target final -t ${IMAGE_NAME} -f "${VERSION}"/Containerfile . || {
echo "There was an error building the image."
exit 1
}
Expand All @@ -173,4 +201,4 @@ EOF

else
echo "Oracle Database Real Application Clusters Container Image was NOT successfully created. Check the output and correct any reported problems with the container build operation."
fi
fi