Module 1 _ Oracle 12c Linux Silent Installation
Module 1 _ Oracle 12c Linux Silent Installation
LinkedIn: www.linkedln.com/in/stephen-njoroge
This module focuses on techniques for installing Oracle in an efficient and repeatable manner and which includes silent
installations relying on a response file.
2
2
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
How to install Oracle Database 12c on a Linux system
Pre-Installation Requirements
Check OS Compatibility
cat /etc/os-release
uname -r
3
3
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Create Required Users and Groups
4
4
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Set Kernel Parameters
Apply changes:
sudo sysctl –p
source ~/.bash_profile
Edit /etc/security/limits.conf:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
5
5
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Edit /home/oracle/.bash_profile:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
Apply:
Alternatively, use the script below to check the minimum system requirements for oracle 12c installation. The script will check
and log the result in a oracle12c_prereq_check.log file.
6
6
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Oracle12c_prereq_check.sh
#!/bin/bash
LOG_FILE="oracle12c_prereq_check.log"
exec > >(tee -a "$LOG_FILE") 2>&1
function print_result() {
local message="$1"
local status="$2"
7
7
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
function check_equal() {
[[ "$1" == "$2" ]] && print_result "$3" "PASS" || print_result "$3
(Found: $1, Expected: $2)" "FAIL"
}
# 1. OS and Kernel
echo -e "\n[1] OS and Kernel Version"
os=$(grep ^NAME /etc/os-release | cut -d= -f2)
kernel=$(uname -r)
echo "OS: $os"
echo "Kernel: $kernel"
# 3. Disk Space
echo -e "\n[3] Disk Space (/tmp and /u01)"
df -h /tmp /u01 2>/dev/null || echo -e "${RED}/u01 not found${RESET}"
# 4. Required Packages
echo -e "\n[4] Required Packages"
REQUIRED_PKGS=(
binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-
devel
ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat
unixODBC unixODBC-devel elfutils-libelf elfutils-libelf-devel
)
8
8
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
getent group dba >/dev/null && print_result "Group dba" "PASS" ||
print_result "Group dba" "FAIL"
# 6. Kernel Parameters
echo -e "\n[6] Kernel Parameters"
declare -A sysctl_params=(
[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
)
# 7. Ulimits
echo -e "\n[7] Ulimits (run as oracle)"
if [[ $(whoami) == "oracle" ]]; then
u1=$(ulimit -u)
u2=$(ulimit -n)
u3=$(ulimit -s)
check_equal "$u1" "2047" "Max user processes (nproc)"
check_equal "$u2" "65536" "Open files (nofile)"
check_equal "$u3" "10240" "Stack size (stack)"
else
echo -e "${RED}Run this as 'oracle' user to check ulimits.${RESET}"
fi
# 8. Environment Variables
echo -e "\n[8] Oracle Environment Variables"
if [[ $(whoami) == "oracle" ]]; then
echo "ORACLE_BASE: $ORACLE_BASE"
echo "ORACLE_HOME: $ORACLE_HOME"
echo "ORACLE_SID: $ORACLE_SID"
else
echo -e "${RED}Run as oracle user to verify ORACLE_BASE/HOME/SID${RESET}"
9
9
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
fi
# 9. GUI/X11 (optional)
echo -e "\n[9] GUI/X11"
echo "DISPLAY: $DISPLAY"
command -v xclock &>/dev/null && print_result "xclock installed" "PASS"
|| print_result "xclock installed" "FAIL"
Overviews
Prerequisite
10
10
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Create Required OS Groups & User
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
Update /etc/sysctl.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
Apply changes:
sysctl –p
Edit /etc/security/limits.conf:
Update PAM:
11
11
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Install Required Packages
Edit /home/oracle/.bash_profile:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022
Apply:
source ~/.bash_profile
mkdir -p /home/oracle/install
cd /home/oracle/install
12
12
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
cd /home/oracle/install
mv database /u01/app/oracle/database/response
cd /u01/app/oracle/database/response
cp db_install.rsp db_install_custom.rsp
Edit db_install_custom.rsp:
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
DECLINE_SECURITY_UPDATES=true
13
13
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Run root scripts (as root)
Create a database
cd /home/oracle/install/database/response
cp dbca.rsp dbca_custom.rsp
Edit dbca_custom.rsp:
gdbName=ORCL
sid=ORCL
templateName=General_Purpose.dbc
characterSet=AL32UTF8
sysPassword=YourSysPwd
systemPassword=YourSystemPwd
datafileDestination=/u01/app/oracle/oradata
emConfiguration=NONE
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=2048
14
14
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install
Run DBCA silently:
dbca -silent -responseFile /home/oracle/install/database/response/dbca_custom.rsp
VERIFY INSTALLATION
ps -ef | grep pmon
lsnrctl status
sqlplus / as sysdba
15
15
Module 1: Installing the Oracle Binaries- Oracle 12c Silent Install