Recently, many employees who have installed Oracle 10g RAC on the RHEL 5.X platform do not have much difficulty, but repetitive manual work is still relatively high. Therefore, a semi-automatic installation script is compiled by the way.
Install operating system patches, create database users, and modify user configuration files.
Issues to be resolved:
1. The host name is automatically configured, which requires a separate configuration file. In addition, there are not many configurations related to the host name during the configuration process;
2. Shared disk multi-path configuration. Because the raw devices and UDEV are used in different ways, some of the invisible results are stored in/dev/mapper and some in/dev/sd *, the disk size and sequence are inconsistent, so no processing is performed;
3. The shell is not familiar with the checksum control;
4. ssh authentication configuration, using the automatic configuration script in 11g rac;
The details are as follows: RAC_AUTO_CONFIG_10G.sh
#! /Bin/bash
######################################## ######################################## ###
# This document deploy 10g rac for Red Hat Enterprise Linux Server release 5.X extremely compatible kernels
#0. Check Environment Information
#1. Disable redundant services to improve operating system performance and security
#2. Configure the remote graphical interface (Xmanager or VNC)
#3. Configure the local YUM source and install the OS patch
#4. Modify operating system kernel parameters
#5. Configure shared storage
#6. Create an oracle user and installation directory
#7. Restart the operating system for modification Verification
#8. Execute CRS installation
#9. Install the CRS 10.2.0.5 patch
#10. Execute Database Installation
#11. Install the database 10.2.0.5 patch
#12. Install the PSU patch
#13. manual database creation
#14. Parameter Adjustment
######################################## ######################################## ###
######################################## ######################################## ###
#0. Check Environment Information
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "0. Check environment information"
Echo
Echo "memory info"
Grep MemTotal/proc/meminfo
Echo
Echo
Echo "swap info"
Grep SwapTotal/proc/meminfo
Echo
Echo
Echo "tmp info"
Df-h/tmp
Echo
Echo
Echo "disk info"
Df-h
Echo
Echo
Echo "cpu info"
Grep "model name"/proc/cpuinfo
Echo
Echo
Echo "kernel info"
Uname-
Echo
Echo
Echo "release info"
More/etc/RedHat-release
RELEASE = 'more/etc/redhat-release | awk '{print $1 }''
Echo "###################################### ######################################## #####"
Echo
Echo
Echo
######################################## ######################################## ###
#1. Disable redundant services to improve operating system performance and security
# Custom based on environment and needs
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "1. Disable redundant services to improve operating system performance and security"
Echo
Chkconfig -- level 345 bluetooth off
Chkconfig -- level 345 cups off
Chkconfig -- level 345 ip6tables off
Chkconfig -- level 345 iptables off
Chkconfig -- level 345 sendmail off
Echo
Echo
Echo "turn off selinux"
SELINUX = 'grep ^ SELINUX =/etc/selinux/config'
If [$ SELINUX! = "SELINUX = disabled"]; then
Cp/etc/selinux/config. bak
Sed-I's/^ SELINUX =/# SELINUX =/G'/etc/selinux/config
Sed-I '$ a SELINUX = disabled'/etc/selinux/config
Else
Echo "SELINUX is already disabled"
Fi
Echo
Echo "###################################### ######################################## #####"
Echo
Echo
Echo
######################################## ######################################## ###
#2. Configure the remote graphical interface (Xmanager or VNC)
# Manual configuration is required based on different environments. We recommend that you use Xmanager-Passive or VNC.
######################################## ######################################## ###
##| 2.1 Log On Through xshell
# | Open the Xmanager-Passive tool and use Xshell to connect to the remote server
##
##|# Export DISPLAY = Client IP: 0.0
##|# Xclock
######################################## ######################################## ###
#3. Configure the local YUM source and install the OS patch
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "3. Configure the local YUM source and install the OS patch package"
Echo
Mkdir-p/media/cdrom
Mount/dev/cdrom/media/cdrom
Cd/etc/yum. repos. d/
Mkdir bak
Mv *. repo./bak/
Touch local. repo
# Note that the YUM configuration methods of RHEL and CentOS are different and adjusted based on the operating system.
# -- RHEL
# [RHEL]
# Name = RHEL
# Baseurl = file: // media/cdrom/Server/
# Gpgcheck = 0
# Enabled = 1
#
# -- CENTOS
# [CENTOS]
# Name = CENTOS
# Baseurl = file: // media/cdrom/
# Gpgcheck = 0
# Enabled = 1
Cat> local. repo <"EOF"
[LOCAL]
Name = LOCAL
Gpgcheck = 0
Enabled = 1
EOF
Echo
If [$ RELEASE = "CentOS"]; then
Sed-I '$ a baseurl = file: \ // \/media \/cdrom \/'local. repo
Else
Sed-I '$ a baseurl = file: \ // \/media \/cdrom \/Server \/'local. repo
Fi
Echo
Echo "install package"
Yum install-y binutils compat-db compat-gcc-34 compat-gcc-34-c ++ compat-libstdc ++-296 compat-libstdc ++-33 control-center elfutils-libelf-devel gcc-c ++ gdb gdbm glibc-common glibc-devel glibc-headers libgomp libstdc ++-devel ksh unzip kernel-devel libgcc libgnome libstdc ++-devlibel XP unzip make openmotif setarch sysstat unixODBC unixODBC-devel util-linux xorg-x11-xinit
Yum install-y compat-gcc-34 compat-gcc-34-c ++ compat-libstdc ++-33 compat-libstdc ++-296 gcc-c ++ glibc-devel glibc-headers glibc libgomp libaio. i386 libgcc. i386 libstdc ++-devel libXp libXtst openssl sysstat
Echo "finish package install"
Echo
Echo
Echo "check package info"
Rpm-q -- qf' % {NAME}-% {VERSION}-% {RELEASE} (% {ARCH }) \ n' binutils compat-db compat-gcc-34 compat-gcc-34-c + + compat-libstdc ++-33 compat-libstdc ++-296 compat-libstdc ++-33 control-center elfutils-libelf-devel gcc-c ++ gdb gdbm glibc-common glibc-devel glibc-headers libgomp libstdc ++-devel ksh libaio-devel libgcc libgnome libgnomeui libgomp libstdc ++- devel libXp libXtst make openmotif setarch sysstat unixODBC-devel util-linux xorg-x11-xinit | grep "not installed"
Echo
Echo "###################################### ######################################## #####"
Echo
Echo
Echo
######################################## ######################################## ###
#4. Modify operating system kernel parameters
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "4. Modifying operating system kernel parameters"
Echo
Cp/etc/sysctl. conf/etc/sysctl. conf. bak
Cat>/etc/sysctl. conf <"EOF"
######################################## ######################################## ###
# Change for oracle install
Fs. file-max = 6815744
Fs. aio-max-nr = 3145728
Kernel. msgmni= 2878
Kernel. msgmax = 8192
Kernel. msgmnb = 65536
Kernel. sem = 250 32000 100 142
Kernel. shmmax = 34359738368
Kernel. shmmni = 4096
Kernel. shmall = 16777216
# Vm. nr_hugepages = 16384
# Kernel. sysrq = 1
Net. core. rmem_default = 1048576
Net. core. wmem_default = 262144
Net. core. rmem_max = 4194304
Net. core. wmem_max = 1048576
Net. ipv4.tcp _ rmem = 4096 262144 4194304
Net. ipv4.tcp _ wmem = 4096 262144 262144
Net. ipv4.ip _ local_port_range = 1024 65500
Net. ipv4.tcp _ keepalive_time = 30
Net. ipv4.tcp _ keepalive_intvl = 60
Net. ipv4.tcp _ keepalive_probes = 9
Net. ipv4.tcp _ retries2 = 3
Net. ipv4.tcp _ syn_retries = 2
VMS. min_free_kbytes = 51200
Vm. swappiness = 20
Vm. dirty_background_ratio = 3
Vm. dirty_ratio = 15
Vm. dirty_expire_centisecs = 500
Vm. dirty_writeback_centisecs = 100
EOF
Echo
Echo
Echo "make kernel change take effect"
/Sbin/sysctl-p
Echo
Echo
Echo "add hangcheck-timer mode"
Cp/etc/modprobe. conf/etc/modprobe. conf. bak
Cat>/etc/modprobe. conf <"EOF"
Options hangcheck-timer hangcheck_tick = 1 hangcheck_margin = 10 hangcheck_reboot = 1
EOF
Echo
Echo
/Sbin/modprobe-v hangcheck-timer
Echo
Echo
Modprobe-l | grep-I hang
Echo "###################################### ######################################## #####"
Echo
Echo
Echo
######################################## ######################################## ###
#5. Configure shared storage
# Manually view the scsi_id information and partition size of the disk using a script
######################################## ######################################## ###
# Vi diskinfo. sh
#> Diskinfo. tmp
#
# For I in a B c d e f g h I j k l m n o p q r s t u v w x y z;
# Do
# Diskinfo = 'fdisk-l/dev/sd $ I | grep "Disk/dev/sd $ I "'
# Echo 'scsi _ id: ''scsi _ id-gus/block/sd $ I '$ diskinfo | awk-F ', ''{print $1} '> diskinfo. tmp
# Done
#
# Sort diskinfo. tmp> diskinfo. rs
# More diskinfo. rs
# Rm-f diskinfo. tmp
######################################## ######################################## ###
#6. Create an oracle user and installation directory
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "6. Create an oracle user and installation directory"
Echo
Echo "creating oracle users and groups"
/Usr/sbin/groupadd-g 500 oinstall
/Usr/sbin/groupadd-g 501 dba
/Usr/sbin/useradd-u 500-g oinstall-G dba oracle
Echo oracle | passwd -- stdin oracle
Echo
Echo "Creating an oracle installation directory"
Mkdir-p/u01/app/oracle
Chown-R oracle: oinstall/u01/app/oracle
Chmod-R 775/u01/app/oracle
Echo
Echo "modifying oracle user session restrictions"
Cp/etc/security/limits. conf/etc/security/limits. conf. bak
Cat>/etc/security/limits. conf <"EOF"
######################################## #
# Add for oracle
Oraclesoftnofile131072
Oraclehardnofile131072
Oraclesoftnproc131072
Oraclehardnproc131072
Oraclesoftcoreunlimited
Oraclehardcoreunlimited
Oraclesoftmemlock50000000
Oraclehardmemlock50000000
EOF
Echo
Echo
Cp/etc/pam. d/login/etc/pam. d/login. bak
Cat>/etc/pam. d/login <"EOF"
######################################## ######
# Add for oracle
Session required pam_limits.so
EOF
Echo
Echo
Echo "modifying oracle user resource limits"
Cp/etc/profile. bak
Cat>/etc/profile <"EOF"
######################################## #
# Add for oracle
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Umask 022
Fi
EOF
Echo
Echo
Echo "editing oracle user environment variables"
Cp/home/oracle/. bash_profile/home/oracle/. bash_profile.bak
Cat>/home/oracle/. bash_profile <"EOF"
######################################## #
Export LANG = C
Export ORACLE_BASE =/u01/app/oracle
Export CRS_HOME = $ ORACLE_BASE/product/10.2.0/crs
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export ORACLE_SID =
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
Export NLS_DATE_FORMAT = "YYYY-MM-DD HH24: MI: SS"
Export PATH = $ ORACLE_HOME/bin: $ ORACLE_HOME/OPatch: $ CRS_HOME/bin:/usr/sbin: $ PATH
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
Export CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
Umask 022
EOF
Echo
######################################## ######################################## ###
#7. Restart the operating system for modification Verification
# Manual intervention required
######################################## ######################################## ###
######################################## ######################################## ###
# Check the modification Information
######################################## ######################################## ###
Echo "###################################### ######################################## #####"
Echo "Check the modification information"
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/selinux/config"
Cat/etc/selinux/config
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/sysctl. conf"
Cat/etc/sysctl. conf
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/modprobe. conf"
Cat/etc/modprobe. conf
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/security/limits. conf"
Cat/etc/security/limits. conf
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/pam. d/login"
Cat/etc/pam. d/login
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/etc/profile"
Cat/etc/profile
Echo
Echo "success "-----------------------------------------------------------------------------------"
Echo "/home/oracle/. bash_profile"
Cat/home/oracle/. bash_profile
Echo
Echo "complete installation and Initialization Configuration"
Recommended reading:
How to install Oracle 11g on Linux
Detailed description of the installation process of Oracle 11g Database in Linux
How to install Oracle 11g R2 single-instance database on CentOS 5.6
To install Oracle Clusterware on an Oracle vmvm
Install Oracle 11 GB single-instance database on Linux under vmvm