Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions OracleDatabase/OracleConnectionManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This guide provides information about example container build files that you can

## How to build and run Oracle Connection Manager in Containers
This project offers example container images for the following:
* Oracle Database 23ai Client (23.5) for Linux x86-64
* Oracle Database 23.26ai Client (26ai) 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
Expand All @@ -36,22 +36,22 @@ You can also deploy Oracle Connection Manager on Podman using the pre-built imag

Example of pulling an Oracle Connection Manager Image from the Oracle Container Registry:
```bash
podman pull container-registry.oracle.com/database/cman:23.7.0.0
podman tag container-registry.oracle.com/database/cman:23.7.0.0 localhost/oracle/client-cman:latest
podman pull container-registry.oracle.com/database/cman:latest
podman tag container-registry.oracle.com/database/cman:latest localhost/oracle/client-cman:latest
```

If you are using pre-built Oracle Connection Manager from [the Oracle Container Registry](https://container-registry.oracle.com), then you can skip the section [Create Oracle Connection Manager Image](#create-oracle-connection-manager-image) to build the Oracle Connection Manager Image.

### Create Oracle Connection Manager Image
**IMPORTANT:** You must provide the installation binaries of the Oracle ADMIN Client Oracle Database 23ai Client for Linux x86-64 (client_cman_home.zip) and put them into the `containerfiles/<version>` folder. You only need to provide the binaries for the edition that 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).
**IMPORTANT:** You must provide the installation binaries of the Oracle ADMIN Client Oracle Database 23.26ai Client for Linux x86-64 (client_cman_home.zip) and put them into the `containerfiles/<version>` folder. You only need to provide the binaries for the edition that 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 ensure you have internet connectivity for yum. You must not uncompress the binaries.

The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks. It provides an easy way for beginners to get started. Expert users are welcome to directly call `podman build` with their prefered set of parameters.
Before you build the image, ensure that you have provided the installation binaries and put them into the right folder. Go into the **containerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:

```bash
./buildContainerImage.sh -v (Software Version)
./buildContainerImage.sh -v 23.5.0
./buildContainerImage.sh -v 26.0.0
```
For detailed usage of command, please execute following command:
```bash
Expand All @@ -69,7 +69,7 @@ Note:

Once image is built, retag it to latest as we are going to refer latest image in podman run command-
```bash
podman tag localhost/oracle/client-cman:23.5.0 localhost/oracle/client-cman:latest
podman tag localhost/oracle/client-cman:26.0.0 localhost/oracle/client-cman:latest
```

## Create Network Bridge
Expand Down Expand Up @@ -138,7 +138,7 @@ If you want to provide your own pre-created `cman.ora` file, you can provide wit
--privileged=false \
-p 1521:1521 \
--name racnodepc1-cman \
oracle/client-cman:23.5.0
oracle/client-cman:latest
```

To check the Cman container/services creation logs, you can run a tail command on the podman logs. It should take two minutes to create the Cman container service.
Expand Down Expand Up @@ -189,10 +189,10 @@ Run this command inside the OracleConnectionManager container.

## License

To download and run the Oracle ADMIN Client Oracle Database 23ai Client, regardless of whether inside or outside a container, you must download the binaries from the Oracle website and accept the license indicated on that page.
To download and run the Oracle ADMIN Client Oracle Database 23.26ai Client, regardless of whether inside or outside a container, you must download the binaries from the Oracle website and accept the license indicated on that page.

All scripts and files hosted in this repository which are required to build the container images are, unless otherwise noted, released under UPL 1.0 license.

## Copyright

Copyright (c) 2014-2025 Oracle and/or its affiliates.
Copyright (c) 2014-2025 Oracle and/or its affiliates.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
# LICENSE UPL 1.0
#
#############################
# Copyright (c) 2024, Oracle and/or its affiliates.
Expand All @@ -13,21 +12,14 @@
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
declare -A dbhost_map
# shellcheck disable=SC2034
declare -A rule_map
# shellcheck disable=SC2034
declare hostip
# shellcheck disable=SC2034
declare action=""
# shellcheck disable=SC2034

progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -86,15 +78,17 @@ if [ -z "${PORT}" ]; then
fi

if [ -z "${PUBLIC_IP}" ]; then
error_exit "Container hostname is not set or set to the empty string"
PUBLIC_IP=$(nslookup `hostname -f` | tail -n -2 | sed -e '/^$/d' | sed -e 's/Address: \(.*\)/\1/')
print_message "Container hostip is not set. Setting to [$PUBLIC_IP]"
else
print_message "Public IP is set to ${PUBLIC_IP}"
fi

if [ -z "${PUBLIC_HOSTNAME}" ]; then
error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string"
PUBLIC_HOSTNAME=`hostname`
print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}"
else
print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}"
print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}"
fi

if [ -z "${LOG_LEVEL}" ]; then
Expand All @@ -104,19 +98,18 @@ fi
if [ -z "${TRACE_LEVEL}" ]; then
TRACE_LEVEL=user
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

if [ -z "${REGISTRATION_INVITED_NODES}" ]; then
REGISTRATION_INVITED_NODES='*'
else
# shellcheck disable=SC2034
REGINVITEDNODESET=1
fi

Expand Down Expand Up @@ -173,7 +166,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 @@ -192,7 +185,6 @@ do
for rule_env_var in "${rule_env_vars[@]}"
do
echo "export ${rule_env_var}"
# shellcheck disable=SC2163
export ${rule_env_var}
done

