Oracle KS

RHEL-oracle.ks
 
 #############################################################################
#
# This Kickstart file is used to install the minimum RHEL server for use with
# Oracle database. It also removes unneeded services.
#
# The default root password is: password
#
# Values to change before using are:
# - Set the network - The hostname & Network configuration (DHCP/Static)
# - Partitioning & Swap size
# - Set a different timezone if not located in Israel
# - If going to use rawdevices comment the "chkconfig rawdevices off" line
# - Set the shmmax kernel parameter to the correct value
# - If you are not going to install Oracle RAC, you can comment the hangcheck line in this file
#
# This is OEL/RHEL 3/4. For OEL/RHEL 5, comment indicated lines!!!
#
# Things to do after the server is installed:
# Change the root and oracle accounts password
# Create the needed filesystem and set the owner to oracle
# Change the ORACLE_BASE, ORACLE_SID environment variables in 
# ~oracle/.bash_profile to the correct values
# Set the server default run level to 3 or 4 (if using NFS/CIFS)
#############################################################################
 
# Uncomment the next line to enable interactive installation
#interactive
 
# Comment the next line to use GUI installation
text
 
install
# reboot after installation
reboot
 
# From where to get the installation disks
cdrom
#url --url http://myserver/redhat/
 
lang en_US.UTF-8
#OEL5: langsupport deprecated 
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
xconfig --resolution 800x600 --depth 16 --defaultdesktop gnome
 
# Change the hostname and adjust the eth configuration for your environment
# hostname_$$ adds random number to hostname to try and avoid name conflicts (tested on OEL 5.2+)
network --device eth0 --noipv6 --bootproto dhcp --hostname srvoracle01_$$
#network --device eth0 --bootproto static --ip x.y.z.v --netmask 255.255.255.0 --gateway x.y.z.v --nameserver x.y.z.t,x.y.z.v --hostname srvoracle01_$$
 
rootpw --iscrypted $1$uKWECPhN$Im66UG8MpWd2/kpcHoyuy/
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5
 
# Set a different timezone if not located in israel
timezone Asia/Jerusalem
 
bootloader --location=mbr --append="rhgb quiet"
# OEL5: for multipath systems 
#bootloader --location=mbr --driveorder=sda,mapper/mpathX --append="verbose"
# OEL5: for boot from SAN, match driveorder to BIOS boot disk order
#bootloader --location=mbr --driveorder=mapper/mpathY,sda --append="nousbstorage verbose"
# OEL5: any options to zerombr deprecated
#zerombr
zerombr yes
# initlabel clears the label present on most used disks; helps LVM/Oracle ASM to see disks as new
clearpart --all --initlabel --drives=sda
# for multipath systems
#clearpart --all --initlabel --drives=sda,mapper/mpath0,mapper/mpath1,mapper/mpath2,mapper/mpath3
 
# for boot from SAN, use your boot LUN. E.g. --ondisk=mapper/mpath4 or mapper/mpath2
part /boot --asprimary --fstype ext3 --size=100 --ondisk=sda
# Setup LVM
part pv.3 --size=1 --grow --ondisk=sda
volgroup vgsystem --pesize=32768 pv.3
 
# Create the file systems and logical volumes; assigning useful names to LVs
logvol / --fstype ext3 --name=lvroot --vgname=vgsystem --size=2048
logvol /tmp --fstype ext3 --name=lvtmp --vgname=vgsystem --size=2048
logvol /usr --fstype ext3 --name=lvusr --vgname=vgsystem --size=3072
logvol /usr/local --fstype ext3 --name=lvusrlocal --vgname=vgsystem --size=1024
logvol /var --fstype ext3 --name=lvvar --vgname=vgsystem --size=1024
logvol /var/log --fstype ext3 --name=lvvarlog --vgname=vgsystem --size=1024
logvol /opt --fstype ext3 --name=lvopt --vgname=vgsystem --size=1024
logvol /home --fstype ext3 --name=lvhome --vgname=vgsystem --size=512 --grow
 
# Edit the swap space to be twice the size of the machine RAM, 
# if you have 8GB of RAM or more set the swap to the same size as the RAM
logvol swap --fstype swap --name=lvswap --vgname=vgsystem --size=2048
 
