Skip to content

Commit

Permalink
upload latest 23.5.0 for cman (#2858)
Browse files Browse the repository at this point in the history
* upload latest 23.5.0 for cman

* fix lint iissues

* fix lint iissues
  • Loading branch information
saurabhuja committed Aug 30, 2024
1 parent 4fafdfa commit 44c5a35
Show file tree
Hide file tree
Showing 61 changed files with 1,289 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ Sample container build files to facilitate installation, configuration, and envi

## How to build and run
This project offers sample container images for:
* Oracle Database 23ai Client (23.5) for Linux x86-64
* Oracle Database 21c Client (21.3) for Linux x86-64
* Oracle Database 19c Client (19.3) for Linux x86-64
* Oracle Database 18c Client (18.3) for Linux x86-64
* Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64

To assist in building the container images, you can use the [buildContainerImage.sh](dockerfiles/buildContainerImage.sh) script. See section **Create Oracle Connection Manager Image** for instructions and usage.
To assist in building the container images, you can use the [buildContainerImage.sh](containerfiles/buildContainerImage.sh) script. See section **Create Oracle Connection Manager Image** for instructions and usage.

**IMPORTANT:** Oracle Connection Manager binds to a single port on your host and proxies incoming connections to multiple running containers. It can also proxy connections for users to Oracle RAC Databases running on internal container networks.

Expand All @@ -20,15 +21,32 @@ dnf install podman-docker -y
For complete Oracle Connection Manager setup, please go though following steps and execute them as per your enviornment:

### Create Oracle Connection Manager Image
**IMPORTANT:** You will have to provide the installation binaries of Oracle ADMIN Client Oracle Database 21c Client (21.3) for Linux x86-64 and put them into the `dockerfiles/<version>` folder. You only need to provide the binaries for the edition you are going to install.
**IMPORTANT:** You will have to provide the installation binaries of Oracle ADMIN Client Oracle Database 23ai Client (23.5) for Linux x86-64 and put them into the `containerfiles/<version>` folder. You only need to provide the binaries for the edition you are going to install.

The binaries can be downloaded from the [Oracle Technology Network](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html).

You also have to make sure to have internet connectivity for yum. Note that you must not uncompress the binaries.

The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters.

Before you build the image make sure that you have provided the installation binaries and put them into the right folder. Go into the **dockerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:
Before you build the image make sure that you have provided the installation binaries and put them into the right folder.

#### Create Oracle Connection Manager Image in Podman Hosts
Go into the **containerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:

```bash
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleConnectionManager/containerfiles
./buildContainerImage.sh -v (Software Version)
./buildContainerImage.sh -v 23.5.0
```
For detailed usage of command, please execute following command:
```bash
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleConnectionManager/containerfiles
./buildContainerImage.sh -h
```

#### Create Oracle Connection Manager Image in Docker Hosts
Go into the **dockerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:

```bash
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleConnectionManager/dockerfiles
Expand Down Expand Up @@ -65,15 +83,26 @@ docker run -d --hostname racnodedc1-cman --dns-search=example.com \
Execute following command as root user to create connection manager container on `Podman Host`-

```bash
docker run -d --hostname racnodepc1-cman --dns-search=example.com \
--network=rac_pub1_nw --ip=172.16.1.166 \
-e DOMAIN=example.com -e PUBLIC_IP=172.16.1.166 \
-e PUBLIC_HOSTNAME=racnodepc1-cman -e SCAN_NAME=racnodepc1-scan \
-e SCAN_IP=172.16.1.236 --privileged=false \
-p 1521:1521 --name racnodepc1-cman oracle/client-cman:21.3.0
podman run -d \
--hostname racnodepc1-cman \
--dns-search=example.com \
--dns 172.16.1.25 \
--network=rac_pub1_nw \
--ip=172.16.1.164 \
--cap-add=AUDIT_WRITE \
--cap-add=NET_RAW \
-e DOMAIN=example.com \
-e PUBLIC_IP=172.16.1.164 \
-e DNS_SERVER=172.16.1.25 \
-e PUBLIC_HOSTNAME=racnodepc1-cman \
-e DB_HOSTDETAILS="HOST=racnodepc1-scan:RULE_ACT=accept,HOST=racnodep1:IP=172.16.1.170" \
--privileged=false \
-p 1521:1521 \
--name racnodepc1-cman \
oracle/client-cman:23.5.0
```

In the above container, you can see that we are passing env variables using "-e". You need to change PUBLIC_IP, PUBLIC_HOSTNAME, SCAN_NAME, SCAN_IP according to your environment. Also, container will be binding to port 1521 on your docker host.
In the above container, you can see that we are passing env variables using "-e". You need to change `PUBLIC_IP`, `PUBLIC_HOSTNAME`, `SCAN_NAME`, `SCAN_IP`, `DB_HOSTDETAILS` according to your environment. Also, container will be binding to port 1521 on your docker host.

**Note:** SCAN_NAME and SCAN_IP will be your Oracle RAC SCAN details. These will be registered in connection manager but will be accessible when you create Oracle RAC container.

Expand All @@ -86,7 +115,7 @@ docker logs racnodedc1-cman

Check logs in `Podman Host` -
```bash
docker logs racnodepc1-cman
podman logs racnodepc1-cman
```

You should see following when cman container setup is done:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ FROM oraclelinux:7-slim

# Maintainer
# ----------
# hadolint ignore=DL4000
MAINTAINER Sanjay Singh ([email protected]), Paramdeep Saini ([email protected])

# Environment variables required for this build (do NOT change)
Expand All @@ -47,6 +48,7 @@ ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
container="true"
# Use second ENV so that variable get substituted
# hadolint ignore=DL3044
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \
SCRIPT_DIR=$INSTALL_DIR/startup \
Expand Down Expand Up @@ -85,4 +87,5 @@ WORKDIR /home/oracle
EXPOSE 1521 5500

# Define default command to start Oracle Database.
# hadolint ignore=DL3025
CMD exec $SCRIPT_DIR/$RUN_FILE
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ source /tmp/envfile
source $SCRIPT_DIR/functions.sh

####################### Constants #################
# shellcheck disable=SC2034
declare -r FALSE=1
# shellcheck disable=SC2034
declare -r TRUE=0
# shellcheck disable=SC2034
declare -r ETCHOSTS="/etc/hosts"
# shellcheck disable=SC2034
progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -77,7 +81,9 @@ fi

SetupEtcHosts()
{
# shellcheck disable=SC2034
local stat=3
# shellcheck disable=SC2034
local HOST_LINE

echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2"

###### Function Related to printing messages and exit the script if error occurred ##################
error_exit() {
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display error message and exit
# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
Expand All @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z")

print_message ()
{
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display message and return
echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE
Expand All @@ -44,6 +46,7 @@ resolveip(){
then
return 1
else
# shellcheck disable=SC2155
local ip=$( getent hosts "$host" | awk '{print $1}' )
if [ -z "$ip" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then
fi;

# Check whether correct edition has been passed on
# shellcheck disable=SC2166
if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then
echo "ERROR: Wrong edition has been passed on!"
echo "Edition $EDITION is no a valid edition!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ trap _int SIGINT
trap _term SIGTERM

# Set SIGKILL handler
# shellcheck disable=SC2173
trap _kill SIGKILL

############ Removing /tmp/orod.log #####
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ FROM oraclelinux:7-slim

# Maintainer
# ----------
# hadolint ignore=DL4000
MAINTAINER Sanjay Singh ([email protected]), Paramdeep Saini ([email protected])

# Environment variables required for this build (do NOT change)
Expand All @@ -47,6 +48,7 @@ ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
container="true"
# Use second ENV so that variable get substituted
# hadolint ignore=DL3044
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \
SCRIPT_DIR=$INSTALL_DIR/startup \
Expand Down Expand Up @@ -85,4 +87,5 @@ WORKDIR /home/oracle
EXPOSE 1521 5500

# Define default command to start Oracle Database.
# hadolint ignore=DL3025
CMD exec $SCRIPT_DIR/$RUN_FILE
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ source /tmp/envfile
source $SCRIPT_DIR/functions.sh

####################### Constants #################
# shellcheck disable=SC2034
declare -r FALSE=1
# shellcheck disable=SC2034
declare -r TRUE=0
# shellcheck disable=SC2034
declare -r ETCHOSTS="/etc/hosts"
# shellcheck disable=SC2034
progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -77,7 +81,9 @@ fi

SetupEtcHosts()
{
# shellcheck disable=SC2034
local stat=3
# shellcheck disable=SC2034
local HOST_LINE

echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2"

###### Function Related to printing messages and exit the script if error occurred ##################
error_exit() {
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display error message and exit
# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
Expand All @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z")

print_message ()
{
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display message and return
echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE
Expand All @@ -44,6 +46,7 @@ resolveip(){
then
return 1
else
# shellcheck disable=SC2155
local ip=$( getent hosts "$host" | awk '{print $1}' )
if [ -z "$ip" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then
fi;

# Check whether correct edition has been passed on
# shellcheck disable=SC2166
if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then
echo "ERROR: Wrong edition has been passed on!"
echo "Edition $EDITION is no a valid edition!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ trap _int SIGINT
trap _term SIGTERM

# Set SIGKILL handler
# shellcheck disable=SC2173
trap _kill SIGKILL

############ Removing /tmp/orod.log #####
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ source /tmp/envfile
source $SCRIPT_DIR/functions.sh

####################### Constants #################
# shellcheck disable=SC2034
declare -r FALSE=1
# shellcheck disable=SC2034
declare -r TRUE=0
# shellcheck disable=SC2034
declare -r ETCHOSTS="/etc/hosts"
# shellcheck disable=SC2034
progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -77,7 +81,9 @@ fi

SetupEtcHosts()
{
# shellcheck disable=SC2034
local stat=3
# shellcheck disable=SC2034
local HOST_LINE

echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2"

###### Function Related to printing messages and exit the script if error occurred ##################
error_exit() {
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display error message and exit
# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
Expand All @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z")

print_message ()
{
# shellcheck disable=SC2155
local NOW=$(date +"%m-%d-%Y %T %Z")
# Display message and return
echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE
Expand All @@ -44,6 +46,7 @@ resolveip(){
then
return 1
else
# shellcheck disable=SC2155
local ip=$( getent hosts "$host" | awk '{print $1}' )
if [ -z "$ip" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then
fi;

# Check whether correct edition has been passed on
# shellcheck disable=SC2166
if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then
echo "ERROR: Wrong edition has been passed on!"
echo "Edition $EDITION is no a valid edition!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ trap _int SIGINT
trap _term SIGTERM

# Set SIGKILL handler
# shellcheck disable=SC2173
trap _kill SIGKILL

############ Removing /tmp/orod.log #####
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 11 additions & 4 deletions ...nManager/dockerfiles/21.3.0/configCMAN.sh → ...nager/containerfiles/21.3.0/configCMAN.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ source /tmp/envfile
source $SCRIPT_DIR/functions.sh

####################### Constants #################
# shellcheck disable=SC2034
declare -r FALSE=1
# shellcheck disable=SC2034
declare -r TRUE=0
# shellcheck disable=SC2034
declare -r ETCHOSTS="/etc/hosts"
# shellcheck disable=SC2034
progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -118,13 +122,14 @@ fi
if [ -z "${REGISTRATION_INVITED_NODES}" ]; then
REGISTRATION_INVITED_NODES='*'
else
# shellcheck disable=SC2034
REGINVITEDNODESET=1
fi

# shellcheck disable=SC2166
if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then
print_message "Invalid trace-level [${TRACE_LEVEL}] specified."
fi

# shellcheck disable=SC2166
if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then
print_message "Invalid log-level [${LOG_LEVEL}] specified."
fi
Expand Down Expand Up @@ -155,7 +160,7 @@ if [ $RULESRVSET -eq 1 ]; then
print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. "
fi
fi

# shellcheck disable=SC2166
if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then
print_message "Invalid rule-action [${RULE_ACT}] specified."
fi
Expand All @@ -166,7 +171,9 @@ fi

SetupEtcHosts()
{
local stat=3
# shellcheck disable=SC2034
stat=3
# shellcheck disable=SC2034
local HOST_LINE

echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts
Expand Down
Loading

0 comments on commit 44c5a35

Please sign in to comment.