0% found this document useful (0 votes)
4 views

automated pre-installation process script

This document provides a bash script for automating the prerequisite checks and setup for Oracle Database installation on RHEL, supporting versions 11g, 12c, and 19c. It includes checks for memory, required packages, user and group creation, directory structure, kernel parameters, user limits, SELinux status, and file system architecture. The script logs the results of these checks and summarizes the setup completion for the specified Oracle version.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

automated pre-installation process script

This document provides a bash script for automating the prerequisite checks and setup for Oracle Database installation on RHEL, supporting versions 11g, 12c, and 19c. It includes checks for memory, required packages, user and group creation, directory structure, kernel parameters, user limits, SELinux status, and file system architecture. The script logs the results of these checks and summarizes the setup completion for the specified Oracle version.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ORACLE DATABASE INSTALLATION

Automating Installation Prerequisite Checks

ORACLE DATABASE ADMINISTRATION SERIES

S.N STEPHEN N NJOROGE

LinkedIn: www.linkedln.com/in/stephen-njoroge

DATABSE ADMINISTRATOR- | MSSQL | ORACLE| PostgreSQL | CLOUD- |OCI | AWS |

DATABASE ADMINISTRATION | Installation


Installation Prerequisite Check

#!/bin/bash

# Oracle DB Prerequisite Checker & Setup Script for RHEL


# Supports Oracle 11g, 12c, and 19c

LOGFILE="/tmp/oracle_prereq_report.log"
exec > >(tee -i $LOGFILE)
exec 2>&1

echo "=== Oracle DB Prerequisite Checker and Setup Script ==="


echo "Date: $(date)"
echo "Host: $(hostname)"
echo "--------------------------------------------"

# Input for Oracle Version


read -p "Enter Oracle Database version (11g, 12c, 19c): " ORACLE_VERSION
ORACLE_VERSION=$(echo $ORACLE_VERSION | tr '[:upper:]' '[:lower:]')

# Set paths based on version


case "$ORACLE_VERSION" in
11g)
ORACLE_VERSION_NUM="11.2.0"
;;
12c)
ORACLE_VERSION_NUM="12.2.0"
;;
19c)
ORACLE_VERSION_NUM="19.0.0"
;;
*)
echo "Unsupported version. Only 11g, 12c, or 19c are supported."
exit 1
;;
esac

ORACLE_BASE="/u01/app/oracle"
ORACLE_HOME="$ORACLE_BASE/product/$ORACLE_VERSION_NUM/dbhome_1"

# Check Available Memory


total_mem=$(free -g | awk '/^Mem:/ {print $2}')
echo "Total Memory: ${total_mem} GB"

if [ "$total_mem" -lt 2 ]; then


echo "ERROR: Minimum memory requirement not met (≥ 2 GB)."
else
echo "Memory check passed."
fi

# 2. Check Required Packages


REQUIRED_PACKAGES=(
binutils compat-libcap1 compat-libstdc++-33
glibc glibc-devel ksh libaio libaio-devel libX11 libXau
libXi libXtst libXrender libXrender-devel libgcc libstdc++
libstdc++-devel libxcb make smartmontools sysstat
gcc gcc-c++ elfutils-libelf elfutils-libelf-devel
policycoreutils-python-utils unzip
)

Oracle Database Administration Series


Installation Prerequisite Check

echo "Checking required packages..."


missing_packages=()
for pkg in "${REQUIRED_PACKAGES[@]}"; do
if ! rpm -q $pkg &>/dev/null; then
echo "Missing package: $pkg"
missing_packages+=($pkg)
fi
done

if [ ${#missing_packages[@]} -gt 0 ]; then


echo "Installing missing packages..."
yum install -y "${missing_packages[@]}"
else
echo "All required packages are installed."
fi

# Check/Create Groups and Users


echo "Checking oracle groups and user..."
getent group oinstall &>/dev/null || groupadd oinstall
getent group dba &>/dev/null || groupadd dba
getent passwd oracle &>/dev/null || useradd -g oinstall -G dba oracle

# Create Directory Structure


echo "Checking Oracle directory structure..."
mkdir -p "$ORACLE_HOME"
chown -R oracle:oinstall /u01
chmod -R 775 /u01

# Kernel Parameters
echo "Setting kernel parameters..."
cat <<EOF > /etc/sysctl.d/99-oracle.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 8589934592
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF

sysctl --system

# Shell Limits
echo "Setting user limits..."
cat <<EOF > /etc/security/limits.d/oracle.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF

Oracle Database Administration Series


Installation Prerequisite Check

# Security and SELinux


echo "Checking SELinux..."
sestatus | grep -q "enabled" && echo "SELinux is enabled - set to permissive for Oracle." || echo "SELinux is disabled."

# File System Architecture


echo "Checking mount points and file system types..."
df -hT | grep -E "/u01|/home|/data"

# Compatibility Notes
echo "Checking OS release and kernel version..."
cat /etc/redhat-release
uname -r

# Summary
echo "=== Pre-check and setup completed for Oracle $ORACLE_VERSION ==="
echo "Oracle Base: $ORACLE_BASE"
echo "Oracle Home: $ORACLE_HOME"
echo "See full log at: $LOGFILE"
"""

Oracle Database Administration Series

You might also like