workstation:推送系统代码
#####
##### Name: workstationmain.cfg for rhel5
##### Type: Kickstart Configuration File
##### Depends on: parts of botang-config-push
##### Version: BCP-TAG201010210854-V9.20
###############################################################################
#
# sample workstation install script
# RHEL4
# $Id: workstation.cfg,v 1.1.2.3 2007/10/10 19:35:18 mcurry Exp $
# RHCX:  Customize keyboard, lang, langsupport, mouse, time, and DEVICE
#        (both %pre and %post) as appropriate
#
##############################################################################
####  1 Mail Begin
###   1.1 Text,Key,Keyboard,Lang,Net Begin
###text
install
keyboard us
lang en_US
selinux --enforcing
#langsupport --default en_US en_US
network --bootproto dhcp
nfs --server=192.168.0.254 --dir=/var/ftp/pub
# url --url ftp://server1.example.com/pub###   1.1 Text,Key,Keyborad,Lang,Net End
###   1.2 Partition Begin
#### Partition 19028M
%include /tmp/partitioning###
###   1.2 Partition End
###   1.3 Timezone,X,passwd,security,bootloader Begin
###   #mouse genericps/2 --emulthree
#mouse generic3ps/2
#mouse genericwheelusb --device input/mice
timezone Asia/Shanghai --utc
#timezone US/Central --utc
#timezone US/Mountain --utc
#timezone US/Pacific --utc# When probed, some monitors return strings that wreck havoc (not
# Pennington) with the installer.  You can indentify this condition
# by an early failure of the workstation kickstart just prior to when
# it would ordinarily raise the installer screen after probing.  There
# will be some nasty python spew.
# In this situation, comment the xconfig line below, then uncomment
# the skipx line.  Next, uncomment the lines beneath #MY X IS BORKED
graphical
#skipx
rootpw redhat
auth  --useshadow  --passalgo=md5
firstboot --disable
firewall --disabled
bootloader --location=mbr
reboot###
###   1.3 Timezone,X,passwd,security,bootloader End
####  1 Main End
####  2 Paclages Begin
####%packages@basic-desktop
@desktop-debugging
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@legacy-x
@remote-desktop-clients
@x11
# KDE is huge...install it if you wish
#@ KDE
#@ Windows File Server
#@ Web Server
elinks
openssh
openssh-server
openssh-clients
vim-enhanced
samba-common
samba-client
gimp
gimp-data-extras
enscript
libcap
ntp
coreutils
elfutils
elfutils-libelf
gimp-print-plugin
gnome-icon-theme
gstreamer
gstreamer-tools
#libgnomeprint22
#libgnomeprintui22
libgsf
libIDL
libraw1394
nautilus-cd-burner
openmotif
pyorbit
startup-notification
ttmkfdir
firefox
mutt
vnc
gcc
xorg-x11-apps####
####  2 Packages End
####  3 Post Begin
####%post###
###   3.1 Ntp/X Begin
#### Set the time, then set the hardware clock
ntpdate -b 192.168.0.254
hwclock --systohc --utc
# Non-destructive rebuild approach
CURRENT="5"
if [ -x /usr/bin/links ]; then httpget="/usr/bin/links";
elif [ -x /usr/bin/lynx ]; then httpget="/usr/bin/lynx";
fi
${httpget} -source http://192.168.0.254/buildscript > /tmp/buildscript
sh /tmp/buildscript
# MY X IS BORKED
#${httpget} -source http://192.168.0.254/cgi-bin/getXF86.pl > /etc/X11/XF86Config
#ln -s ../../usr/X11R6/bin/XFree86 /etc/X11/X
# Allows for easy RH035 setup. 7-Oct-2005 jsk
ifgrep -qv 'without-x' /proc/cmdline
thenperl -pi -e 's,id:3:initdefault,id:5:initdefault,' /etc/inittabsystem-config-display --noui --set-resolution=1280x1024
fi
# Configure as NTP client of server1
cat > /etc/ntp.conf <<END
restrict default ignore
restrict 127.0.0.1
restrict 192.168.0.254
server 192.168.0.254
driftfile /var/lib/ntp/drift
broadcastdelay 0.008END
echo "192.168.0.254" >> /etc/ntp/step-tickers
chkconfig ntpd on
perl -i -pe 's,via,vesa,'  /etc/X11/xorg.conf###
###   3.1 Ntp/X End
###   3.2 Lang/Network Begin
###cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=XXX
GATEWAY=192.168.0.254
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
EOF
# VMware Network
cat > /etc/ifcfg-eth0.bak << EOF
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=XXX
GATEWAY=192.168.0.254
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
EOF
# IP
v_botang_ip=`ifconfig  eth0 | head -n 2 | tail -n 1 | cut -d ':' -f 2 | cut -d ' ' -f 1`
perl -pi -e "s,XXX,$v_botang_ip," /etc/sysconfig/network-scripts/ifcfg-eth0
perl -pi -e "s,XXX,$v_botang_ip," /etc/ifcfg-eth0.bak
echo "99 0 eth0backup mv -f /etc/ifcfg-eth0.bak     /etc/sysconfig/network-scripts/ifcfg-eth0" >> /etc/anacrontab###
###   3.2 Lang/Network End
###   3.3 User Begin
#### These accounts should be consolidated
useradd student -u 600
echo "student" | passwd --stdin student
useradd visitor -u 601
echo "password" | passwd --stdin visitor###
###   3.3 User End
###   3.4 Lesson Begin
##    3.4.1 Tgz Begin
##wget -P / -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/upload.tgz
tar -C / -zxvf /upload.tgz
rm -f /upload.tgz
wget -P /usr/sbin -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/botang-start-lesson##
##    3.4.1 Tgz End
##    3.4.2 Usbstorage/X Begin
## find /lib/modules -name "usb-storage.ko" -exec rm -rf {} \;
echo "99 3 usbmodule find /lib/modules -name usb-storage.ko -exec rm -rf {} \;" >> /etc/anacrontab
chkconfig anacron ongrep -v '"DontZap" "off"' /etc/X11/xorg.conf > /etc/X11/xorg.conf.no
grep -v '"DontVTSwitch" "off"' /etc/X11/xorg.conf.no > /etc/X11/xorg.conf.no2
grep -v '"DontZoom" "off"' /etc/X11/xorg.conf.no2 > /etc/X11/xorg.conf.no3
grep -v '"HandleSpecialKeys" "Always"' /etc/X11/xorg.conf.no3 > /etc/X11/xorg.conf.no4
grep -v '"HandleSpecialKeys" "WhenNeeded"' /etc/X11/xorg.conf.no4 > /etc/X11/xorg.conf.no5
rm -f /etc/X11/xorg.conf
mv /etc/X11/xorg.conf.no5 /etc/X11/xorg.confgrep '"DontZap" "on"' /etc/X11/xorg.conf > /dev/null
v_1=$?
grep '"DontVTSwitch" "on"' /etc/X11/xorg.conf > /dev/null
v_2=$?
grep '"DontZoom" "on"' /etc/X11/xorg.conf > /dev/null
v_3=$?
grep '"HandleSpecialKeys" "Never"' /etc/X11/xorg.conf > /dev/null
v_4=$?if [ $v_1$v_2$v_3$v_4 != "0000" ]
thenecho "Section \"ServerFlags\""  >> /etc/X11/xorg.confecho "Option \"DontZap\" \"on\"" >> /etc/X11/xorg.confecho "Option \"DontVTSwitch\" \"on\"" >> /etc/X11/xorg.confecho "Option \"DontZoom\" \"on\"" >> /etc/X11/xorg.confecho "Option \"HandleSpecialKeys\" \"Never\"" >> /etc/X11/xorg.confecho "EndSection" >> /etc/X11/xorg.conf
fi##    3.4.2 Usbstorage/X End
###   3.5 Others Begin
#### Turn on updatedb
perl -pi -e 's,DAILY_UPDATE=no,DAILY_UPDATE=yes,g' /etc/updatedb.conf
# Why not handle leases right now, if requested?
#eval $(cat /proc/cmdline | awk '{print $NF}')
#case $s in
#        [1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[1-3]|192.168.0.[1-9]|192.168.0.[1-9][0-9]|192.168.0.1[0-9][0-9]|192.168.0.2[0-4][0-9]|192.168.0.25
#[1-3])
#                ${httpget} -source http://192.168.0.254/leaser > leaser
#                egrep -v "ifup|ifdown|killall" leaser > newleaser
#                chmod a+x newleaser
#                ./newleaser $s
#                rm -f leaser newleaser
#        ;;
#        *)
#                touch /tmp/.leaser_failed
#        ;;
#esac# Chuck's fix for the balky USB ports - 7-Oct-2005 jsk
#for FILE in $(ls /boot/initrd*); do
#        VERSION=$(basename ${FILE} | sed 's,initrd-,,g;s,.img,,g')
#        echo $VERSION
#        mkinitrd -f --preload="ehci-hcd uhci-hcd" ${FILE} ${VERSION}
#done
cp -rp /etc/yum.repos.d /etc/yum.repos.d.ori
rm -rf /etc/yum.repos.d/*cat >> /etc/yum.repos.d/base.repo <<EOF
[base]
name=RHEL base
baseurl=ftp://192.168.0.254/pub/Server
gpgcheck=0
EOF# ZB: Replace with wget of file?  Seems like a better solution in the long run.
#wget -q ftp://server1/pub/gls/server1.repo -O /etc/yum.repos.d/server1.repo# Install the pub keys
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-* 2>/dev/null
yum -y groupinstall "chinese support"
yum -y install "*chinese*"
chkconfig NetworkManager offyum -y groupinstall "Development tools"
yum -y install libaio
yum -y install libaio-develyum -y groupinstall "Development tools"
yum -y install libaio
yum -y install libaio-develyum -y groupinstall "Development tools"
yum -y install libaio
yum -y install libaio-develyum -y install unixODBC
yum -y install unixODBC-develyum -y install unixODBC
yum -y install unixODBC-develyum -y install unixODBC
yum -y install unixODBC-develyum -y install oracleasm\*
yum -y install oracleasm\*
yum -y install oracleasm\*yum -y install openmotif\*
yum -y install ksh\*
yum -y install sysstat\*
yum -y install compat\*
yum -y install nfs-utilsyum -y install openmotif\*
yum -y install ksh\*
yum -y install sysstat\*
yum -y install compat\*
yum -y install nfs-utilsyum -y install openmotif\*
yum -y install ksh\*
yum -y install sysstat\*
yum -y install compat\*
yum -y install nfs-utilsyum -y install "glibc-devel.i386"
yum -y install "glibc-devel.i386"
yum -y install "glibc-devel.i386"
###
###   3.5 Others End
###   3.6 Network Requirement Begin
##    3.6.1 Eth0 Begin
####    3.6.2 Eth1 End
###   3.6 Network Requirement End
###   3.7 Oracle Begin
##    3.7.1 User Begin
##echo "oracle" | passwd --stdin root
# oracle
groupadd oinstall
groupadd dba
groupadd oper
# grid
groupadd asmadmin
groupadd asmdba
groupadd asmoper
# oracle
useradd -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -d /home/oracle   oracle
echo "oracle" | passwd --stdin oracle
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
echo '# export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bash_profile
echo "# export ORACLE_SID=orcl"  >> /home/oracle/.bash_profile
echo '# export TNS_ADMIN=/u01/app/oracle/product/11.2.0/grid/network/admin'  >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
echo '# export PATH=$ORACLE_HOME/bin:$PATH:/u01/app/oracle/product/11.2.0/grid/bin' >> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profilemkdir -p /u01/app/oracle
chown oracle:oinstall /u01/app
chown oracle:oinstall /u01/app/oraclecat > /etc/sudoers <<EOF
Runas_Alias     SUSER = root
User_Alias      ORA = oracleroot    ALL=(ALL) ALL
ORA     ALL=(SUSER)     NOPASSWD: ALL
EOFyum -y install tigervnc-server.x86_64
sleep 3
yum -y install tigervnc-server.x86_64
sleep 3
yum -y install tigervnc-server.x86_64mkdir /home/oracle/.vnc/
cat > /home/oracle/.vnc/xstartup <<EOF
#!/bin/sh[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; thencase "$WINDOWMANAGER" in*gnome*)if [ -e /etc/SuSE-release ]; thenPATH=$PATH:/opt/gnome/binexport PATHfi;;esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; thenexec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; thenexec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
EOFecho 'VNCSERVERS="2:oracle"' > /etc/sysconfig/vncservers
echo 'VNCSERVERARGS[2]="-geometry 1024x768"' >> /etc/sysconfig/vncservers
wget -P /home/oracle/.vnc -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/RAC/passwd
chmod 700 /home/oracle/.vnc/passwd
chown -R oracle:oinstall /home/oracle/.vnc
chmod +x /home/oracle/.vnc/xstartup
chkconfig vncserver on##
##    3.7.1 User End
##    3.7.2 Os Software Patch Begin
### Patch All Linux eg. Display Card
mkdir -p /stage/OSPATCHS/alllinux/
wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/n.run
wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/a.run
wget -P /usr/lib/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/libXm.so.2
chmod +x /stage/OSPATCHS/alllinux/n.run
chmod +x /stage/OSPATCHS/alllinux/a.run##
##    3.7.2 Os Software Patch End
##    3.7.3 Os Script Patch Begin
##sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
echo "Red Hat Enterprise Linux Server release 4 (Tikanga)" > /etc/redhat-release
# Oracle2
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "net.core.rmem_default=4194304" >> /etc/sysctl.conf
echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default=1048576" >> /etc/sysctl.conf
echo "net.core.wmem_max=1048576" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
# Oracle3
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
# Oracle4
echo "grid soft nproc 2047" >>/etc/security/limits.conf
echo "grid hard nproc 16384" >>/etc/security/limits.conf
echo "grid soft nofile 1024" >>/etc/security/limits.conf
echo "grid hard nofile 65536" >>/etc/security/limits.conf
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
# Oracle5
echo 'if [ $USER = "oracle" ] || [ $USER = "grid" ] ; then' >>  /etc/profile
echo ' if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo '  ulimit -p 16384' >> /etc/profile
echo '  ulimit -n 65536' >> /etc/profile
echo ' else' >> /etc/profile
echo '  ulimit -u 16384 -n 65536' >> /etc/profile
echo ' fi' >> /etc/profile
echo 'fi' >> /etc/profile##
##    3.7.3 Os Script Patch End
##    3.7.4 Database Begin
##wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/flashplayer-11.2.202.297-1.ram0.98.x86_64.rpm
rpm -ivh /stage/flashplayer-11.2.202.297-1.ram0.98.x86_64.rpm
cp /usr/lib/mozilla/plugins/libflashplayer.so  /usr/lib64/mozilla/plugins/
# wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/pdksh-5.2.14-36.el5.x86_64.rpm
# rpm -ivh /stage/pdksh-5.2.14-36.el5.x86_64.rpm
mkdir /stage/UEKKERNEL
wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-[0-9]*
wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-devel-[0-9]*
wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-firmware*
wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/dtrace-modules-[0-9]*
rpm -ivh --nodeps --force  /stage/UEKKERNEL/*
wget -P /stage -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/ASMLIB/oracleasmlib-2.0.4-1.el6.x86_64.rpm
rpm -ivh /stage/oracleasmlib-2.0.4-1.el6.x86_64.rpm
wget -P /stage -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/ASMMOD/kmod-oracleasm-2.0.8-13.el6_8.x86_64.rpm
rpm -ivh --force --nodeps /stage/kmod-oracleasm-2.0.8-13.el6_8.x86_64.rpm
# UEK3 for ASMFD
mkdir /stage/UEK3
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/dtrace-modules-3.8.13-118.11.2.el6uek-0.4.5-3.el6.x86_64.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/dtrace-modules-provider-headers-0.4.5-3.el6.x86_64.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/dtrace-modules-shared-headers-0.4.5-3.el6.x86_64.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/kernel-uek-3.8.13-118.11.2.el6uek.x86_64.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/kernel-uek-devel-3.8.13-118.11.2.el6uek.x86_64.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/kernel-uek-firmware-3.8.13-118.11.2.el6uek.noarch.rpm
wget -P /stage/UEK3/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/UEK3/kernel-uek-headers-3.8.13-26.2.4.el6uek.x86_64.rpm
rpm -ivh --nodeps --force  /stage/UEK3/*
sed -i 's/default=[0-9]/default=1/g' /boot/grub/grub.conf# Install Source
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/11.2.0.4/p13390677_112040_Linux-x86-64_1of7.zip
unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_1of7.zip
#mv /stage/database /stage/Disk1
rm -f /stage/p13390677_112040_Linux-x86-64_1of7.zipwget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/11.2.0.4/p13390677_112040_Linux-x86-64_2of7.zip
unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_2of7.zip
#mv /stage/database /stage/Disk1
rm -f /stage/p13390677_112040_Linux-x86-64_2of7.zipwget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g_x8664/DATABASES/11.2.0.4/p13390677_112040_Linux-x86-64_3of7.zip
unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_3of7.zip
#mv /stage/database /stage/Disk1
rm -f /stage/p13390677_112040_Linux-x86-64_3of7.zipmkdir -p /stage/12c
wget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/DATABASES/12.1.0.1/V46095-01_1of2.zip
unzip -d /stage/12c  /stage/12c/V46095-01_1of2.zip
rm -f /stage/12c/V46095-01_1of2.zipwget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/DATABASES/12.1.0.1/V46095-01_2of2.zip
unzip -d /stage/12c  /stage/12c/V46095-01_2of2.zip
rm -f /stage/12c/V46095-01_2of2.zipwget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/INFRA/V46096-01_1of2.zip
unzip -d /stage/12c  /stage/12c/V46096-01_1of2.zip
rm -f /stage/12c/V46096-01_1of2.zipwget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/INFRA/V46096-01_2of2.zip
unzip -d /stage/12c  /stage/12c/V46096-01_2of2.zip
rm -f /stage/12c/V46096-01_2of2.zipchown -R oracle:oinstall /stage/cat > /usr/sbin/oracleasm.sh <<!
ifgrep -q hda /proc/partitions
thendisktype=sda
elifgrep -q vda /proc/partitions
thendisktype=vda
elifgrep -q xvda /proc/partitions
thendisktype=xvda
elifgrep -q sda /proc/partitions
thendisktype=sda
elsedisktype=sda
fichkconfig oracleasm on
oracleasm configure -i<<EOF
oracle
asmadmin
y
y
EOForacleasm initvd1=/dev/\${disktype}5
vd2=/dev/\${disktype}6
vd3=/dev/\${disktype}7
vd4=/dev/\${disktype}8
vd5=/dev/\${disktype}3oracleasm createdisk ASMDISK01 \$vd1
oracleasm createdisk ASMDISK02 \$vd2
oracleasm createdisk ASMDISK03 \$vd3
oracleasm createdisk ASMDISK04 \$vd4
oracleasm createdisk ASMDISK05 \$vd5
!chmod +x /usr/sbin/oracleasm.shecho "99 4 crs /usr/sbin/oracleasm.sh  >> /var/log/emca" >> /etc/anacrontab# Sqlplus Extent Script
#wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/sqlplus_extentsetup3.0.tgz
#tar -C  /stage -zxvf /stage/sqlplus_extentsetup3.0.tgz
#rm -f /stage/sqlplus_extentsetup3.0.tgz
#cd /stage/sqlplus_extentsetup3.0/
#./setup.sh
#cd -
chkconfig oracle offmkdir -p /u01/data/backup
chown -R oracle:oinstall /u01/data/##
##    3.7.4 Database End
##    3.7.5 OU Begin
##wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/create_t04209_uname.sql
wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/select_t04209_uname.sql
wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update_t04209_uname.sql
wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update2_t04209_uname.sql
wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/RMasmcmd.sh
chown oracle:oinstall /home/oracle/*.sql
chown oracle:oinstall /home/oracle/RMasmcmd.sh##
##   3.7.5 OU End###   3.7 Oracle End
###   3.9 Tape Begin
###yum -y install zlib-devel
yum -y install mtx
yum -y install mt-st
yum -y install lsscsi
yum -y install sg3_utils
yum -y install ncompresswget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/mhvtl-2016-03-10.tgz
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/V100647-01.zip
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.txt
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/reuseosb.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/lzo-2.04-3.4.x86_64.rpm
rpm -Uvh /stage/lzo-2.04-3.4.x86_64.rpm
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/lzo-devel-2.04-3.4.x86_64.rpm
rpm -Uvh /stage/lzo-devel-2.04-3.4.x86_64.rpm
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/UEK3/libdtrace-ctf-0.5.0-2.x86_64.rpm
rpm -Uvh /stage/libdtrace-ctf-0.5.0-2.x86_64.rpm
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/copytape-root.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/revertape-root.sh
cd /stage
tar zxvf mhvtl-2016-03-10.tgz
rm -f /stage/mhvtl-2016-03-10.tgz
cd /stage
unzip V100647-01.zip
rm -f /stage/V100647-01.zip
cd /stage/mhvtl-1.5
useradd vtl
echo oracle | passwd --stdin vtl
mkdir /opt/mhvtl
mkdir /etc/mhvtl
chown -R vtl:vtl /opt/mhvtl
chown -R vtl:vtl /etc/mhvtl
make distclean
cd /stage/mhvtl-1.5/kernel
make
make install
cd /stage/mhvtl-1.5/
make
make install
service mhvtl start
perl -i -pe 's,CAPACITY=500,CAPACITY=8000,' /etc/mhvtl/mhvtl.conf
chkconfig mhvtl on
service mhvtl stop
service mhvtl start
mkdir -p /usr/local/oracle/backup
mkdir -p /data/backup
chown oracle:oinstall /data/backup
# sed -i.bak 's/192.168.0.254/127.0.0.1/g' /etc/resolv.conf###
###   3.9 Tape End
###
###   3.11 Udev End
####  3 Post End
####
###   3.6 Grub Beginif grep '2.6.18' /boot/grub/grub.conf >/dev/null
thenA=`grep vmlinuz /boot/grub/grub.conf | grep -v '^#' | grep -v xen |  grep -v debug | head -n 1 | tr ' ' '\n'  | grep vmlinuz | cut -d / -f 2`B=`grep initrd /boot/grub/grub.conf | grep -v '^#' | grep -v xen |  grep -v debug  | head -n 1 | tr ' ' '\n'  | grep initrd- | cut -d / -f 2`C=vmlinuz-2.6.32-71.el6.i686D=initramfs-2.6.32-71.el6.i686.img
elseA=vmlinuz-2.6.18-164.el5PAEB=initrd-2.6.18-164.el5PAE.imgC=`grep vmlinuz /boot/grub/grub.conf | grep -v '^#' | grep -v xen |  grep -v debug | head -n 1 | tr ' ' '\n'  | grep vmlinuz | cut -d / -f 2`D=`grep initrd /boot/grub/grub.conf | grep -v '^#' | grep -v xen |  grep -v debug  | head -n 1 | tr ' ' '\n'  | grep initrd- | cut -d / -f 2`
fi# OCA/OCP
echo "title /dev/sda1---> Oracle 11g OCA/OCP: Database Standalone Server (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,0)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/O11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# Dataguard
echo "title /dev/sda10---> Oracle 11g OCM: Dataguad Configuration (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/DG11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# Grid Control
echo "title /dev/sda10---> Oracle 11g OCM: Grid Control (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/GC11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# New Feature
echo "title /dev/sda10---> Oracle 11g OCM: New Feature (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/NEW11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# RAC nodes
echo "title /dev/sda10---> Oracle 11g OCM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/RAC11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# Shared Disk
echo "title /dev/sda10---> Oracle 11g OCM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$C ro root=/dev/mapper/RAC11grhel6shareddisk-root rd_LVM_LV=RAC11grhel6shareddisk/root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet" >> /boot/grub/grub.conf
echo "initrd /$D" >> /boot/grub/grub.conf# OCM10g
echo "title /dev/sda10---> Oracle 10g OCM PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM10geven/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 10g OCM PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM10godd/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 10g OCM PRACTICUM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM10grac/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 10g OCM PRACTICUM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$C ro root=/dev/mapper/OCM10gshareddisk-root rd_LVM_LV=OCM10gshareddisk/root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet" >> /boot/grub/grub.conf
echo "initrd /$D" >> /boot/grub/grub.conf# OCM11g1days
echo "title /dev/sda10---> Oracle 11g1days OCM UPDATE PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM11g1dayseven/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 11g1days OCM UPDATE PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM11g1daysodd/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.conf# OCM11g2days
echo "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM11g2dayseven/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM11g2daysodd/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$A ro root=/dev/OCM11g2daysrac/root rhgb quiet" >>  /boot/grub/grub.conf
echo "initrd /$B" >> /boot/grub/grub.confecho "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
echo "root (hd0,9)" >> /boot/grub/grub.conf
echo "kernel /$C ro root=/dev/mapper/OCM11g2daysshareddisk-root rd_LVM_LV=OCM11g2daysshareddisk/root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet" >> /boot/grub/grub.conf
echo "initrd /$D" >> /boot/grub/grub.confperl -i -pe 's,timeout=,timeout=5000,' /boot/grub/grub.conf
grep -v 'hiddenmenu' /boot/grub/grub.conf > /boot/grub/grub.conf2
mv -f /boot/grub/grub.conf2 /boot/grub/grub.conf###
###   3.6 Grub end
%pre
# Partition Total 19028M
echo "Starting PRE" > /dev/tty2v_pci0=$(udevinfo -ap /sys/class/net/eth0 | grep 'ID==' | head -n 1)
v_pci1=$(udevinfo -ap /sys/class/net/eth1 | grep 'ID==' | head -n 1)
v_driver0=$(udevinfo -ap /sys/class/net/eth0 | grep 'DRIVER==' | head -n 1)
v_driver1=$(udevinfo -ap /sys/class/net/eth1 | grep 'DRIVER==' | head -n 1)
v_mac0=$(ifconfig eth0 | grep HWaddr | cut -d ' ' -f 11)
v_mac1=$(ifconfig eth1 | grep HWaddr | cut -d ' ' -f 11)if [ ! -z $v_mac1 ]
thencat >> /etc/udev/rules.d/60-net.rules <<EOF
$v_driver0, $v_pci0, NAME="eth0"
$v_driver1, $v_pci1, NAME="eth1"
EOF
fiv_ip_short=$(grep $v_mac0 /mnt/source/workstation.list | cut -d '-' -f 1)
v_ip=192.168.0.$v_ip_shortif [ ! -z $v_ip_short ]
thenifconfig eth0 $v_iphostname station$v_ip_short.example.com
fi# CLASSROOM MACHINE(c) NEED A DISK OF: 90000M
cat >>  /tmp/partitioning <<EOF
clearpart --none
part /boot  --size 300
part swap --size 4096
part pv.RAC12crhel601 --size 45800
volgroup RAC12crhel6 pv.RAC12crhel601
logvol /  --vgname=RAC12crhel6 --size=45700 --name=root
part pv.O11grhel502 --size 7000
part pv.O11grhel503 --size 7000
part pv.O11grhel504 --size 7000
part pv.O11grhel505 --size 7000
part pv.O11grhel506 --size 10000
EOF
												

2018-1-3 第一节 安装系统redhat相关推荐

  1. Python for Android最简单详细的,最手把手的教程 之第一节安装

    Python for Android最简单详细的,最手把手的教程 之第一节安装 本文转自:http://bbs.python520.com/thread-179-1-1.html Python for ...

  2. python编程print语法_Python 第一节 安装及 print 输出语句—教案

    Python 第一节 安装及 print 输出语句 学习目标: 1 .学会安装 python 编程软件并测试编程环境是否成功 2 .理解字符串和表达式的概念 3 .学会使用 print 语句输出不同内 ...

  3. Python基础系列教程 第一节 安装运行Python

    安装Python解释器 Python 是一门解释性脚本语言,因此要想让你编写的代码得以运行,需要先安装 CPython 解释器. 根据你电脑的系统以及位数不同,安装步骤也有所差异. Windows 系 ...

  4. linux安装cd dev ls,linux 第一节 安装

    图片发自简书App Linux常用软件包下载链接: rpm包安装:http://rpmfind.net/linux 源码包安装:http://sourceforge.net/ Centos软件包:ht ...

  5. JAVA分布式医疗云平台系统开发实战第一节 open-his系统技术架构与环境准备

    项目简介                                                                       Open-His 是以完整的基层医疗机构-信息化解 ...

  6. 第一节 安装Matlab 2016a Win64

    今天在网上看到Matlab 2016a Win64的安装包, 觉得自己也应该学习一下matlab, 毕竟这么强大的工具,自己只知其名不知其用. 安装包下载下来,安装完成后发现自己的机器竟然可以带动,很 ...

  7. Oracle12c 的安装教程图解(安装系统:windows 2008R2)

    Oracle12c 的安装教程图解(安装系统:windows 2008R2) 第一节 安装和下载路径 1   官方下载路径: http://www.oracle.com/cn/products/dat ...

  8. 操作系统的另类安装---如何抛开光盘安装系统

     第一节:如何从硬盘中全新安装操作系统 本节目的:实现在无光驱.软驱.U盘,系统分区无论FAT或者NTFS格式下全新安装操作系统         ---当光驱损坏.分区为NTFS的情况下安装系统的替代 ...

  9. linux基础(一)安装系统Centos6.5

    安装有常用有:远程网络安装.U盘安装.光盘安装三种方式,以下为光盘进行安装 1.出现引导界面,选择安装或升级现有系统,选择第一个安装系统. Install or upgrade an existing ...

最新文章

  1. php js array,JavaScript等同于PHP的in_array()
  2. 迁移学习——Domain Adaptation
  3. 【任务脚本】0522更新京东618叠蛋糕任务脚本,京东任务自动程序
  4. LVS负载均衡群集的了解与基本配置(一)
  5. 优化器 - tf.keras.optimizers.SGD()【TensorFlow2入门手册】
  6. Tomcat 5.0.18 安装配置指南
  7. 使命召唤为啥显示新服务器玩家,《使命召唤8》建立服务器和加入自己、别人服务器方法...
  8. 随机取 数据库中的 记录
  9. Date类型之组件方法
  10. 高德地图车机版缩放版_高德地图车机版2020
  11. 三阶魔方大中小魔公式_三阶魔方花样玩法,公式汇总
  12. Android 房贷计算
  13. CorelDRAW X8 /CDR2020官方序列号密钥下载矢量绘图软件
  14. c语言中 让小球 发射小球,小球发射问题求大神解决(让小球向鼠标蓄力方向发射)...
  15. matlab冲激函数delta,信号与系统matlab实验指导书解决方案.doc
  16. 使用CCS调试CC3200芯片GPIO接口应用----流水灯程序
  17. Oracle同义词和DBLink关联
  18. PDF合并软件推荐【绿色免费】
  19. 车辆销售系统用例_中远房产销售管理系统用例图
  20. 群晖webdev挂载中国移动和彩云网盘

热门文章

  1. 替换word中英文““为中文双引号“”,且保持西文为Time NewRome
  2. 图像处理:Gabor滤波器简介以及python实现
  3. 怎么在CAD图库中添加新图块?
  4. wx图片的相机相册获取,预览图片,图片保存,图片的信息
  5. nginx实现对websocket加密协议wss协议的反向代理以及websocket整合springboot入门(踩坑)
  6. Nginx去配置socket的时候,发现nginx没有配置ws/wss协议,配置步骤如下
  7. mysql主键和唯一索引_mysql 主键和唯一索引的区别
  8. 关于容灾备份的一些思考
  9. 在-Linux-上安装-Stata
  10. 深入Windows APC