- installs the OS via cmdline mode (no gui/tui)
- creates the oracle user and filesystem
- sets kernel parameters needed for 11g install
- install required packages for 11g install
- creates an oracle group and user
- sets an oracle environemt var declaration (via .bash_profile)
this is tested with CENTOS5u5/RHEL5u5 x86_64
NOTE:
you need to change the following for your environment
- installation source (here i'm using NFS)
- network settings (ip address, network interface, etc)
- disk drive (i'm using an HP blade with Smart Array 6i controllers
hence the cciss/c0d0 and ccissc0d1 disks
here's the kickstart contents (some company
specific entries here were removed):
##START of kickstart file
install
reboot
skipx
cmdline
nfs --server=<your_nfs_server> --dir=/export/centos/CENTOS5U5/x86_64
lang en_US.UTF-8
keyboard us
#uncomment for RHEL5 install
#key --skip
#network --device eth0 --onboot no --bootproto dhcp --hostname LX0040
#network --device eth1 --onboot no --bootproto dhcp --hostname LX0040
network --device eth2 --bootproto static --ip 10.129.a.b --netmask 255.255.255.0 --gateway 10.129.a.1 --nameserver 10.129.c.d --hostname LX0040
#network --device eth3 --onboot no --bootproto dhcp --hostname LX0040
# root pass is r00tm3pass
rootpw --iscrypted $1$4Y6Je/$CF8Cts/dWgo4d7DpasKSu0
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --permissive
timezone Asia/Singapore
device scsi cciss
bootloader --location=mbr --driveorder=cciss/c0d0,cciss/c0d1 --append="rhgb quiet"
##############################
##this is for a two SMart Array volume setup
## CHANGE THIS FOR YOUR MACHINE!!!
clearpart --linux --initlabel --drives=cciss/c0d0,cciss/c0d1
part /boot --fstype ext3 --size=100 --ondisk=cciss/c0d0 --asprimary
part pv.6 --size=100 --grow --ondisk=cciss/c0d0 --asprimary
part pv.7 --size=100 --grow --ondisk=cciss/c0d1 --asprimary
volgroup vg00 --pesize=32768 pv.6
volgroup vgdata00 --pesize=32768 pv.7
logvol / --fstype ext3 --name=lvsys00 --vgname=vg00 --size=512
logvol swap --fstype swap --name=lvsys01 --vgname=vg00 --size=8192
logvol /usr --fstype ext3 --name=lvsys02 --vgname=vg00 --size=2048
logvol /var --fstype ext3 --name=lvsys03 --vgname=vg00 --size=1024
logvol /opt --fstype ext3 --name=lvsys04 --vgname=vg00 --size=256
#will produce error during oracle install
#logvol /tmp --fstype ext3 --name=lvsys05 --vgname=vg00 --size=2048 --fsoptions=noexec,nodev
logvol /tmp --fstype ext3 --name=lvsys05 --vgname=vg00 --size=2048
logvol /home --fstype ext3 --name=lvsys06 --vgname=vg00 --size=256
logvol /tools --fstype ext3 --name=lvtools00 --vgname=vg00 --size=5000
logvol /u01 --fstype ext3 --name=lvora00 --vgname=vgdata00 --size=10000
services --disabled sendmail,xfs,bluetooth,kudzu,firstboot,cups,ip6tables,iptables
%packages
@legacy-software-support
e2fsprogs
kernel
openssh-clients
openssh-server
postfix
vnc-server
yum
device-mapper
device-mapper-multipath
device-mapper-event
#oracle
ntp
strace
ncompress
sg3_utils
ncurses
xorg-x11-deprecated-libs-devel
xorg-x11-deprecated-libs
xorg-x11-utils
libX11-devel
libXext
libdmx
libXxf86misc
libXxf86dga
sysstat
compat-gcc-34-c++
compat-libgcc-296
compat-glibc-headers
compat-glibc
libgcc
compat-db
gcc
gcc-c++
ncurses.i386
compat-glibc.i386
glibc-devel
dejavu-lgc-fonts
xterm
#system-config-cluster
binutils
compat-libstdc++-296
compat-libstdc++-33
elfutils-libelf
gcc
gcc-c++
glibc
glibc-common
glibc-devel
glibc-headers
libaio
libaio-devel
libgcc.i386
libstdc++
libstdc++-devel
libXp
libXt
libXtst
make
openmotif
sysstat
unixODBC
unixODBC-devel
pyOpenSSL
#11g
elfutils-libelf-devel
pdksh
#unwanted
-ftp
-talk
-setserial
-wireless-tools
-rp-pppoe
-ppp
-wpa_supplicant
-bluez-utils
-bluez-gnome
-rsh
-rdist
-pango
-notification-daemon
-usbutils
-irda-utils
-firstboot-tui
%post --log=/root/ks-post.log
{
#~-> Remove GRUB's splash image
/bin/ed <<EOT /etc/grub.conf
1,$ s/^splashimage/#splashimage/
.
wq
EOT
#~-> User limits
ed /etc/security/limits.conf << EOF
$
.a
oracle soft nofile 65536
oracle hard nofile 101062
oracle soft nproc 16384
oracle hard nproc 101062
.
w
EOF
#kernel params
/bin/cat <<EOF_sysctl > /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# increase the local port range
net.ipv4.ip_local_port_range = 9000 65500
# enable tcp syn cookie protection
net.ipv4.tcp_syncookies = 1
# disable icmp redirect acceptance
net.ipv4.conf.all.accept_redirects = 0
# enable ip spoofing protection
net.ipv4.conf.all.rp_filter = 1
# log spoofed/source routed/redirected packets
#net.ipv4.conf.all.log_martians = 1
# want to become a smurf amplifier?
net.ipv4.icmp_echo_ignore_broadcasts = 1
# enable bad error message protection
net.ipv4.icmp_ignore_bogus_error_responses = 1
# decrease time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 30
# decrease time default value for tcp_keepalive_time connection
net.ipv4.tcp_keepalive_time = 1800
# turn off tcp_sack
net.ipv4.tcp_sack = 0
# turn off tcp_timestamps
net.ipv4.tcp_timestamps = 0
# turn off tcp_window_scaling
net.ipv4.tcp_window_scaling = 0
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
# Default setting in bytes of the socket receive buffer
net.core.rmem_default=262144
# Default setting in bytes of the socket send buffer
net.core.wmem_default=262144
# Maximum socket receive buffer size which may be set by using the SO_RCVBUF socket option
net.core.rmem_max=4194304
# Maximum socket send buffer size which may be set by using the SO_SNDBUF socket option
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
EOF_sysctl
/bin/chown root:root /etc/sysctl.conf
/bin/chmod 0600 /etc/sysctl.conf
/sbin/sysctl -p
# Modify DNS Search
/bin/cat <<EOT > /etc/resolv.conf
nameserver 10.129.c.20
nameserver 10.129.c.21
domain example.com
options attempts:5
options timeout:15
EOT
# create group
/usr/sbin/groupadd -g 306 dba
/bin/mkdir --mode=0750 /home/dba
chgrp dba /home/dba
#oracle password is oracl3pass
/usr/sbin/useradd -c 'oracle user' -d /home/dba/oracle -u 306 -p '$1$F.iIe/$vfXBG1CqjXB5xOu.LLEdJ.' -g dba -G dba oracle
cat <<EOT >> /etc/auto.isapsys
oracle11g -ro,soft,intr,rsize=8192,wsize=8192 uxisap0027:/export/isapsys/oracle11g
EOT
# vncserver stuff
cat << EOT > /opt/vnc_xstartup
#!/bin/sh
# run vncserver and copy to your $HOME/.vnc/xstartup file
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 130x30+12+12 -ls -bg black -fg green -title "$VNCDESKTOP Desktop" &
xterm -geometry 130x30+12+12 -ls -title "$VNCDESKTOP Desktop" &
mwm &
EOT
# oracle user .bash_profile
cat > /home/dba/oracle/.bash_profile << EOF
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\${ORACLE_BASE}/product/11g/db_1
export ORA_CRS_HOME=/u01/app/crs
export ORACLE_PATH=\${ORACLE_BASE}/common/oracle/sql:.:\${ORACLE_HOME}/rdbms/admin
export CV_JDKHOME=/usr/local/java
# Each RAC node must have a unique ORACLE_SID. (i.e. orcl1, orcl2,...)
export ORACLE_SID=orcl1
export PATH=.:\${JAVA_HOME}/bin:${PATH}:$HOME/bin:\${ORACLE_HOME}/bin
export PATH=\${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=\${PATH}:\${ORACLE_BASE}/common/oracle/bin
export ORACLE_TERM=xterm
export TNS_ADMIN=\${ORACLE_HOME}/network/admin
export ORA_NLS10=\${ORACLE_HOME}/nls/data
export LD_LIBRARY_PATH=\${ORACLE_HOME}/lib
export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\${ORACLE_HOME}/oracm/lib
export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=\${ORACLE_HOME}/JRE
export CLASSPATH=\${CLASSPATH}:\${ORACLE_HOME}/jlib
export CLASSPATH=\${CLASSPATH}:\${ORACLE_HOME}/rdbms/jlib
export CLASSPATH=\${CLASSPATH}:\${ORACLE_HOME}/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
alias ls="ls -FA"
set -o vi
EOF
# end oracle profile
chown -R oracle.dba /u01
mount | column -t
} 1>/root/ks-post.log 2>&1
##END of kickstart file
ks install in progress:
space usage after the install:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lvsys00 496M 238M 234M 51% / /dev/mapper/vg00-lvsys03 992M 56M 885M 6% /var /dev/mapper/vg00-lvsys02 2.0G 1012M 870M 54% /usr /dev/mapper/vg00-lvsys06 248M 11M 226M 5% /home /dev/mapper/vg00-lvsys04 248M 11M 226M 5% /opt /dev/mapper/vg00-lvsys05 2.0G 70M 1.8G 4% /tmp /dev/cciss/c0d0p1 99M 13M 82M 14% /boot tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/mapper/vg00-lvtools00 4.8G 138M 4.4G 4% /tools /dev/mapper/vgdata00-lvora00 9.5G 4.1G 4.9G 46% /u01
After the OS install, system will reboot. from here on, Oracle 11g R2 installation
is a breeze. I just login as oracle user, start vncserver and connect via
vncviewer from my workstation to start the install.
these are the last part of the oracle installation via
vnc-viewer session:




0 comments:
Post a Comment