Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion OracleDatabase/OracleConnectionManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ podman exec -i -t racnodepc1-cman /bin/bash
/opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS=<HOST-DETAILS>
For example :
/opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS=HOST=racnodep9:IP=10.0.20.178:RULE_SRC=racnodepc2-cman
/opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS=HOST=db1.example.com:RULE_SRC=*:RULE_DST=db1:RULE_SRV=apppdb1:RULE_ACT=accept:RULE_NEXT_HOP=cman-sidb.default.svc.cluster.local:1521
```
### Deleting rules from the Oracle Connection Manager

Expand All @@ -183,7 +184,7 @@ Run this command inside the OracleConnectionManager container.
| DOMAIN | The domain name associated with the container environment. |
| PUBLIC_IP | The public IP address assigned to the Oracle Connection Manager container. |
| PUBLIC_HOSTNAME | The public hostname assigned to the Oracle Connection Manager container. |
| DB_HOSTDETAILS | This is optional field. Details regarding the database host configuration, including host names, rules, and IP addresses to be registered with Connection manager in a command separated format, indicating different hosts and their associated details such as rules and IP addresses. Example: `HOST=racnodepc1-scan:RULE_ACT=accept,HOST=racnodep1:IP=10.0.20.170`. |
| DB_HOSTDETAILS | This is optional field. Details regarding the database host configuration, including host names, rules, IP addresses, and optional next hop to be registered with Connection Manager in a comma separated format. Supported per-host tokens include `HOST`, `IP`, `RULE_SRC`, `RULE_DST`, `RULE_SRV`, `RULE_ACT`, and `RULE_NEXT_HOP` or `NEXT_HOP`. Example: `HOST=racnodepc1-scan:RULE_ACT=accept,HOST=racnodep1:IP=10.0.20.170:RULE_NEXT_HOP=cman-sidb.default.svc.cluster.local:1521`. |
| DNS_SERVER | The default is set to `10.0.20.25`, which is the DNS container resolving the Connection Manager and Oracle Database containers. Replace this with your DNS server IP if needed. |
| USER_CMAN_FILE | (Optional) If you want to provide your own pre-created `cman.ora` file, set this environment variable and attach the file as a Podman volume in the `podman run` command. |

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle Connection Manager
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) linuxx64_12201_client.zip (64-bit)
# Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64
# Download Oracle Connection Manager as part of the Oracle Database Client
# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ docker build -t oracle/cman:12.2.0.1 .
#
# Pull base image
# ---------------
FROM oraclelinux:7-slim

# Maintainer
# ----------
MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com)

# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
# Linux Env Variable
ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \
INSTALL_DIR=/opt/scripts \
# Grid Env variables
INVENTORY=/u01/app/oraInventory \
DB_BASE=/u01/app/oracle \
DB_HOME=/u01/app/oracle/product/12.2.0/client_1 \
INSTALL_FILE_1="linuxx64_12201_client.zip" \
DB_INSTALL_RSP="client.rsp" \
DB_SETUP_FILE="setupDB.sh" \
RUN_FILE="runOracle.sh" \
CONFIG_CMAN_FILE="configCMAN.sh" \
CHECK_SPACE_FILE="checkSpace.sh" \
CMANORA="cman.ora" \
FUNCTIONS="functions.sh" \
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
container="true"
# Use second ENV so that variable get substituted
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \
SCRIPT_DIR=$INSTALL_DIR/startup \
DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \
DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib

# Copy binaries
# -------------
# Grid Binaries
COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/

COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/

RUN chmod 755 $INSTALL_DIR/install/*.sh && \
sync && \
$INSTALL_DIR/install/$CHECK_SPACE_FILE && \
$INSTALL_DIR/install/$SETUP_LINUX_FILE && \
$INSTALL_DIR/install/$DB_SETUP_FILE

# Install DB software binaries
USER oracle
RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE

USER root
RUN $INVENTORY/orainstRoot.sh && \
$DB_HOME/root.sh && \
rm -rf $INSTALL_DIR/install && \
rm -f /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf && \
chown -R oracle:oinstall $SCRIPT_DIR && \
chmod 755 $SCRIPT_DIR/*.sh && \
chmod 666 $SCRIPT_DIR/*.ora && \
sync

USER oracle
WORKDIR /home/oracle
EXPOSE 1521 5500

# Define default command to start Oracle Database.
CMD exec $SCRIPT_DIR/$RUN_FILE
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
#
# Since: January, 2018
# Author: paramdeep.saini@oracle.com
# Description: Configure and setup CMAN
# Description: Configure and setup CMAN
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#

source /tmp/envfile

source $SCRIPT_DIR/functions.sh
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 @@ -81,9 +77,7 @@ 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 @@ -5,7 +5,7 @@
#
# Since: January, 2018
# Author: paramdeep.saini@oracle.com
# Description: Common functions for CMAN
# Description: Common functions for CMAN
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
Expand All @@ -19,7 +19,6 @@ 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 @@ -29,7 +28,6 @@ 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 @@ -46,14 +44,13 @@ resolveip(){
then
return 1
else
# shellcheck disable=SC2155
local ip=$( getent hosts "$host" | awk '{print $1}' )
if [ -z "$ip" ]
if [ -z "$ip" ]
then
ip=$( dig +short "$host" )
if [ -z "$ip" ]
then
print_message "unable to resolve '$host'"
print_message "unable to resolve '$host'"
return 1
else
print_message "$ip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# Since: January, 2018
# Author: paramdeep.saini@oracle.com
# Description: Install Oracle Database Client for CMAN
#
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
#

EDITION=$1

Expand All @@ -20,7 +20,6 @@ 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 @@ -2,18 +2,18 @@
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
#
#
# Since: January, 2018
# Author: paramdeep.saini@oracle.com
# Description: Runs the Oracle Database inside the container
#
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
#


env > /tmp/envfile

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

Expand Down Expand Up @@ -58,7 +58,6 @@ trap _int SIGINT
trap _term SIGTERM

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

############ Removing /tmp/orod.log #####
Expand All @@ -70,7 +69,7 @@ sudo $SCRIPT_DIR/$CONFIG_CMAN_FILE
if [ $? -eq 0 ];then
print_message "cman started sucessfully"
echo $TRUE
else
else
error_exit "Cman startup failed!"
fi

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle Connection Manager
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) LINUX.X64_180000_client.zip
# Oracle Database 18c Client (18.3) for Linux x86-64
# Download Oracle Connection Manager as part of the Oracle Database Client
# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ docker build -t oracle/cman:18.3.0 .
#
# Pull base image
# ---------------
FROM oraclelinux:7-slim

# Maintainer
# ----------
MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com)

# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
# Linux Env Variable
ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \
INSTALL_DIR=/opt/scripts \
# Grid Env variables
INVENTORY=/u01/app/oraInventory \
DB_BASE=/u01/app/oracle \
DB_HOME=/u01/app/oracle/product/18.3.0/client_1 \
INSTALL_FILE_1="LINUX.X64_180000_client.zip" \
DB_INSTALL_RSP="client.rsp" \
DB_SETUP_FILE="setupDB.sh" \
RUN_FILE="runOracle.sh" \
CONFIG_CMAN_FILE="configCMAN.sh" \
CHECK_SPACE_FILE="checkSpace.sh" \
CMANORA="cman.ora" \
FUNCTIONS="functions.sh" \
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
container="true"
# Use second ENV so that variable get substituted
ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \
SCRIPT_DIR=$INSTALL_DIR/startup \
DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \
DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib

# Copy binaries
# -------------
# Grid Binaries
COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/

COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/

RUN chmod 755 $INSTALL_DIR/install/*.sh && \
sync && \
$INSTALL_DIR/install/$CHECK_SPACE_FILE && \
$INSTALL_DIR/install/$SETUP_LINUX_FILE && \
$INSTALL_DIR/install/$DB_SETUP_FILE

# Install DB software binaries
USER oracle
RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE

USER root
RUN $INVENTORY/orainstRoot.sh && \
$DB_HOME/root.sh && \
rm -rf $INSTALL_DIR/install && \
rm -f /etc/security/limits.d/oracle-database-preinstall-18c.conf && \
chown -R oracle:oinstall $SCRIPT_DIR && \
chmod 755 $SCRIPT_DIR/*.sh && \
chmod 666 $SCRIPT_DIR/*.ora && \
sync

USER oracle
WORKDIR /home/oracle
EXPOSE 1521 5500

# Define default command to start Oracle Database.
CMD exec $SCRIPT_DIR/$RUN_FILE
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
#
# Since: January, 2018
# Author: paramdeep.saini@oracle.com
# Description: Configure and setup CMAN
# Description: Configure and setup CMAN
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#

source /tmp/envfile

source $SCRIPT_DIR/functions.sh
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 @@ -81,9 +77,7 @@ 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
Loading
Loading