Expand All @@ -204,7 +196,6 @@ do

dbhost_map[${HOST}]=${IP}
rule_map[${HOST}]=${db_hostvalue}
# shellcheck disable=SC2178
rule_env_vars=""
done

Expand Down Expand Up @@ -280,9 +271,7 @@ fi

SetupEtcHosts()
{
# shellcheck disable=SC2034
local stat=3
# shellcheck disable=SC2034
local HOST_LINE
if [ "$action" == "" ]; then
if [ ! -z "${HOSTFILE}" ]; then
Expand Down Expand Up @@ -330,7 +319,6 @@ do
for rule_env_var in "${rule_env_vars[@]}"
do
echo "export ${rule_env_var}"
# shellcheck disable=SC2163
export ${rule_env_var}
done

Expand Down Expand Up @@ -462,20 +450,13 @@ while [ $# -gt 0 ]; do
shift
done

####### Populating resolv.conf and /etc/hosts ###
setupEtcResolvConf
SetupEtcHosts
####################


if [ "$action" == "delete" ]; then
del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'`
IFS=':' read -a del_rule_vars <<< "${del_rule_details}"
unsetrulevars
for del_rule_var in "${del_rule_vars[@]}"
do
echo "export ${del_rule_var}"
# shellcheck disable=SC2163
export ${del_rule_var}
done

Expand All @@ -499,6 +480,9 @@ else
cman_file
fi

setupEtcResolvConf
SetupEtcHosts

print_message "Copying CMAN file to $DB_HOME/network/admin"
copycmanora
print_message "Starting CMAN"
Expand All @@ -509,4 +493,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
@@ -1,5 +1,4 @@
#!/bin/bash
# LICENSE UPL 1.0
#
#############################
# Copyright (c) 2024, Oracle and/or its affiliates.
Expand All @@ -13,21 +12,14 @@
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
declare -A dbhost_map
# shellcheck disable=SC2034
declare -A rule_map
# shellcheck disable=SC2034
declare hostip
# shellcheck disable=SC2034
declare action=""
# shellcheck disable=SC2034

progname="$(basename $0)"
###################### Constants ####################

Expand Down Expand Up @@ -86,15 +78,17 @@ if [ -z "${PORT}" ]; then
fi

if [ -z "${PUBLIC_IP}" ]; then
error_exit "Container hostname is not set or set to the empty string"
PUBLIC_IP=$(nslookup `hostname -f` | tail -n -2 | sed -e '/^$/d' | sed -e 's/Address: \(.*\)/\1/')
print_message "Container hostip is not set. Setting to [$PUBLIC_IP]"
else
print_message "Public IP is set to ${PUBLIC_IP}"
fi

if [ -z "${PUBLIC_HOSTNAME}" ]; then
error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string"
PUBLIC_HOSTNAME=`hostname`
print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}"
else
print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}"
print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}"
fi

if [ -z "${LOG_LEVEL}" ]; then
Expand All @@ -104,19 +98,18 @@ fi
if [ -z "${TRACE_LEVEL}" ]; then
TRACE_LEVEL=user
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

if [ -z "${REGISTRATION_INVITED_NODES}" ]; then
REGISTRATION_INVITED_NODES='*'
else
# shellcheck disable=SC2034
REGINVITEDNODESET=1
fi

Expand Down Expand Up @@ -173,7 +166,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 @@ -192,7 +185,6 @@ do
for rule_env_var in "${rule_env_vars[@]}"
do
echo "export ${rule_env_var}"
# shellcheck disable=SC2163
export ${rule_env_var}
done

Expand All @@ -204,7 +196,6 @@ do

dbhost_map[${HOST}]=${IP}
rule_map[${HOST}]=${db_hostvalue}
# shellcheck disable=SC2178
rule_env_vars=""
done

Expand Down Expand Up @@ -280,9 +271,7 @@ fi

SetupEtcHosts()
{
# shellcheck disable=SC2034
local stat=3
# shellcheck disable=SC2034
local HOST_LINE
if [ "$action" == "" ]; then
if [ ! -z "${HOSTFILE}" ]; then
Expand Down Expand Up @@ -330,7 +319,6 @@ do
for rule_env_var in "${rule_env_vars[@]}"
do
echo "export ${rule_env_var}"
# shellcheck disable=SC2163
export ${rule_env_var}
done

Expand Down Expand Up @@ -462,20 +450,13 @@ while [ $# -gt 0 ]; do
shift
done

####### Populating resolv.conf and /etc/hosts ###
setupEtcResolvConf
SetupEtcHosts
####################


if [ "$action" == "delete" ]; then
del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'`
IFS=':' read -a del_rule_vars <<< "${del_rule_details}"
unsetrulevars
for del_rule_var in "${del_rule_vars[@]}"
do
echo "export ${del_rule_var}"
# shellcheck disable=SC2163
export ${del_rule_var}
done

Expand All @@ -499,6 +480,9 @@ else
cman_file
fi

setupEtcResolvConf
SetupEtcHosts

print_message "Copying CMAN file to $DB_HOME/network/admin"
copycmanora
print_message "Starting CMAN"
Expand All @@ -509,4 +493,4 @@ print_message "Checking CMAN Status"
status_cman
print_message "################################################"
print_message " CONNECTION MANAGER IS READY TO USE! "
print_message "################################################"
print_message "################################################"
Loading