# All packages needed by Oracle installation include Gnome desktop
# NOTE: despite explicitly removing a pkg, dependencies may add them later on. 
# Always clean up RPMs/packages after reboot and before an up2date/yum update
#OEL5: up2date deprecated! use yum
%packages
@ system-tools
@ gnome-desktop
@ dialup
# OEL5: comment out next line
@ compat-arch-support
-openldap-clients
-ckermit
-wireshark
-bluez-pin
-OpenIPMI-tools
-samba-client
e2fsprogs
-screen
-xdelta
-zsh
-nmap
lvm2
-open
# OEL5: comment out next line
kernel-smp
grub
binutils
compat-db
control-center
gcc
gcc-c++
glibc
glibc-common
# OEL5: comment out next line
gnome-libs
libstdc++
libstdc++-devel
make
# OEL5: comment out next line
pdksh
sysstat
# OEL5: comment out next line
xscreensaver
# SNMP makes monitoring server much easier, if configured right
#net-snmp-utils
# add Oracle package at install time to solve many dependencies
# NOTE: package is not on CD! Only yum/up2date. DVD untested
#oracle-validated
 
# This post script modify all the Oracle database prerequisites, includes oracle user and dba,oinstall groups
%post
 
# create user and groups
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
 
# Change kernel parameters
cat >> /etc/sysctl.conf << EOF
 
##############################
# Oracle Database requirements
##############################
 
# The max value for shmmax on a 32bit machine is 4294967295
#kernel.shmmax = 536870912
 
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 658576
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 1048536
net.core.wmem_max = 1048536
EOF
 
# Change ulimits for user oracle
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
EOF
 
# Add hangcheck-timer module for RAC; comment if you don't need RAC
echo "options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180" >> /etc/modprobe.conf
echo "modprobe hangcheck-timer" >> /etc/rc.modules
 
# Set oracle account environment variables
cat >> /home/oracle/.bash_profile << EOF 
 
# Oracle environment variables
export ORACLE_BASE=/software/oracle
#export ORACLE_HOME=\$ORACLE_BASE/10g
#export TNS_ADMIN=\$ORACLE_HOME/network/admin
export ORACLE_SID=orcl1
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib
export PATH=\$PATH:\$ORACLE_HOME/bin
 
if [ "`ls -ld \$ORACLE_HOME | awk '{print \$3" "\$4}'`" != "oracle oinstall" ]
then
echo "The ORACLE_HOME (\$ORACLE_HOME) is not owned by oracle:oinstall"
fi
EOF
 
#############################
# Remove unneeded services!!!
#############################
 
# Comment this line if you are using Oracle Clusterware
chkconfig rawdevices off
 
# Enable Network filesystems support for run level 4 only
chkconfig --level 12356 portmap off
chkconfig --level 12356 nfslock off
chkconfig --level 12356 rpcgssd off
chkconfig --level 12356 rpcidmapd off
chkconfig --level 12356 autofs off
chkconfig --level 4 portmap on
chkconfig --level 4 nfslock on
chkconfig --level 4 rpcgssd on
chkconfig --level 4 rpcidmapd on
chkconfig --level 4 autofs on
 
# Enable xfs support for run level 5 only
chkconfig --level 12346 xfs off
chkconfig --level 5 xfs on
 
chkconfig sendmail off
chkconfig cups off
chkconfig hplip off
chkconfig anacron off
chkconfig apmd off
chkconfig arptables_jf off
chkconfig atd off
chkconfig bluetooth off
chkconfig canna off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig hidd off
chkconfig hpoj off
chkconfig iiim off
chkconfig isdn off
#OEL5: comment line below; pkg not longer exists
chkconfig pcmcia off
#if using SNMP, uncomment line below
#chkconfig snmpd on
chkconfig rhnsd off
chkconfig auth off
 
# OEL/RHEL 5 only services
#chkconfig yum-updatesd off
#chkconfig setroubleshoot off
#chkconfig restorecond off
#chkconfig pcscd off
#chkconfig mcstrans off
#chkconfig avahi-dnsconfd off
#chkconfig avahi-daemon off
 
ks/oracleks.txt · Last modified: 15/08/2019 17:12 by 127.0.0.1