Bo's Oracle Station

查看: 1694|回复: 0

活动第1/2次(2018-03-10星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-3-11 09:21:53 | 显示全部楼层 |阅读模式
以下是workstation.cfg的内容:
  1. #####
  2. ##### Name: workstationmain.cfg for rhel5
  3. ##### Type: Kickstart Configuration File
  4. ##### Depends on: parts of botang-config-push
  5. ##### Version: BCP-TAG201010210854-V9.20
  6. #####

  7. ##########################################################################
  8. #
  9. # sample workstation install script
  10. # RHEL4
  11. # $Id: workstation.cfg,v 1.1.2.3 2007/10/10 19:35:18 mcurry Exp $
  12. # RHCX:  Customize keyboard, lang, langsupport, mouse, time, and DEVICE
  13. #        (both %pre and %post) as appropriate
  14. #
  15. ##########################################################################

  16. ####
  17. ####  1 Mail Begin
  18. ###   1.1 Text,Key,Keyboard,Lang,Net Begin
  19. ###

  20. text
  21. install
  22. keyboard us
  23. lang en_US
  24. selinux --enforcing
  25. #langsupport --default en_US en_US
  26. network --bootproto dhcp
  27. nfs --server=192.168.0.254 --dir=/var/ftp/pub
  28. # url --url ftp://server1.example.com/pub

  29. ###   1.1 Text,Key,Keyborad,Lang,Net End
  30. ###   1.2 Partition Begin
  31. ###

  32. # Partition 19028M
  33. %include /tmp/partitioning

  34. ###   
  35. ###   1.2 Partition End
  36. ###   1.3 Timezone,X,passwd,security,bootloader Begin
  37. ###   

  38. #mouse genericps/2 --emulthree
  39. #mouse generic3ps/2
  40. #mouse genericwheelusb --device input/mice
  41. timezone Asia/Shanghai --utc
  42. #timezone US/Central --utc
  43. #timezone US/Mountain --utc
  44. #timezone US/Pacific --utc

  45. # When probed, some monitors return strings that wreck havoc (not
  46. # Pennington) with the installer.  You can indentify this condition
  47. # by an early failure of the workstation kickstart just prior to when
  48. # it would ordinarily raise the installer screen after probing.  There
  49. # will be some nasty python spew.
  50. # In this situation, comment the xconfig line below, then uncomment
  51. # the skipx line.  Next, uncomment the lines beneath #MY X IS BORKED
  52. graphical
  53. #skipx
  54. rootpw redhat
  55. auth  --useshadow  --passalgo=md5
  56. firstboot --disable
  57. firewall --disabled
  58. bootloader --location=mbr
  59. reboot

  60. ###
  61. ###   1.3 Timezone,X,passwd,security,bootloader End
  62. ####  1 Main End
  63. ####  2 Paclages Begin
  64. ####

  65. %packages

  66. @basic-desktop
  67. @desktop-debugging
  68. @desktop-platform
  69. @fonts
  70. @general-desktop
  71. @graphical-admin-tools
  72. @input-methods
  73. @legacy-x
  74. @remote-desktop-clients
  75. @x11
  76. # KDE is huge...install it if you wish
  77. #@ KDE
  78. #@ Windows File Server
  79. #@ Web Server
  80. elinks
  81. openssh
  82. openssh-server
  83. openssh-clients
  84. vim-enhanced
  85. samba-common
  86. samba-client
  87. gimp
  88. gimp-data-extras
  89. enscript
  90. libcap
  91. ntp
  92. coreutils
  93. elfutils
  94. elfutils-libelf
  95. gimp-print-plugin
  96. gnome-icon-theme
  97. gstreamer
  98. gstreamer-tools
  99. #libgnomeprint22
  100. #libgnomeprintui22
  101. libgsf
  102. libIDL
  103. libraw1394
  104. nautilus-cd-burner
  105. openmotif
  106. pyorbit
  107. startup-notification
  108. ttmkfdir
  109. firefox
  110. mutt
  111. vnc
  112. gcc
  113. xorg-x11-apps

  114. ####
  115. ####  2 Packages End
  116. ####  3 Post Begin
  117. ####

  118. %post

  119. ###
  120. ###   3.1 Ntp/X Begin
  121. ###

  122. # Set the time, then set the hardware clock
  123. ntpdate -b 192.168.0.254
  124. hwclock --systohc --utc
  125. # Non-destructive rebuild approach
  126. CURRENT="5"
  127. if [ -x /usr/bin/links ]; then httpget="/usr/bin/links";
  128. elif [ -x /usr/bin/lynx ]; then httpget="/usr/bin/lynx";
  129. fi
  130. ${httpget} -source http://192.168.0.254/buildscript > /tmp/buildscript
  131. sh /tmp/buildscript
  132. # MY X IS BORKED
  133. #${httpget} -source http://192.168.0.254/cgi-bin/getXF86.pl > /etc/X11/XF86Config
  134. #ln -s ../../usr/X11R6/bin/XFree86 /etc/X11/X
  135. # Allows for easy RH035 setup. 7-Oct-2005 jsk
  136. if
  137.         grep -qv 'without-x' /proc/cmdline
  138. then
  139.         perl -pi -e 's,id:3:initdefault,id:5:initdefault,' /etc/inittab
  140.         system-config-display --noui --set-resolution=1280x1024
  141. fi
  142. # Configure as NTP client of server1
  143. cat > /etc/ntp.conf <<END
  144. restrict default ignore
  145. restrict 127.0.0.1
  146. restrict 192.168.0.254
  147. server 192.168.0.254
  148. driftfile /var/lib/ntp/drift
  149. broadcastdelay 0.008

  150. END
  151. echo "192.168.0.254" >> /etc/ntp/step-tickers
  152. chkconfig ntpd on
  153. perl -i -pe 's,via,vesa,'  /etc/X11/xorg.conf

  154. ###
  155. ###   3.1 Ntp/X End
  156. ###   3.2 Lang/Network Begin
  157. ###

  158. cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
  159. DEVICE=eth0
  160. BOOTPROTO=none
  161. ONBOOT=yes
  162. NETMASK=255.255.255.0
  163. IPADDR=XXX
  164. GATEWAY=192.168.0.254
  165. TYPE=Ethernet
  166. USERCTL=no
  167. IPV6INIT=no
  168. PEERDNS=yes
  169. EOF
  170. # VMware Network
  171. cat > /etc/ifcfg-eth0.bak << EOF
  172. DEVICE=eth0
  173. BOOTPROTO=none
  174. ONBOOT=yes
  175. NETMASK=255.255.255.0
  176. IPADDR=XXX
  177. GATEWAY=192.168.0.254
  178. TYPE=Ethernet
  179. USERCTL=no
  180. IPV6INIT=no
  181. PEERDNS=yes
  182. EOF
  183. # IP
  184. v_botang_ip=`ifconfig  eth0 | head -n 2 | tail -n 1 | cut -d ':' -f 2 | cut -d ' ' -f 1`
  185. perl -pi -e "s,XXX,$v_botang_ip," /etc/sysconfig/network-scripts/ifcfg-eth0
  186. perl -pi -e "s,XXX,$v_botang_ip," /etc/ifcfg-eth0.bak
  187. echo "99 0 eth0backup mv -f /etc/ifcfg-eth0.bak     /etc/sysconfig/network-scripts/ifcfg-eth0" >> /etc/anacrontab

  188. ###
  189. ###   3.2 Lang/Network End
  190. ###   3.3 User Begin
  191. ###

  192. # These accounts should be consolidated
  193. useradd student -u 600
  194. echo "student" | passwd --stdin student
  195. useradd visitor -u 601
  196. echo "password" | passwd --stdin visitor

  197. ###
  198. ###   3.3 User End
  199. ###   3.4 Lesson Begin
  200. ##    3.4.1 Tgz Begin
  201. ##

  202. wget -P / -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/upload.tgz
  203. tar -C / -zxvf /upload.tgz
  204. rm -f /upload.tgz
  205. wget -P /usr/sbin -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/botang-start-lesson

  206. ##
  207. ##    3.4.1 Tgz End
  208. ##    3.4.2 Usbstorage/X Begin
  209. ##

  210. find /lib/modules -name "usb-storage.ko" -exec rm -rf {} \;
  211. echo "99 3 usbmodule find /lib/modules -name usb-storage.ko -exec rm -rf {} \;" >> /etc/anacrontab
  212. chkconfig anacron on

  213. grep -v '"DontZap" "off"' /etc/X11/xorg.conf > /etc/X11/xorg.conf.no
  214. grep -v '"DontVTSwitch" "off"' /etc/X11/xorg.conf.no > /etc/X11/xorg.conf.no2
  215. grep -v '"DontZoom" "off"' /etc/X11/xorg.conf.no2 > /etc/X11/xorg.conf.no3
  216. grep -v '"HandleSpecialKeys" "Always"' /etc/X11/xorg.conf.no3 > /etc/X11/xorg.conf.no4
  217. grep -v '"HandleSpecialKeys" "WhenNeeded"' /etc/X11/xorg.conf.no4 > /etc/X11/xorg.conf.no5
  218. rm -f /etc/X11/xorg.conf
  219. mv /etc/X11/xorg.conf.no5 /etc/X11/xorg.conf

  220. grep '"DontZap" "on"' /etc/X11/xorg.conf > /dev/null
  221. v_1=$?
  222. grep '"DontVTSwitch" "on"' /etc/X11/xorg.conf > /dev/null
  223. v_2=$?
  224. grep '"DontZoom" "on"' /etc/X11/xorg.conf > /dev/null
  225. v_3=$?
  226. grep '"HandleSpecialKeys" "Never"' /etc/X11/xorg.conf > /dev/null
  227. v_4=$?


  228. if [ $v_1$v_2$v_3$v_4 != "0000" ]
  229. then
  230. echo "Section "ServerFlags""  >> /etc/X11/xorg.conf
  231. echo "Option "DontZap" "on"" >> /etc/X11/xorg.conf
  232. echo "Option "DontVTSwitch" "on"" >> /etc/X11/xorg.conf
  233. echo "Option "DontZoom" "on"" >> /etc/X11/xorg.conf
  234. echo "Option "HandleSpecialKeys" "Never"" >> /etc/X11/xorg.conf
  235. echo "EndSection" >> /etc/X11/xorg.conf
  236. fi

  237. ##    3.4.2 Usbstorage/X End
  238. ###   3.5 Others Begin
  239. ###

  240. # Turn on updatedb
  241. perl -pi -e 's,DAILY_UPDATE=no,DAILY_UPDATE=yes,g' /etc/updatedb.conf
  242. # Why not handle leases right now, if requested?
  243. #eval $(cat /proc/cmdline | awk '{print $NF}')
  244. #case $s in
  245. #        [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
  246. #[1-3])
  247. #                ${httpget} -source http://192.168.0.254/leaser > leaser
  248. #                egrep -v "ifup|ifdown|killall" leaser > newleaser
  249. #                chmod a+x newleaser
  250. #                ./newleaser $s
  251. #                rm -f leaser newleaser
  252. #        ;;
  253. #        *)
  254. #                touch /tmp/.leaser_failed
  255. #        ;;
  256. #esac

  257. # Chuck's fix for the balky USB ports - 7-Oct-2005 jsk
  258. #for FILE in $(ls /boot/initrd*); do
  259. #        VERSION=$(basename ${FILE} | sed 's,initrd-,,g;s,.img,,g')
  260. #        echo $VERSION
  261. #        mkinitrd -f --preload="ehci-hcd uhci-hcd" ${FILE} ${VERSION}
  262. #done
  263. cp -rp /etc/yum.repos.d /etc/yum.repos.d.ori
  264. rm -rf /etc/yum.repos.d/*

  265. cat >> /etc/yum.repos.d/base.repo <<EOF
  266. [base]
  267. name=RHEL base
  268. baseurl=ftp://192.168.0.254/pub/Server
  269. gpgcheck=0
  270. EOF

  271. # ZB: Replace with wget of file?  Seems like a better solution in the long run.
  272. #wget -q ftp://server1/pub/gls/server1.repo -O /etc/yum.repos.d/server1.repo

  273. # Install the pub keys
  274. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-* 2>/dev/null
  275. yum -y groupinstall "chinese support"
  276. yum -y install "*chinese*"
  277. chkconfig NetworkManager off

  278. yum -y groupinstall "Development tools"
  279. yum -y install libaio
  280. yum -y install libaio-devel

  281. yum -y groupinstall "Development tools"
  282. yum -y install libaio
  283. yum -y install libaio-devel

  284. yum -y groupinstall "Development tools"
  285. yum -y install libaio
  286. yum -y install libaio-devel

  287. yum -y install unixODBC
  288. yum -y install unixODBC-devel

  289. yum -y install unixODBC
  290. yum -y install unixODBC-devel

  291. yum -y install unixODBC
  292. yum -y install unixODBC-devel

  293. yum -y install oracleasm\*
  294. yum -y install oracleasm\*
  295. yum -y install oracleasm\*

  296. yum -y install openmotif\*
  297. yum -y install ksh\*
  298. yum -y install sysstat\*
  299. yum -y install compat\*
  300. yum -y install nfs-utils

  301. yum -y install openmotif\*
  302. yum -y install ksh\*
  303. yum -y install sysstat\*
  304. yum -y install compat\*
  305. yum -y install nfs-utils

  306. yum -y install openmotif\*
  307. yum -y install ksh\*
  308. yum -y install sysstat\*
  309. yum -y install compat\*
  310. yum -y install nfs-utils

  311. yum -y install "glibc-devel.i386"
  312. yum -y install "glibc-devel.i386"
  313. yum -y install "glibc-devel.i386"
  314. ###
  315. ###   3.5 Others End
  316. ###   3.6 Network Requirement Begin
  317. ##    3.6.1 Eth0 Begin
  318. ##

  319. ##    3.6.2 Eth1 End
  320. ###   3.6 Network Requirement End
  321. ###   3.7 Oracle Begin
  322. ##    3.7.1 User Begin
  323. ##

  324. echo "oracle" | passwd --stdin root
  325. # oracle
  326. groupadd oinstall
  327. groupadd dba
  328. groupadd oper
  329. # grid
  330. groupadd asmadmin
  331. groupadd asmdba
  332. groupadd asmoper
  333. # oracle
  334. useradd -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -d /home/oracle   oracle
  335. echo "oracle" | passwd --stdin oracle
  336. echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
  337. echo '# export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bash_profile
  338. echo "# export ORACLE_SID=orcl"  >> /home/oracle/.bash_profile
  339. echo '# export TNS_ADMIN=/u01/app/oracle/product/11.2.0/grid/network/admin'  >> /home/oracle/.bash_profile
  340. echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
  341. echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile
  342. echo "export EDITOR=vi" >> /home/oracle/.bash_profile
  343. echo '# export PATH=$ORACLE_HOME/bin:$PATH:/u01/app/oracle/product/11.2.0/grid/bin' >> /home/oracle/.bash_profile
  344. echo "export LANG=en_US" >> /home/oracle/.bash_profile

  345. mkdir -p /u01/app/oracle
  346. chown oracle:oinstall /u01/app
  347. chown oracle:oinstall /u01/app/oracle

  348. cat > /etc/sudoers <<EOF
  349. Runas_Alias     SUSER = root
  350. User_Alias      ORA = oracle

  351. root    ALL=(ALL) ALL
  352. ORA     ALL=(SUSER)     NOPASSWD: ALL
  353. EOF

  354. yum -y install tigervnc-server.x86_64
  355. sleep 3
  356. yum -y install tigervnc-server.x86_64
  357. sleep 3
  358. yum -y install tigervnc-server.x86_64

  359. mkdir /home/oracle/.vnc/
  360. cat > /home/oracle/.vnc/xstartup <<EOF
  361. #!/bin/sh

  362. [ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
  363. export LANG
  364. export SYSFONT
  365. vncconfig -iconic &
  366. unset SESSION_MANAGER
  367. unset DBUS_SESSION_BUS_ADDRESS
  368. OS=`uname -s`
  369. if [ $OS = 'Linux' ]; then
  370.   case "$WINDOWMANAGER" in
  371.     *gnome*)
  372.       if [ -e /etc/SuSE-release ]; then
  373.         PATH=$PATH:/opt/gnome/bin
  374.         export PATH
  375.       fi
  376.       ;;
  377.   esac
  378. fi
  379. if [ -x /etc/X11/xinit/xinitrc ]; then
  380.   exec /etc/X11/xinit/xinitrc
  381. fi
  382. if [ -f /etc/X11/xinit/xinitrc ]; then
  383.   exec sh /etc/X11/xinit/xinitrc
  384. fi
  385. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  386. xsetroot -solid grey
  387. xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
  388. gnome-session &
  389. EOF

  390. echo 'VNCSERVERS="2:oracle"' > /etc/sysconfig/vncservers
  391. echo 'VNCSERVERARGS[2]="-geometry 1024x768"' >> /etc/sysconfig/vncservers
  392. wget -P /home/oracle/.vnc -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/RAC/passwd
  393. chmod 700 /home/oracle/.vnc/passwd
  394. chown -R oracle:oinstall /home/oracle/.vnc
  395. chmod +x /home/oracle/.vnc/xstartup
  396. chkconfig vncserver on

  397. ##
  398. ##    3.7.1 User End
  399. ##    3.7.2 Os Software Patch Begin
  400. ##

  401. # Patch All Linux eg. Display Card
  402. mkdir -p /stage/OSPATCHS/alllinux/
  403. wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/n.run
  404. wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/a.run
  405. wget -P /usr/lib/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/libXm.so.2
  406. chmod +x /stage/OSPATCHS/alllinux/n.run
  407. chmod +x /stage/OSPATCHS/alllinux/a.run

  408. ##
  409. ##    3.7.2 Os Software Patch End
  410. ##    3.7.3 Os Script Patch Begin
  411. ##


  412. sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
  413. echo "Red Hat Enterprise Linux Server release 4 (Tikanga)" > /etc/redhat-release
  414. # Oracle2
  415. echo "fs.file-max = 6815744" >> /etc/sysctl.conf
  416. echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
  417. echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
  418. echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
  419. echo "net.core.rmem_default=4194304" >> /etc/sysctl.conf
  420. echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf
  421. echo "net.core.wmem_default=1048576" >> /etc/sysctl.conf
  422. echo "net.core.wmem_max=1048576" >> /etc/sysctl.conf
  423. echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
  424. echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
  425. # Oracle3
  426. echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
  427. # Oracle4
  428. echo "grid soft nproc 2047" >>/etc/security/limits.conf
  429. echo "grid hard nproc 16384" >>/etc/security/limits.conf
  430. echo "grid soft nofile 1024" >>/etc/security/limits.conf
  431. echo "grid hard nofile 65536" >>/etc/security/limits.conf
  432. echo "oracle soft nproc 2047" >>/etc/security/limits.conf
  433. echo "oracle hard nproc 16384" >>/etc/security/limits.conf
  434. echo "oracle soft nofile 1024" >>/etc/security/limits.conf
  435. echo "oracle hard nofile 65536" >>/etc/security/limits.conf
  436. # Oracle5
  437. echo 'if [ $USER = "oracle" ] || [ $USER = "grid" ] ; then' >>  /etc/profile
  438. echo ' if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
  439. echo '  ulimit -p 16384' >> /etc/profile
  440. echo '  ulimit -n 65536' >> /etc/profile
  441. echo ' else' >> /etc/profile
  442. echo '  ulimit -u 16384 -n 65536' >> /etc/profile
  443. echo ' fi' >> /etc/profile
  444. echo 'fi' >> /etc/profile

  445. ##
  446. ##    3.7.3 Os Script Patch End
  447. ##    3.7.4 Database Begin
  448. ##

  449. 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
  450. rpm -ivh /stage/flashplayer-11.2.202.297-1.ram0.98.x86_64.rpm
  451. cp /usr/lib/mozilla/plugins/libflashplayer.so  /usr/lib64/mozilla/plugins/
  452. # 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
  453. # rpm -ivh /stage/pdksh-5.2.14-36.el5.x86_64.rpm
  454. mkdir /stage/UEKKERNEL
  455. wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-[0-9]*
  456. wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-devel-[0-9]*
  457. wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/kernel-uek-firmware*
  458. wget -P /stage/UEKKERNEL/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/Packages/dtrace-modules-[0-9]*
  459. rpm -ivh --nodeps --force  /stage/UEKKERNEL/*
  460. 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
  461. rpm -ivh /stage/oracleasmlib-2.0.4-1.el6.x86_64.rpm
  462. 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
  463. rpm -ivh --force --nodeps /stage/kmod-oracleasm-2.0.8-13.el6_8.x86_64.rpm
  464. # UEK3 for ASMFD
  465. mkdir /stage/UEK3
  466. 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
  467. 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
  468. 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
  469. 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
  470. 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
  471. 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
  472. 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
  473. rpm -ivh --nodeps --force  /stage/UEK3/*
  474. sed -i 's/default=[0-9]/default=1/g' /boot/grub/grub.conf

  475. # Install Source
  476. 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
  477. unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_1of7.zip
  478. #mv /stage/database /stage/Disk1
  479. rm -f /stage/p13390677_112040_Linux-x86-64_1of7.zip

  480. 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_2of7.zip
  481. unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_2of7.zip
  482. #mv /stage/database /stage/Disk1
  483. rm -f /stage/p13390677_112040_Linux-x86-64_2of7.zip

  484. 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_3of7.zip
  485. unzip -d /stage  /stage/p13390677_112040_Linux-x86-64_3of7.zip
  486. #mv /stage/database /stage/Disk1
  487. rm -f /stage/p13390677_112040_Linux-x86-64_3of7.zip

  488. mkdir -p /stage/12c
  489. 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
  490. unzip -d /stage/12c  /stage/12c/V46095-01_1of2.zip
  491. rm -f /stage/12c/V46095-01_1of2.zip

  492. wget -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
  493. unzip -d /stage/12c  /stage/12c/V46095-01_2of2.zip
  494. rm -f /stage/12c/V46095-01_2of2.zip

  495. wget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/INFRA/V46096-01_1of2.zip
  496. unzip -d /stage/12c  /stage/12c/V46096-01_1of2.zip
  497. rm -f /stage/12c/V46096-01_1of2.zip

  498. wget -P /stage/12c -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O12c_x8664/INFRA/V46096-01_2of2.zip
  499. unzip -d /stage/12c  /stage/12c/V46096-01_2of2.zip
  500. rm -f /stage/12c/V46096-01_2of2.zip

  501. chown -R oracle:oinstall /stage/

  502. cat > /usr/sbin/oracleasm.sh <<!
  503. if
  504.         grep -q hda /proc/partitions
  505. then
  506.         disktype=sda
  507. elif
  508.         grep -q vda /proc/partitions
  509. then
  510.         disktype=vda
  511. elif
  512.         grep -q xvda /proc/partitions
  513. then
  514.         disktype=xvda
  515. elif
  516.         grep -q sda /proc/partitions
  517. then
  518.         disktype=sda
  519. else
  520.         disktype=sda
  521. fi

  522. chkconfig oracleasm on
  523. oracleasm configure -i<<EOF
  524. oracle
  525. asmadmin
  526. y
  527. y
  528. EOF

  529. oracleasm init

  530. vd1=/dev/\${disktype}5
  531. vd2=/dev/\${disktype}6
  532. vd3=/dev/\${disktype}7
  533. vd4=/dev/\${disktype}8
  534. vd5=/dev/\${disktype}3

  535. oracleasm createdisk ASMDISK01 \$vd1
  536. oracleasm createdisk ASMDISK02 \$vd2
  537. oracleasm createdisk ASMDISK03 \$vd3
  538. oracleasm createdisk ASMDISK04 \$vd4
  539. oracleasm createdisk ASMDISK05 \$vd5
  540. !

  541. chmod +x /usr/sbin/oracleasm.sh

  542. echo "99 4 crs /usr/sbin/oracleasm.sh  >> /var/log/emca" >> /etc/anacrontab

  543. # Sqlplus Extent Script
  544. #wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/sqlplus_extentsetup3.0.tgz
  545. #tar -C  /stage -zxvf /stage/sqlplus_extentsetup3.0.tgz
  546. #rm -f /stage/sqlplus_extentsetup3.0.tgz
  547. #cd /stage/sqlplus_extentsetup3.0/
  548. #./setup.sh
  549. #cd -
  550. chkconfig oracle off

  551. mkdir -p /u01/data/backup
  552. chown -R oracle:oinstall /u01/data/

  553. ##
  554. ##    3.7.4 Database End
  555. ##    3.7.5 OU Begin
  556. ##


  557. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/create_t04209_uname.sql
  558. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/select_t04209_uname.sql
  559. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update_t04209_uname.sql
  560. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update2_t04209_uname.sql
  561. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/RMasmcmd.sh
  562. chown oracle:oinstall /home/oracle/*.sql
  563. chown oracle:oinstall /home/oracle/RMasmcmd.sh

  564. ##
  565. ##   3.7.5 OU End

  566. ###   3.7 Oracle End
  567. ###   3.9 Tape Begin
  568. ###

  569. yum -y install zlib-devel
  570. yum -y install mtx
  571. yum -y install mt-st
  572. yum -y install lsscsi
  573. yum -y install sg3_utils
  574. yum -y install ncompress

  575. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/mhvtl-2016-03-10.tgz
  576. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O12c_x8664/TAPE/V100647-01.zip
  577. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.txt
  578. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.sh
  579. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/reuseosb.sh
  580. 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
  581. rpm -Uvh /stage/lzo-2.04-3.4.x86_64.rpm
  582. 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
  583. rpm -Uvh /stage/lzo-devel-2.04-3.4.x86_64.rpm
  584. 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
  585. rpm -Uvh /stage/libdtrace-ctf-0.5.0-2.x86_64.rpm
  586. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/copytape-root.sh
  587. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/revertape-root.sh
  588. cd /stage
  589. tar zxvf mhvtl-2016-03-10.tgz
  590. rm -f /stage/mhvtl-2016-03-10.tgz
  591. cd /stage
  592. unzip V100647-01.zip
  593. rm -f /stage/V100647-01.zip
  594. cd /stage/mhvtl-1.5
  595. useradd vtl
  596. echo oracle | passwd --stdin vtl
  597. mkdir /opt/mhvtl
  598. mkdir /etc/mhvtl
  599. chown -R vtl:vtl /opt/mhvtl
  600. chown -R vtl:vtl /etc/mhvtl
  601. make distclean
  602. cd /stage/mhvtl-1.5/kernel
  603. make
  604. make install
  605. cd /stage/mhvtl-1.5/
  606. make
  607. make install
  608. service mhvtl start
  609. perl -i -pe 's,CAPACITY=500,CAPACITY=8000,' /etc/mhvtl/mhvtl.conf
  610. chkconfig mhvtl on
  611. service mhvtl stop
  612. service mhvtl start
  613. mkdir -p /usr/local/oracle/backup
  614. mkdir -p /data/backup
  615. chown oracle:oinstall /data/backup
  616. # sed -i.bak 's/192.168.0.254/127.0.0.1/g' /etc/resolv.conf

  617. ###
  618. ###   3.9 Tape End
  619. ###
  620. ###   3.11 Udev End
  621. ####  3 Post End
  622. ####
  623. ###   3.6 Grub Begin

  624. if grep '2.6.18' /boot/grub/grub.conf >/dev/null
  625. then
  626. A=`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`
  627. 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`
  628. C=vmlinuz-2.6.32-71.el6.i686
  629. D=initramfs-2.6.32-71.el6.i686.img
  630. else
  631. A=vmlinuz-2.6.18-164.el5PAE
  632. B=initrd-2.6.18-164.el5PAE.img
  633. C=`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`
  634. 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`
  635. fi

  636. # OCA/OCP
  637. echo "title /dev/sda1---> Oracle 11g OCA/OCP: Database Standalone Server (2.6.18-164.el5)" >> /boot/grub/grub.conf
  638. echo "root (hd0,0)" >> /boot/grub/grub.conf
  639. echo "kernel /$A ro root=/dev/O11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
  640. echo "initrd /$B" >> /boot/grub/grub.conf

  641. # Dataguard
  642. echo "title /dev/sda10---> Oracle 11g OCM: Dataguad Configuration (2.6.18-164.el5)" >> /boot/grub/grub.conf
  643. echo "root (hd0,9)" >> /boot/grub/grub.conf
  644. echo "kernel /$A ro root=/dev/DG11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
  645. echo "initrd /$B" >> /boot/grub/grub.conf

  646. # Grid Control
  647. echo "title /dev/sda10---> Oracle 11g OCM: Grid Control (2.6.18-164.el5)" >> /boot/grub/grub.conf
  648. echo "root (hd0,9)" >> /boot/grub/grub.conf
  649. echo "kernel /$A ro root=/dev/GC11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
  650. echo "initrd /$B" >> /boot/grub/grub.conf

  651. # New Feature
  652. echo "title /dev/sda10---> Oracle 11g OCM: New Feature (2.6.18-164.el5)" >> /boot/grub/grub.conf
  653. echo "root (hd0,9)" >> /boot/grub/grub.conf
  654. echo "kernel /$A ro root=/dev/NEW11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
  655. echo "initrd /$B" >> /boot/grub/grub.conf


  656. # RAC nodes
  657. echo "title /dev/sda10---> Oracle 11g OCM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
  658. echo "root (hd0,9)" >> /boot/grub/grub.conf
  659. echo "kernel /$A ro root=/dev/RAC11grhel5/root rhgb quiet" >>  /boot/grub/grub.conf
  660. echo "initrd /$B" >> /boot/grub/grub.conf

  661. # Shared Disk
  662. echo "title /dev/sda10---> Oracle 11g OCM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
  663. echo "root (hd0,9)" >> /boot/grub/grub.conf
  664. 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
  665. echo "initrd /$D" >> /boot/grub/grub.conf

  666. # OCM10g
  667. echo "title /dev/sda10---> Oracle 10g OCM PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
  668. echo "root (hd0,9)" >> /boot/grub/grub.conf
  669. echo "kernel /$A ro root=/dev/OCM10geven/root rhgb quiet" >>  /boot/grub/grub.conf
  670. echo "initrd /$B" >> /boot/grub/grub.conf

  671. echo "title /dev/sda10---> Oracle 10g OCM PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
  672. echo "root (hd0,9)" >> /boot/grub/grub.conf
  673. echo "kernel /$A ro root=/dev/OCM10godd/root rhgb quiet" >>  /boot/grub/grub.conf
  674. echo "initrd /$B" >> /boot/grub/grub.conf

  675. echo "title /dev/sda10---> Oracle 10g OCM PRACTICUM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
  676. echo "root (hd0,9)" >> /boot/grub/grub.conf
  677. echo "kernel /$A ro root=/dev/OCM10grac/root rhgb quiet" >>  /boot/grub/grub.conf
  678. echo "initrd /$B" >> /boot/grub/grub.conf

  679. echo "title /dev/sda10---> Oracle 10g OCM PRACTICUM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
  680. echo "root (hd0,9)" >> /boot/grub/grub.conf
  681. 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
  682. echo "initrd /$D" >> /boot/grub/grub.conf

  683. # OCM11g1days
  684. echo "title /dev/sda10---> Oracle 11g1days OCM UPDATE PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
  685. echo "root (hd0,9)" >> /boot/grub/grub.conf
  686. echo "kernel /$A ro root=/dev/OCM11g1dayseven/root rhgb quiet" >>  /boot/grub/grub.conf
  687. echo "initrd /$B" >> /boot/grub/grub.conf

  688. echo "title /dev/sda10---> Oracle 11g1days OCM UPDATE PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
  689. echo "root (hd0,9)" >> /boot/grub/grub.conf
  690. echo "kernel /$A ro root=/dev/OCM11g1daysodd/root rhgb quiet" >>  /boot/grub/grub.conf
  691. echo "initrd /$B" >> /boot/grub/grub.conf

  692. # OCM11g2days
  693. echo "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: Even (2.6.18-164.el5)" >> /boot/grub/grub.conf
  694. echo "root (hd0,9)" >> /boot/grub/grub.conf
  695. echo "kernel /$A ro root=/dev/OCM11g2dayseven/root rhgb quiet" >>  /boot/grub/grub.conf
  696. echo "initrd /$B" >> /boot/grub/grub.conf

  697. echo "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: Odd (2.6.18-164.el5)" >> /boot/grub/grub.conf
  698. echo "root (hd0,9)" >> /boot/grub/grub.conf
  699. echo "kernel /$A ro root=/dev/OCM11g2daysodd/root rhgb quiet" >>  /boot/grub/grub.conf
  700. echo "initrd /$B" >> /boot/grub/grub.conf

  701. echo "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: RAC Instance (2.6.18-164.el5)" >> /boot/grub/grub.conf
  702. echo "root (hd0,9)" >> /boot/grub/grub.conf
  703. echo "kernel /$A ro root=/dev/OCM11g2daysrac/root rhgb quiet" >>  /boot/grub/grub.conf
  704. echo "initrd /$B" >> /boot/grub/grub.conf

  705. echo "title /dev/sda10---> Oracle 11g2days OCM PRACTICUM: RAC Shareddisk iSCSI Device (2.6.32-71.el6)" >> /boot/grub/grub.conf
  706. echo "root (hd0,9)" >> /boot/grub/grub.conf
  707. 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
  708. echo "initrd /$D" >> /boot/grub/grub.conf

  709. perl -i -pe 's,timeout=,timeout=5000,' /boot/grub/grub.conf
  710. grep -v 'hiddenmenu' /boot/grub/grub.conf > /boot/grub/grub.conf2
  711. mv -f /boot/grub/grub.conf2 /boot/grub/grub.conf

  712. ###
  713. ###   3.6 Grub end
  714. %pre
  715. # Partition Total 19028M
  716. echo "Starting PRE" > /dev/tty2

  717. v_pci0=$(udevinfo -ap /sys/class/net/eth0 | grep 'ID==' | head -n 1)
  718. v_pci1=$(udevinfo -ap /sys/class/net/eth1 | grep 'ID==' | head -n 1)
  719. v_driver0=$(udevinfo -ap /sys/class/net/eth0 | grep 'DRIVER==' | head -n 1)
  720. v_driver1=$(udevinfo -ap /sys/class/net/eth1 | grep 'DRIVER==' | head -n 1)
  721. v_mac0=$(ifconfig eth0 | grep HWaddr | cut -d ' ' -f 11)
  722. v_mac1=$(ifconfig eth1 | grep HWaddr | cut -d ' ' -f 11)

  723. if [ ! -z $v_mac1 ]
  724. then
  725. cat >> /etc/udev/rules.d/60-net.rules <<EOF
  726. $v_driver0, $v_pci0, NAME="eth0"
  727. $v_driver1, $v_pci1, NAME="eth1"
  728. EOF
  729. fi

  730. v_ip_short=$(grep $v_mac0 /mnt/source/workstation.list | cut -d '-' -f 1)
  731. v_ip=192.168.0.$v_ip_short

  732. if [ ! -z $v_ip_short ]
  733. then
  734. ifconfig eth0 $v_ip
  735. hostname station$v_ip_short.example.com
  736. fi

  737. # CLASSROOM MACHINE(c) NEED A DISK OF: 90000M
  738. cat >>  /tmp/partitioning <<EOF
  739. clearpart --none
  740. part /boot  --size 300
  741. part swap --size 4096
  742. part pv.RAC12crhel601 --size 45800
  743. volgroup RAC12crhel6 pv.RAC12crhel601
  744. logvol /  --vgname=RAC12crhel6 --size=45700 --name=root
  745. part pv.O11grhel502 --size 7000
  746. part pv.O11grhel503 --size 7000
  747. part pv.O11grhel504 --size 7000
  748. part pv.O11grhel505 --size 7000
  749. part pv.O11grhel506 --size 10000
  750. EOF
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-23 17:57 , Processed in 0.057154 second(s), 25 queries .

快速回复 返回顶部 返回列表