Bo's Oracle Station

查看: 2348|回复: 0

课程第2/3/4/5/6次(2017-02-28星期二, 2017-03-04星期六上下午和2017-03-05星期日晚上和2017-03-06星期一)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-3-1 10:52:30 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2017-3-13 10:45 编辑

上完1Z0-052第2章:安装软件OUI
1Z0-051共12章(上完0章),1Z0-052共19章(上完1章),1Z0-053共21章(上完0章)
总共上完全部52章中的1章


课程中所作的事情:
1. 推完OCP机器
2. 验证OCP机器
以oracle用户执行:

  1. crs_stat -t
复制代码
  1. emctl status dbconsole
复制代码
3. 利用课程间隙,安装windows上的oracle 11gR2软件(仅安装软件,不建库)
4. 在windows上利用Net Manager配置网络的本地命名方式,并用PL/SQL Developer连接推完OCP机器
在PL/SQL Developer中执行(sys登录)
  1. select * from dba_users;
复制代码
5. 介绍1Z0-052课程幻灯的第2章

6. 准备安装最后一台机器(catalog机器),为了演示从裸机开始安装,请预习以下的kickstart文件:

  1. #####
  2. ##### Name: workstationmain.cfg for rhel5
  3. ##### Type: Kickstart Configuration File
  4. ##### Depends on: parts of botang-config-push
  5. ##### Version: BCP-PARTS-TAG20101021-V9.21
  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 Main Begin
  18. ### 1.1 Text,Key,Keyboard,Lang,Net Begin
  19. ###

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

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

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

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

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

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

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

  63. %packages
  64. @ GNOME Desktop Environment
  65. @ X Window System
  66. @ Printing Support
  67. # KDE is huge...install it if you wish
  68. #@ KDE
  69. @ Development Libraries
  70. @ Development Tools
  71. #@ Windows File Server
  72. #@ Web Server
  73. elinks
  74. openssh
  75. openssh-server
  76. openssh-clients
  77. vim-enhanced
  78. samba-common
  79. samba-client
  80. gimp
  81. gimp-data-extras
  82. enscript
  83. libcap
  84. ntp
  85. coreutils
  86. elfutils
  87. elfutils-libelf
  88. gimp-print-plugin
  89. gnome-icon-theme
  90. gstreamer
  91. gstreamer-tools
  92. libgnomeprint22
  93. libgnomeprintui22
  94. libgsf
  95. libIDL
  96. libraw1394
  97. nautilus-cd-burner
  98. openmotif
  99. pyorbit
  100. startup-notification
  101. ttmkfdir
  102. firefox
  103. mutt
  104. vnc

  105. ####
  106. #### 2 Packages End
  107. #### 3 Post Begin
  108. ####

  109. %post

  110. ###
  111. ### 3.1 Ntp/X Begin
  112. ###

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

  141. END
  142. echo "192.168.0.254" >> /etc/ntp/step-tickers
  143. chkconfig ntpd on
  144. perl -i -pe 's,via,vesa,' /etc/X11/xorg.conf
  145. perl -i -pe 's,nv,vesa,' /etc/X11/xorg.conf

  146. ###
  147. ### 3.1 Ntp/X End
  148. ### 3.2 Lang/Network Begin
  149. ###

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

  180. ###
  181. ### 3.2 Lang/Network End
  182. ### 3.3 User Begin
  183. ###

  184. # These accounts should be consolidated
  185. useradd student -u 600
  186. echo "student" | passwd --stdin student
  187. useradd visitor -u 601
  188. echo "password" | passwd --stdin visitor

  189. ###
  190. ### 3.3 User End
  191. ### 3.4 Lesson Begin
  192. ## 3.4.1 Tgz Begin
  193. ##

  194. wget -P / -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/upload.tgz
  195. tar -C / -zxvf /upload.tgz
  196. rm -f /upload.tgz
  197. wget -P /usr/sbin -c --tries=100 --wait=5 http://192.168.0.254/pub/lessonfiles/botang-start-lesson

  198. ##
  199. ## 3.4.1 Tgz End
  200. ## 3.4.2 Usbstorage/X Begin
  201. ##

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

  205. grep -v '"DontZap" "off"' /etc/X11/xorg.conf > /etc/X11/xorg.conf.no
  206. grep -v '"DontVTSwitch" "off"' /etc/X11/xorg.conf.no > /etc/X11/xorg.conf.no2
  207. grep -v '"DontZoom" "off"' /etc/X11/xorg.conf.no2 > /etc/X11/xorg.conf.no3
  208. grep -v '"HandleSpecialKeys" "Always"' /etc/X11/xorg.conf.no3 > /etc/X11/xorg.conf.no4
  209. grep -v '"HandleSpecialKeys" "WhenNeeded"' /etc/X11/xorg.conf.no4 > /etc/X11/xorg.conf.no5

  210. rm -f /etc/X11/xorg.conf
  211. mv /etc/X11/xorg.conf.no5 /etc/X11/xorg.conf

  212. grep '"DontZap" "on"' /etc/X11/xorg.conf > /dev/null
  213. v_1=$?
  214. grep '"DontVTSwitch" "on"' /etc/X11/xorg.conf > /dev/null
  215. v_2=$?
  216. grep '"DontZoom" "on"' /etc/X11/xorg.conf > /dev/null
  217. v_3=$?
  218. grep '"HandleSpecialKeys" "Never"' /etc/X11/xorg.conf > /dev/null
  219. v_4=$?


  220. if [ $v_1$v_2$v_3$v_4 != "0000" ]
  221. then
  222. echo "Section "ServerFlags"" >> /etc/X11/xorg.conf
  223. echo "Option "DontZap" "on"" >> /etc/X11/xorg.conf
  224. echo "Option "DontVTSwitch" "on"" >> /etc/X11/xorg.conf
  225. echo "Option "DontZoom" "on"" >> /etc/X11/xorg.conf
  226. echo "Option "HandleSpecialKeys" "Never"" >> /etc/X11/xorg.conf
  227. echo "EndSection" >> /etc/X11/xorg.conf
  228. fi

  229. ##
  230. ## 3.4.2 Usbstorage/X End
  231. ### 3.5 Others Begin
  232. ###

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

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

  258. cat >> /etc/yum.repos.d/base.repo << EOF
  259. [base]
  260. name=RHEL base
  261. baseurl=ftp://192.168.0.254/pub/Server
  262. gpgcheck=0
  263. [VT]
  264. name=RHEL VT
  265. baseurl=ftp://192.168.0.254/pub/VT
  266. gpgcheck=0
  267. EOF

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

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

  275. yum -y groupinstall "Development tools"
  276. yum -y install libaio
  277. yum -y install libaio-devel

  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 install unixODBC
  285. yum -y install unixODBC-devel

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

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

  290. yum -y install oracleasm\*
  291. yum -y install oracleasm\*
  292. yum -y install oracleasm\*

  293. yum -y install openmotif22.i386
  294. yum -y install pdksh.i386
  295. yum -y install sysstat.i386

  296. yum -y install openmotif22.i386
  297. yum -y install pdksh.i386
  298. yum -y install sysstat.i386

  299. yum -y install openmotif22.i386
  300. yum -y install pdksh.i386
  301. yum -y install sysstat.i386

  302. ###
  303. ### 3.5 Others End
  304. ## 3.6.1 User Begin
  305. ##

  306. echo "oracle" | passwd --stdin root
  307. groupadd oinstall
  308. groupadd dba
  309. groupadd oper
  310. groupadd asmadmin
  311. groupadd asmdba
  312. groupadd asmoper
  313. useradd -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -d /home/oracle oracle
  314. echo "oracle" | passwd --stdin oracle
  315. echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
  316. echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bash_profile
  317. echo "export ORACLE_SID=orcl" >> /home/oracle/.bash_profile
  318. echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib' >> /home/oracle/.bash_profile
  319. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/X11R6/lib' >> /home/oracle/.bash_profile
  320. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386' >> /home/oracle/.bash_profile
  321. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386/server' >> /home/oracle/.bash_profile
  322. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/rdbms/lib' >> /home/oracle/.bash_profile
  323. echo 'export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib' >> /home/oracle/.bash_profile
  324. echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/rdbms/jlib' >> /home/oracle/.bash_profile
  325. echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/network/jlib' >> /home/oracle/.bash_profile
  326. echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
  327. echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
  328. echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile
  329. echo "export EDITOR=vi" >> /home/oracle/.bash_profile
  330. echo 'export PATH=$ORACLE_HOME/bin:$PATH:/u01/app/oracle/product/11.2.0/grid/bin' >> /home/oracle/.bash_profile
  331. echo "export LANG=en_US" >> /home/oracle/.bash_profile

  332. mkdir -p /u01/app/oracle
  333. chown oracle:oinstall /u01/app
  334. chown oracle:oinstall /u01/app/oracle

  335. useradd -g oinstall -G dba -d /home/oradev oradev
  336. echo "oradev" | passwd --stdin oradev
  337. echo 'export ORACLE_BASE=/u01/app/oradev' >> /home/oradev/.bash_profile
  338. echo 'export ORACLE_HOME=$ORACLE_BASE/product/10.1.0.2.0/dev_1' >> /home/oradev/.bash_profile
  339. echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib' >> /home/oradev/.bash_profile
  340. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/X11R6/lib' >> /home/oradev/.bash_profile
  341. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386' >> /home/oradev/.bash_profile
  342. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386/server' >> /home/oradev/.bash_profile
  343. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/rdbms/lib' >> /home/oradev/.bash_profile
  344. echo 'export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib' >> /home/oradev/.bash_profile
  345. echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/rdbms/jlib' >> /home/oradev/.bash_profile
  346. echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/network/jlib' >> /home/oradev/.bash_profile
  347. echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oradev/.bash_profile
  348. echo 'export ORACLE_TERM=xterm' >> /home/oradev/.bash_profile
  349. echo 'export EDITOR=vi' >> /home/oradev/.bash_profile
  350. echo 'export LANG=en_US' >> /home/oradev/.bash_profile
  351. echo 'export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/jdev/bin/:$ORACLE_HOME/j2ee/DevSuite/' >> /home/oradev/.bash_profile
  352. echo 'unset USERNAME' >> /home/oradev/.bash_profile
  353. echo 'export TEMP=/tmp' >> /home/oradev/.bash_profile
  354. echo 'export TMP=/tmp' >> /home/oradev/.bash_profile

  355. mkdir -p /u01/app/oradev
  356. chown oradev:oinstall /u01/app/oradev

  357. ##
  358. ## 3.6.1 User End
  359. ## 3.7.2 Os Software Patch Begin
  360. ##

  361. # Patch All Linux eg. Display Card
  362. mkdir -p /stage/OSPATCHS/alllinux/
  363. wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/n.run
  364. wget -P /stage/OSPATCHS/alllinux/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/a.run
  365. wget -P /usr/lib/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/alllinux/libXm.so.2
  366. chmod +x /stage/OSPATCHS/alllinux/n.run
  367. chmod +x /stage/OSPATCHS/alllinux/a.run

  368. # Patch RHEL5
  369. mkdir -p /stage/OSPATCHS/rhel5/
  370. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-db-4.2.52-5.1.i386.rpm
  371. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-3.4.6-4.i386.rpm
  372. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-c++-3.4.6-4.i386.rpm
  373. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-g77-3.4.6-4.i386.rpm
  374. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-glibc-2.3.4-2.26.i386.rpm
  375. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-glibc-headers-2.3.4-2.26.i386.rpm
  376. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libf2c-34-3.4.6-4.i386.rpm
  377. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libgcc-296-2.96-138.i386.rpm
  378. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libstdc++-296-2.96-138.i386.rpm
  379. wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libstdc++-33-3.2.3-61.i386.rpm
  380. rpm -ivh --force --nodeps /stage/OSPATCHS/rhel5/*.rpm
  381. mkdir -p /stage/OSPATCHS/all/
  382. wget -P /stage/OSPATCHS/all/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O11g/OSPATCHS/all/flashplayer-11.2.202.297-1.ram0.98.i686.rpm
  383. rpm -ivh --force --nodeps /stage/OSPATCHS/all/*.rpm

  384. ##
  385. ## 3.7.2 Os Software Patch End
  386. ## 3.6.3 Os Script Patch Begin
  387. ##

  388. # Oracle1
  389. sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
  390. echo "Red Hat Enterprise Linux Server release 4 (Tikanga)" > /etc/redhat-release
  391. # Oracle2
  392. echo "fs.file-max = 6815744" >> /etc/sysctl.conf
  393. echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
  394. echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
  395. echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
  396. echo "net.core.rmem_default=4194304" >> /etc/sysctl.conf
  397. echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf
  398. echo "net.core.wmem_default=1048576" >> /etc/sysctl.conf
  399. echo "net.core.wmem_max=1048576" >> /etc/sysctl.conf
  400. echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
  401. echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
  402. # Oracle3
  403. echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
  404. # Oracle4
  405. echo "oracle soft nproc 2047" >>/etc/security/limits.conf
  406. echo "oracle hard nproc 16384" >>/etc/security/limits.conf
  407. echo "oracle soft nofile 1024" >>/etc/security/limits.conf
  408. echo "oracle hard nofile 65536" >>/etc/security/limits.conf
  409. # Oracle5
  410. echo 'if [ $USER = "oracle" ]; then' >> /etc/profile
  411. echo ' if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
  412. echo ' ulimit -p 16384' >> /etc/profile
  413. echo ' ulimit -n 65536' >> /etc/profile
  414. echo ' else' >> /etc/profile
  415. echo ' ulimit -u 16384 -n 65536' >> /etc/profile
  416. echo ' fi' >> /etc/profile
  417. echo 'fi' >> /etc/profile

  418. ##
  419. ## 3.6.3 Os Script Patch End
  420. ## 3.6.4 Database Begin
  421. ##

  422. wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/ASMLIB/oracleasmlib-2.0.4-1.el5.i386.rpm
  423. rpm -ivh /stage/oracleasmlib-2.0.4-1.el5.i386.rpm
  424. # Install Source
  425. wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_1of2.zip
  426. unzip -d /stage /stage/linux_11gR2_database_1of2.zip
  427. #mv /stage/database /stage/Disk1
  428. rm -f /stage/linux_11gR2_database_1of2.zip

  429. wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_2of2.zip
  430. unzip -d /stage /stage/linux_11gR2_database_2of2.zip
  431. #mv /stage/database /stage/Disk1
  432. rm -f /stage/linux_11gR2_database_2of2.zip

  433. wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_grid.zip
  434. unzip -d /stage /stage/linux_11gR2_grid.zip
  435. #mv /stage/database /stage/Disk1
  436. rm -f /stage/linux_11gR2_grid.zip


  437. wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/CLIENT/V17488-01.zip
  438. unzip -d /stage /stage/V17488-01.zip
  439. #mv /stage/database /stage/Disk1
  440. rm -f /stage/V17488-01.zip

  441. chown -R oracle:oinstall /stage/

  442. # Installed Image Database
  443. wget -P /u01/app -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/issue.tgz
  444. tar -C /u01/app -zpxvf /u01/app/issue.tgz
  445. rm -f /u01/app/issue.tgz

  446. mkdir -p /data/backup
  447. if
  448. grep -q hda /proc/partitions
  449. then
  450. disktype=hda
  451. elif
  452. grep -q sda /proc/partitions
  453. then
  454. disktype=sda
  455. elif
  456. grep -q vda /proc/partitions
  457. then
  458. disktype=vda
  459. elif
  460. grep -q xvda /proc/partitions
  461. then
  462. disktype=xvda
  463. else
  464. disktype=sda
  465. fi

  466. chkconfig oracleasm on
  467. oracleasm configure -i<<EOF
  468. oracle
  469. dba
  470. y
  471. EOF

  472. oracleasm init

  473. vd1=$(fdisk -l | head -n $(fdisk -l | cut -c 38-43 | grep -n '\<6\>' | cut -f 1 -d :) | tail -n 1 | cut -f 1 -d ' ')
  474. vd2=$(fdisk -l | head -n $(fdisk -l | cut -c 38-43 | grep -n '\<2\>' | cut -f 1 -d : | head -n 1 | tail -n 1 ) | tail -n 1 | cut -f 1 -d ' ')
  475. vd3=$(fdisk -l | head -n $(fdisk -l | cut -c 38-43 | grep -n '\<2\>' | cut -f 1 -d : | head -n 2 | tail -n 1 ) | tail -n 1 | cut -f 1 -d ' ')
  476. vd4=$(fdisk -l | head -n $(fdisk -l | cut -c 38-43 | grep -n '\<2\>' | cut -f 1 -d : | head -n 3 | tail -n 1 ) | tail -n 1 | cut -f 1 -d ' ')
  477. vd5=$(fdisk -l | head -n $(fdisk -l | cut -c 38-43 | grep -n '\<2\>' | cut -f 1 -d : | head -n 4 | tail -n 1 ) | tail -n 1 | cut -f 1 -d ' ')

  478. oracleasm createdisk disk1 $vd1
  479. oracleasm createdisk disk2 $vd2
  480. oracleasm createdisk disk3 $vd3
  481. oracleasm createdisk disk4 $vd4
  482. oracleasm createdisk disk5 $vd5

  483. oracleasm listdisks

  484. mkdir -p /u01/data/backup
  485. chown -R oracle:oinstall /u01/data/

  486. wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw10.img
  487. dd of=$vd1 if=/u01/data/backup/raw10.img bs=4M
  488. wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw11.img
  489. dd of=$vd2 if=/u01/data/backup/raw11.img bs=4M
  490. wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw12.img
  491. dd of=$vd3 if=/u01/data/backup/raw12.img bs=4M
  492. wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw13.img
  493. dd of=$vd4 if=/u01/data/backup/raw13.img bs=4M
  494. wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw14.img
  495. dd of=$vd5 if=/u01/data/backup/raw14.img bs=4M

  496. # Loop Devices
  497. mkdir -p /u01/loop/device
  498. chown -R oracle:oinstall /u01/loop
  499. dd if=/dev/zero of=/u01/loop/device/loop0.img bs=1M count=2750
  500. dd if=/dev/zero of=/u01/loop/device/loop1.img bs=1M count=2750
  501. dd if=/dev/zero of=/u01/loop/device/loop2.img bs=1M count=512
  502. dd if=/dev/zero of=/u01/loop/device/loop3.img bs=1M count=512
  503. dd if=/dev/zero of=/u01/loop/device/loop4.img bs=1M count=512
  504. echo "losetup /dev/loop0 /u01/loop/device/loop0.img" >>/etc/rc.d/rc.local
  505. echo "losetup /dev/loop1 /u01/loop/device/loop1.img" >>/etc/rc.d/rc.local
  506. echo "losetup /dev/loop2 /u01/loop/device/loop2.img" >>/etc/rc.d/rc.local
  507. echo "losetup /dev/loop3 /u01/loop/device/loop3.img" >>/etc/rc.d/rc.local
  508. echo "losetup /dev/loop4 /u01/loop/device/loop4.img" >>/etc/rc.d/rc.local

  509. # Installed Image Developping Suite
  510. wget -P /u01 -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O10g/IMAGES/issue-dev.tgz
  511. tar -C /u01/app -zpxvf /u01/issue-dev.tgz
  512. rm -f /u01/issue-dev.tgz

  513. # Service Script
  514. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/service_oraclesetup2.0.tgz
  515. tar -C /stage -zxvf /stage/service_oraclesetup2.0.tgz
  516. rm -f /stage/service_oraclesetup2.0.tgz
  517. cd /stage/service_oraclesetup2.0/
  518. ./setup.sh
  519. cd -

  520. # Sqlplus Extent Script
  521. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/sqlplus_extentsetup3.0.tgz
  522. tar -C /stage -zxvf /stage/sqlplus_extentsetup3.0.tgz
  523. rm -f /stage/sqlplus_extentsetup3.0.tgz
  524. cd /stage/sqlplus_extentsetup3.0/
  525. ./setup.sh
  526. cd -
  527. chkconfig oracle off

  528. # ROOTSH
  529. echo "rm -rf /etc/oracle" >> /usr/sbin/crs.sh
  530. echo "/u01/app/oracle/product/11.2.0/grid/root.sh <<- EOF" >> /usr/sbin/crs.sh
  531. echo >> /usr/sbin/crs.sh
  532. echo "y" >> /usr/sbin/crs.sh
  533. echo "y" >> /usr/sbin/crs.sh
  534. echo "y" >> /usr/sbin/crs.sh
  535. echo "EOF" >> /usr/sbin/crs.sh
  536. chmod +x /usr/sbin/crs.sh
  537. # ASM
  538. echo "export ORACLE_SID=+ASM" >> /usr/bin/asm.sh
  539. echo "export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid" >> /usr/bin/asm.sh
  540. echo "/u01/app/oracle/product/11.2.0/grid/bin/sqlplus /nolog <<- EOF" >> /usr/bin/asm.sh
  541. echo "conn / as sysasm" >> /usr/bin/asm.sh
  542. echo "alter system set asm_diskstring='/dev/oracleasm/disks/*';" >> /usr/bin/asm.sh
  543. echo "alter system set asm_diskgroups='DATA','FRA';" >> /usr/bin/asm.sh
  544. echo "alter diskgroup data mount;" >> /usr/bin/asm.sh
  545. echo "alter diskgroup fra mount;" >> /usr/bin/asm.sh
  546. echo "exit" >> /usr/bin/asm.sh
  547. echo "EOF" >> /usr/bin/asm.sh
  548. echo "*.asm_diskgroups='DATA', 'FRA'" > /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
  549. echo "*.asm_diskstring='/dev/oracleasm/disks/*'" > /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
  550. chown oracle:oinstall /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
  551. chown oracle:oinstall /usr/bin/asm.sh
  552. chmod +x /usr/bin/asm.sh

  553. # EMCA1
  554. echo "/u01/app/oracle/product/11.2.0/grid/bin/srvctl add listener" >> /usr/bin/emca.sh
  555. echo "/u01/app/oracle/product/11.2.0/grid/bin/srvctl add asm" >> /usr/bin/emca.sh
  556. echo "/u01/app/oracle/product/11.2.0/grid/bin/crsctl start resource ora.asm" >> /usr/bin/emca.sh
  557. echo "/usr/bin/asm.sh" >> /usr/bin/emca.sh
  558. echo "/u01/app/oracle/product/11.2.0/grid/bin/srvctl add database -d orcl -o /u01/app/oracle/product/11.2.0/dbhome_1" >> /usr/bin/emca.sh
  559. echo "/u01/app/oracle/product/11.2.0/grid/bin/crsctl start resource ora.orcl.db" >> /usr/bin/emca.sh
  560. echo "emca -deconfig dbcontrol db -repos drop -silent -PORT 1521 -SID orcl -SYS_PWD oracle_4U -DBSNMP_PWD oracle_4U -SYSMAN_PWD oracle_4U" >> /usr/bin/emca.sh
  561. echo "emca -config dbcontrol db -repos recreate -silent -reconfig ports -DBCONTROL_HTTP_PORT 1158 -SID orcl -HOST $v_botang_ip -SYS_PWD oracle_4U -PORT 1521 -DBSNMP_PWD oracle_4U -SYSMAN_PWD oracle_4U -EMAIL_ADDRESS '' -MAIL_SERVER_NAME '' -ASM_USER_PWD oracle_4U" >> /usr/bin/emca.sh
  562. chmod +x /usr/bin/emca.sh

  563. # Emca2
  564. # echo "0 1 oracle service oracle start" >> /etc/anacrontab
  565. echo "h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null" >> /etc/inittab
  566. # wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oracle.tgz
  567. # tar -C /etc/ -zxvf /etc/oracle.tgz

  568. # TNS Database
  569. rm -rf /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
  570. cat > /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora <<- EOF
  571. ORCL =
  572. (DESCRIPTION =
  573. (ADDRESS_LIST =
  574. (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
  575. )
  576. (CONNECT_DATA =
  577. (SERVER = DEDICATED)
  578. (SERVICE_NAME = orcl.example.com)
  579. )
  580. )

  581. EOF
  582. chown oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

  583. # TNS Developping Suite
  584. rm -rf /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora
  585. cat > /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora <<- EOF
  586. ORCL =
  587. (DESCRIPTION =
  588. (ADDRESS_LIST =
  589. (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
  590. )
  591. (CONNECT_DATA =
  592. (SERVER = DEDICATED)
  593. (SERVICE_NAME = orcl.example.com)
  594. )
  595. )

  596. EOF
  597. chown oradev:oinstall /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora

  598. rm -rf /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
  599. cat > /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora <<- EOF
  600. LISTENER =
  601. (DESCRIPTION_LIST =
  602. (DESCRIPTION =
  603. (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  604. (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
  605. )
  606. )

  607. ADR_BASE_LISTENER = /u01/app/oracle

  608. ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
  609. EOF
  610. chown oracle:oinstall /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora

  611. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh <<- EOF

  612. y
  613. y
  614. y
  615. EOF
  616. wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oraInst.loc
  617. wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oratab
  618. echo "99 8 emca su - oracle -c /usr/bin/emca.sh >> /var/log/emca" >> /etc/anacrontab
  619. echo "99 4 crs /usr/sbin/crs.sh >> /var/log/emca" >> /etc/anacrontab

  620. # Root.sh
  621. ## 3.6.4 Database End
  622. ## 3.6.5 OU Begin
  623. ##

  624. # wget -P /home/oracle -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OUSCRIPTS/labs042.tgz
  625. # tar -C /home/oracle -zxvf /home/oracle/labs042.tgz
  626. # rm -rf /home/oracle/labs042.tgz
  627. chown oracle:oinstall /home/oracle

  628. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/qscintilla-1.7.1-1.fc6.i386.rpm
  629. rpm -ivh /stage/qscintilla-1.7.1-1.fc6.i386.rpm
  630. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/tora-1.3.23-1.el5.i386.rpm
  631. rpm -ivh --nodeps /stage/tora-1.3.23-1.el5.i386.rpm
  632. wget -P /usr/sbin -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/tora.sh
  633. chmod +x /usr/sbin/tora.sh
  634. wget -P /root -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/.torarc
  635. wget -P /home/oracle -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/.torarc
  636. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/rhel5/stardict-2.4.4-1.i386.rpm
  637. rpm -ivh /stage/stardict-2.4.4-1.i386.rpm

  638. wget -P /usr/share -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/xmag.png
  639. mkdir /root/Desktop 2>/dev/null
  640. mkdir /home/oracle/Desktop 2>/dev/null
  641. wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Tora.desktop
  642. wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Tora.desktop
  643. wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Vnc.desktop
  644. wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Vnc.desktop
  645. wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/gnome-terminal.desktop
  646. wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/gnome-terminal.desktop
  647. wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/star.desktop
  648. wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/star.desktop
  649. chown oracle:oinstall /home/oracle/Desktop/*


  650. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/create_t04209_uname.sql
  651. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/select_t04209_uname.sql
  652. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update_t04209_uname.sql
  653. wget -P /home/oracle/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/update2_t04209_uname.sql
  654. chown oracle:oinstall /home/oracle/*.sql

  655. ##
  656. ## 3.6.5 OU End

  657. ### 3.6 Oracle End
  658. ### 3.7 Shareddisk Server Network Requirement Begin
  659. ###

  660. chkconfig NetworkManager off

  661. ###
  662. ### 3.7 Shareddisk Server Network Requirement End
  663. ### 3.8 Shareddisk Server Begin
  664. ## 3.8.1 Logical Volumn Begin
  665. ##

  666. ### 3.10 Tape Begin
  667. ###

  668. yum -y install zlib-devel
  669. yum -y install mtx
  670. yum -y install mt-st
  671. yum -y install lsscsi
  672. yum -y install sg3_utils
  673. yum -y install ncompress

  674. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/mhvtl.tgz
  675. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb-10.3.0.3.0_linux32.zip
  676. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.txt
  677. wget -P /lib -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/ld-2.5.so
  678. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.sh
  679. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/reuseosb.sh
  680. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/lzo-2.02-2.el5.1.i386.rpm
  681. rpm -ivh /stage/lzo-2.02-2.el5.1.i386.rpm
  682. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/lzo-devel-2.02-2.el5.1.i386.rpm
  683. rpm -ivh /stage/lzo-devel-2.02-2.el5.1.i386.rpm
  684. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/copytape-root.sh
  685. wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/revertape-root.sh
  686. cd /stage
  687. tar zxvf mhvtl.tgz
  688. rm -f /stage/mhvtl.tgz
  689. cd /stage
  690. unzip osb-10.3.0.3.0_linux32.zip
  691. rm -f /stage/osb-10.3.0.3.0_linux32.zip
  692. cd /stage/mhvtl-1.2
  693. useradd vtl
  694. echo oracle | passwd --stdin vtl
  695. mkdir /opt/mhvtl
  696. mkdir /etc/mhvtl
  697. chown -R vtl:vtl /opt/mhvtl
  698. chown -R vtl:vtl /etc/mhvtl
  699. make distclean
  700. cd /stage/mhvtl-1.2/kernel
  701. make
  702. make install
  703. cd /stage/mhvtl-1.2/
  704. make
  705. make install
  706. service mhvtl start
  707. perl -i -pe 's,CAPACITY=500,CAPACITY=8000,' /etc/mhvtl/mhvtl.conf
  708. chkconfig mhvtl on
  709. service mhvtl stop
  710. service mhvtl start
  711. mkdir -p /usr/local/oracle/backup
  712. sed -i.bak 's/192.168.0.254/127.0.0.1/g' /etc/resolv.conf

  713. ###
  714. ### 3.9 Tape End

  715. rm -f /root/*.log
  716. rm -f /root/*.dbf
  717. rm -f /root/*.ctl
  718. reboot

  719. #### 3 Post End
  720. ####
  721. ### 3.6 Grub Begin

  722. if grep '2.6.18' /boot/grub/grub.conf >/dev/null
  723. then
  724. 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`
  725. 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`
  726. C=vmlinuz-2.6.32-71.el6.i686
  727. D=initramfs-2.6.32-71.el6.i686.img
  728. else
  729. A=vmlinuz-2.6.18-164.el5PAE
  730. B=initrd-2.6.18-164.el5PAE.img
  731. 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`
  732. 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`
  733. fi

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

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

  744. # Grid Control
  745. echo "title /dev/sda10---> Oracle 11g OCM: Grid Control (2.6.18-164.el5)" >> /boot/grub/grub.conf
  746. echo "root (hd0,9)" >> /boot/grub/grub.conf
  747. echo "kernel /$A ro root=/dev/GC11grhel5/root rhgb quiet" >> /boot/grub/grub.conf
  748. echo "initrd /$B" >> /boot/grub/grub.conf

  749. # New Feature
  750. echo "title /dev/sda10---> Oracle 11g OCM: New Feature (2.6.18-164.el5)" >> /boot/grub/grub.conf
  751. echo "root (hd0,9)" >> /boot/grub/grub.conf
  752. echo "kernel /$A ro root=/dev/NEW11grhel5/root rhgb quiet" >> /boot/grub/grub.conf
  753. echo "initrd /$B" >> /boot/grub/grub.conf


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

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

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

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

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

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

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

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

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

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

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

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

  807. perl -i -pe 's,timeout=,timeout=5000,' /boot/grub/grub.conf
  808. grep -v 'hiddenmenu' /boot/grub/grub.conf > /boot/grub/grub.conf2
  809. mv -f /boot/grub/grub.conf2 /boot/grub/grub.conf

  810. ###
  811. ### 3.6 Grub end
  812. %pre
  813. # Partition Total 19028M
  814. echo "Starting PRE" > /dev/tty2

  815. if
  816. grep -q hda /proc/partitions
  817. then
  818. disktype=hda
  819. elif
  820. grep -q sda /proc/partitions
  821. then
  822. disktype=sda
  823. elif
  824. grep -q vda /proc/partitions
  825. then
  826. disktype=vda
  827. elif
  828. grep -q xvda /proc/partitions
  829. then
  830. disktype=xvda
  831. else
  832. disktype=sda
  833. fi
  834. cat >> /tmp/partitioning <<EOF
  835. clearpart --all
  836. # VIRTUAL MACHINE2(v2) NEED A DISK OF: 63G, AT LEASE 62G, SAME AS v1
  837. # /u01 at lease 34G: 1)6.9G oracle database and grid, 2)1G oracle developping suite, 3)17.2G dd image, 4)7G loop device
  838. # / at lease 11G
  839. # swap at lease 1G
  840. # 9 partitions: 1)4 +data 11G, 2) 1 +FRA 6G
  841. part /boot --size 100
  842. part swap --size 1024
  843. part pv.O11grhel501 --size 44984
  844. volgroup O11grhel5 pv.O11grhel501
  845. logvol / --vgname=O11grhel5 --size=10900 --name=root
  846. logvol /u01 --vgname=O11grhel5 --size=34000 --name=u01
  847. part pv.O11grhel502 --size 2750
  848. part pv.O11grhel503 --size 2750
  849. part pv.O11grhel504 --size 2750
  850. part pv.O11grhel505 --size 2750
  851. part pv.O11grhel506 --size 6000
  852. EOF

复制代码

生产环境中,如果是64环境需要以下compatible包:
Install_Needed_Compatible_Package_.png


7. 两次建库(模板和定制), 搞清楚create controlfile和create database的区别

  1. select  open_mode from v$database;

  2. select  * from v$database_incarnation;

  3. select   d.RESETLOGS_CHANGE#  ,
  4.              d.CHECKPOINT_CHANGE#,
  5.              d.CURRENT_SCN
  6.    from v_$database d;
  7.    
  8.    select  * from v$log;
  9.    
  10.    ----
  11.    
  12.    alter user dbsnmp identified by oracle_4U account unlock;
  13.    
  14.    alter user sysman identified by oracle_4U account unlock;
  15.    
  16.    
  17.    
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 09:45 , Processed in 0.045233 second(s), 27 queries .

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