|
本帖最后由 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用户执行:
3. 利用课程间隙,安装windows上的oracle 11gR2软件(仅安装软件,不建库)
4. 在windows上利用Net Manager配置网络的本地命名方式,并用PL/SQL Developer连接推完OCP机器
在PL/SQL Developer中执行(sys登录)
5. 介绍1Z0-052课程幻灯的第2章
6. 准备安装最后一台机器(catalog机器),为了演示从裸机开始安装,请预习以下的kickstart文件:
- #####
- ##### Name: workstationmain.cfg for rhel5
- ##### Type: Kickstart Configuration File
- ##### Depends on: parts of botang-config-push
- ##### Version: BCP-PARTS-TAG20101021-V9.21
- #####
- ##########################################################################
- #
- # 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 Main Begin
- ### 1.1 Text,Key,Keyboard,Lang,Net Begin
- ###
- text
- key --skip
- keyboard us
- lang en_US
- 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
- xconfig --resolution=1280x1024 --depth=16 --startxonboot
- #skipx
- rootpw redhat
- authconfig --useshadow --enablemd5
- firewall --disabled
- bootloader
- reboot
- ###
- ### 1.3 Timezone,X,passwd,security,bootloader End
- #### 1 Main End
- #### 2 Paclages Begin
- ####
- %packages
- @ GNOME Desktop Environment
- @ X Window System
- @ Printing Support
- # KDE is huge...install it if you wish
- #@ KDE
- @ Development Libraries
- @ Development Tools
- #@ 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
- ####
- #### 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
- if
- grep -qv 'without-x' /proc/cmdline
- then
- perl -pi -e 's,id:3:initdefault,id:5:initdefault,' /etc/inittab
- system-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.008
- END
- echo "192.168.0.254" >> /etc/ntp/step-tickers
- chkconfig ntpd on
- perl -i -pe 's,via,vesa,' /etc/X11/xorg.conf
- perl -i -pe 's,nv,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 on
- grep -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.conf
- grep '"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" ]
- then
- echo "Section "ServerFlags"" >> /etc/X11/xorg.conf
- echo "Option "DontZap" "on"" >> /etc/X11/xorg.conf
- echo "Option "DontVTSwitch" "on"" >> /etc/X11/xorg.conf
- echo "Option "DontZoom" "on"" >> /etc/X11/xorg.conf
- echo "Option "HandleSpecialKeys" "Never"" >> /etc/X11/xorg.conf
- echo "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
- [VT]
- name=RHEL VT
- baseurl=ftp://192.168.0.254/pub/VT
- 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 off
- yum -y groupinstall "Development tools"
- yum -y install libaio
- yum -y install libaio-devel
- yum -y groupinstall "Development tools"
- yum -y install libaio
- yum -y install libaio-devel
- yum -y groupinstall "Development tools"
- yum -y install libaio
- yum -y install libaio-devel
- yum -y install unixODBC
- yum -y install unixODBC-devel
- yum -y install unixODBC
- yum -y install unixODBC-devel
- yum -y install unixODBC
- yum -y install unixODBC-devel
- yum -y install oracleasm\*
- yum -y install oracleasm\*
- yum -y install oracleasm\*
- yum -y install openmotif22.i386
- yum -y install pdksh.i386
- yum -y install sysstat.i386
- yum -y install openmotif22.i386
- yum -y install pdksh.i386
- yum -y install sysstat.i386
- yum -y install openmotif22.i386
- yum -y install pdksh.i386
- yum -y install sysstat.i386
- ###
- ### 3.5 Others End
- ## 3.6.1 User Begin
- ##
- echo "oracle" | passwd --stdin root
- groupadd oinstall
- groupadd dba
- groupadd oper
- groupadd asmadmin
- groupadd asmdba
- groupadd asmoper
- 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 LD_LIBRARY_PATH=$ORACLE_HOME/lib' >> /home/oracle/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/X11R6/lib' >> /home/oracle/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386' >> /home/oracle/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386/server' >> /home/oracle/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/rdbms/lib' >> /home/oracle/.bash_profile
- echo 'export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib' >> /home/oracle/.bash_profile
- echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/rdbms/jlib' >> /home/oracle/.bash_profile
- echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/network/jlib' >> /home/oracle/.bash_profile
- echo 'export TNS_ADMIN=$ORACLE_HOME/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_profile
- mkdir -p /u01/app/oracle
- chown oracle:oinstall /u01/app
- chown oracle:oinstall /u01/app/oracle
- useradd -g oinstall -G dba -d /home/oradev oradev
- echo "oradev" | passwd --stdin oradev
- echo 'export ORACLE_BASE=/u01/app/oradev' >> /home/oradev/.bash_profile
- echo 'export ORACLE_HOME=$ORACLE_BASE/product/10.1.0.2.0/dev_1' >> /home/oradev/.bash_profile
- echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib' >> /home/oradev/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/X11R6/lib' >> /home/oradev/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386' >> /home/oradev/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdk/jre/lib/i386/server' >> /home/oradev/.bash_profile
- echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/rdbms/lib' >> /home/oradev/.bash_profile
- echo 'export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib' >> /home/oradev/.bash_profile
- echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/rdbms/jlib' >> /home/oradev/.bash_profile
- echo 'export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/network/jlib' >> /home/oradev/.bash_profile
- echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oradev/.bash_profile
- echo 'export ORACLE_TERM=xterm' >> /home/oradev/.bash_profile
- echo 'export EDITOR=vi' >> /home/oradev/.bash_profile
- echo 'export LANG=en_US' >> /home/oradev/.bash_profile
- echo 'export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/jdev/bin/:$ORACLE_HOME/j2ee/DevSuite/' >> /home/oradev/.bash_profile
- echo 'unset USERNAME' >> /home/oradev/.bash_profile
- echo 'export TEMP=/tmp' >> /home/oradev/.bash_profile
- echo 'export TMP=/tmp' >> /home/oradev/.bash_profile
- mkdir -p /u01/app/oradev
- chown oradev:oinstall /u01/app/oradev
- ##
- ## 3.6.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
- # Patch RHEL5
- mkdir -p /stage/OSPATCHS/rhel5/
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- rpm -ivh --force --nodeps /stage/OSPATCHS/rhel5/*.rpm
- mkdir -p /stage/OSPATCHS/all/
- 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
- rpm -ivh --force --nodeps /stage/OSPATCHS/all/*.rpm
- ##
- ## 3.7.2 Os Software Patch End
- ## 3.6.3 Os Script Patch Begin
- ##
- # Oracle1
- 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 "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" ]; 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.6.3 Os Script Patch End
- ## 3.6.4 Database Begin
- ##
- wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/ASMLIB/oracleasmlib-2.0.4-1.el5.i386.rpm
- rpm -ivh /stage/oracleasmlib-2.0.4-1.el5.i386.rpm
- # Install Source
- wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_1of2.zip
- unzip -d /stage /stage/linux_11gR2_database_1of2.zip
- #mv /stage/database /stage/Disk1
- rm -f /stage/linux_11gR2_database_1of2.zip
- wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_2of2.zip
- unzip -d /stage /stage/linux_11gR2_database_2of2.zip
- #mv /stage/database /stage/Disk1
- rm -f /stage/linux_11gR2_database_2of2.zip
- wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_grid.zip
- unzip -d /stage /stage/linux_11gR2_grid.zip
- #mv /stage/database /stage/Disk1
- rm -f /stage/linux_11gR2_grid.zip
- wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/CLIENT/V17488-01.zip
- unzip -d /stage /stage/V17488-01.zip
- #mv /stage/database /stage/Disk1
- rm -f /stage/V17488-01.zip
- chown -R oracle:oinstall /stage/
- # Installed Image Database
- wget -P /u01/app -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/issue.tgz
- tar -C /u01/app -zpxvf /u01/app/issue.tgz
- rm -f /u01/app/issue.tgz
- mkdir -p /data/backup
- if
- grep -q hda /proc/partitions
- then
- disktype=hda
- elif
- grep -q sda /proc/partitions
- then
- disktype=sda
- elif
- grep -q vda /proc/partitions
- then
- disktype=vda
- elif
- grep -q xvda /proc/partitions
- then
- disktype=xvda
- else
- disktype=sda
- fi
- chkconfig oracleasm on
- oracleasm configure -i<<EOF
- oracle
- dba
- y
- EOF
- oracleasm init
- 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 ' ')
- 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 ' ')
- 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 ' ')
- 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 ' ')
- 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 ' ')
- oracleasm createdisk disk1 $vd1
- oracleasm createdisk disk2 $vd2
- oracleasm createdisk disk3 $vd3
- oracleasm createdisk disk4 $vd4
- oracleasm createdisk disk5 $vd5
- oracleasm listdisks
- mkdir -p /u01/data/backup
- chown -R oracle:oinstall /u01/data/
- wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw10.img
- dd of=$vd1 if=/u01/data/backup/raw10.img bs=4M
- wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw11.img
- dd of=$vd2 if=/u01/data/backup/raw11.img bs=4M
- wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw12.img
- dd of=$vd3 if=/u01/data/backup/raw12.img bs=4M
- wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw13.img
- dd of=$vd4 if=/u01/data/backup/raw13.img bs=4M
- wget -P /u01/data/backup -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/raw14.img
- dd of=$vd5 if=/u01/data/backup/raw14.img bs=4M
- # Loop Devices
- mkdir -p /u01/loop/device
- chown -R oracle:oinstall /u01/loop
- dd if=/dev/zero of=/u01/loop/device/loop0.img bs=1M count=2750
- dd if=/dev/zero of=/u01/loop/device/loop1.img bs=1M count=2750
- dd if=/dev/zero of=/u01/loop/device/loop2.img bs=1M count=512
- dd if=/dev/zero of=/u01/loop/device/loop3.img bs=1M count=512
- dd if=/dev/zero of=/u01/loop/device/loop4.img bs=1M count=512
- echo "losetup /dev/loop0 /u01/loop/device/loop0.img" >>/etc/rc.d/rc.local
- echo "losetup /dev/loop1 /u01/loop/device/loop1.img" >>/etc/rc.d/rc.local
- echo "losetup /dev/loop2 /u01/loop/device/loop2.img" >>/etc/rc.d/rc.local
- echo "losetup /dev/loop3 /u01/loop/device/loop3.img" >>/etc/rc.d/rc.local
- echo "losetup /dev/loop4 /u01/loop/device/loop4.img" >>/etc/rc.d/rc.local
- # Installed Image Developping Suite
- wget -P /u01 -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O10g/IMAGES/issue-dev.tgz
- tar -C /u01/app -zpxvf /u01/issue-dev.tgz
- rm -f /u01/issue-dev.tgz
- # Service Script
- wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/service_oraclesetup2.0.tgz
- tar -C /stage -zxvf /stage/service_oraclesetup2.0.tgz
- rm -f /stage/service_oraclesetup2.0.tgz
- cd /stage/service_oraclesetup2.0/
- ./setup.sh
- cd -
- # 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 off
- # ROOTSH
- echo "rm -rf /etc/oracle" >> /usr/sbin/crs.sh
- echo "/u01/app/oracle/product/11.2.0/grid/root.sh <<- EOF" >> /usr/sbin/crs.sh
- echo >> /usr/sbin/crs.sh
- echo "y" >> /usr/sbin/crs.sh
- echo "y" >> /usr/sbin/crs.sh
- echo "y" >> /usr/sbin/crs.sh
- echo "EOF" >> /usr/sbin/crs.sh
- chmod +x /usr/sbin/crs.sh
- # ASM
- echo "export ORACLE_SID=+ASM" >> /usr/bin/asm.sh
- echo "export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid" >> /usr/bin/asm.sh
- echo "/u01/app/oracle/product/11.2.0/grid/bin/sqlplus /nolog <<- EOF" >> /usr/bin/asm.sh
- echo "conn / as sysasm" >> /usr/bin/asm.sh
- echo "alter system set asm_diskstring='/dev/oracleasm/disks/*';" >> /usr/bin/asm.sh
- echo "alter system set asm_diskgroups='DATA','FRA';" >> /usr/bin/asm.sh
- echo "alter diskgroup data mount;" >> /usr/bin/asm.sh
- echo "alter diskgroup fra mount;" >> /usr/bin/asm.sh
- echo "exit" >> /usr/bin/asm.sh
- echo "EOF" >> /usr/bin/asm.sh
- echo "*.asm_diskgroups='DATA', 'FRA'" > /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
- echo "*.asm_diskstring='/dev/oracleasm/disks/*'" > /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
- chown oracle:oinstall /u01/app/oracle/product/11.2.0/grid/dbs/init+ASM.ora
- chown oracle:oinstall /usr/bin/asm.sh
- chmod +x /usr/bin/asm.sh
- # EMCA1
- echo "/u01/app/oracle/product/11.2.0/grid/bin/srvctl add listener" >> /usr/bin/emca.sh
- echo "/u01/app/oracle/product/11.2.0/grid/bin/srvctl add asm" >> /usr/bin/emca.sh
- echo "/u01/app/oracle/product/11.2.0/grid/bin/crsctl start resource ora.asm" >> /usr/bin/emca.sh
- echo "/usr/bin/asm.sh" >> /usr/bin/emca.sh
- 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
- echo "/u01/app/oracle/product/11.2.0/grid/bin/crsctl start resource ora.orcl.db" >> /usr/bin/emca.sh
- 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
- 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
- chmod +x /usr/bin/emca.sh
- # Emca2
- # echo "0 1 oracle service oracle start" >> /etc/anacrontab
- echo "h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null" >> /etc/inittab
- # wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oracle.tgz
- # tar -C /etc/ -zxvf /etc/oracle.tgz
- # TNS Database
- rm -rf /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
- cat > /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora <<- EOF
- ORCL =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = orcl.example.com)
- )
- )
- EOF
- chown oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
- # TNS Developping Suite
- rm -rf /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora
- cat > /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora <<- EOF
- ORCL =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = orcl.example.com)
- )
- )
- EOF
- chown oradev:oinstall /u01/app/oradev/product/10.1.0.2.0/dev_1/network/admin/tnsnames.ora
- rm -rf /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
- cat > /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora <<- EOF
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = $v_botang_ip)(PORT = 1521))
- )
- )
- ADR_BASE_LISTENER = /u01/app/oracle
- ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
- EOF
- chown oracle:oinstall /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
- /u01/app/oracle/product/11.2.0/dbhome_1/root.sh <<- EOF
- y
- y
- y
- EOF
- wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oraInst.loc
- wget -P /etc -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/IMAGES/oratab
- echo "99 8 emca su - oracle -c /usr/bin/emca.sh >> /var/log/emca" >> /etc/anacrontab
- echo "99 4 crs /usr/sbin/crs.sh >> /var/log/emca" >> /etc/anacrontab
- # Root.sh
- ## 3.6.4 Database End
- ## 3.6.5 OU Begin
- ##
- # wget -P /home/oracle -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OUSCRIPTS/labs042.tgz
- # tar -C /home/oracle -zxvf /home/oracle/labs042.tgz
- # rm -rf /home/oracle/labs042.tgz
- chown oracle:oinstall /home/oracle
- 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
- rpm -ivh /stage/qscintilla-1.7.1-1.fc6.i386.rpm
- 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
- rpm -ivh --nodeps /stage/tora-1.3.23-1.el5.i386.rpm
- wget -P /usr/sbin -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/tora.sh
- chmod +x /usr/sbin/tora.sh
- wget -P /root -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/.torarc
- wget -P /home/oracle -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TORA/rhel5/.torarc
- wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/rhel5/stardict-2.4.4-1.i386.rpm
- rpm -ivh /stage/stardict-2.4.4-1.i386.rpm
- wget -P /usr/share -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/xmag.png
- mkdir /root/Desktop 2>/dev/null
- mkdir /home/oracle/Desktop 2>/dev/null
- wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Tora.desktop
- wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Tora.desktop
- wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Vnc.desktop
- wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/Vnc.desktop
- wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/gnome-terminal.desktop
- wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/gnome-terminal.desktop
- wget -P /root/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/star.desktop
- wget -P /home/oracle/Desktop -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/ICONS/star.desktop
- chown oracle:oinstall /home/oracle/Desktop/*
- 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
- chown oracle:oinstall /home/oracle/*.sql
- ##
- ## 3.6.5 OU End
- ### 3.6 Oracle End
- ### 3.7 Shareddisk Server Network Requirement Begin
- ###
- chkconfig NetworkManager off
- ###
- ### 3.7 Shareddisk Server Network Requirement End
- ### 3.8 Shareddisk Server Begin
- ## 3.8.1 Logical Volumn Begin
- ##
- ### 3.10 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 ncompress
- wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/mhvtl.tgz
- wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb-10.3.0.3.0_linux32.zip
- wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.txt
- wget -P /lib -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/ld-2.5.so
- 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/O10g/TAPE/lzo-2.02-2.el5.1.i386.rpm
- rpm -ivh /stage/lzo-2.02-2.el5.1.i386.rpm
- 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
- rpm -ivh /stage/lzo-devel-2.02-2.el5.1.i386.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.tgz
- rm -f /stage/mhvtl.tgz
- cd /stage
- unzip osb-10.3.0.3.0_linux32.zip
- rm -f /stage/osb-10.3.0.3.0_linux32.zip
- cd /stage/mhvtl-1.2
- 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.2/kernel
- make
- make install
- cd /stage/mhvtl-1.2/
- 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
- sed -i.bak 's/192.168.0.254/127.0.0.1/g' /etc/resolv.conf
- ###
- ### 3.9 Tape End
- rm -f /root/*.log
- rm -f /root/*.dbf
- rm -f /root/*.ctl
- reboot
- #### 3 Post End
- ####
- ### 3.6 Grub Begin
- if grep '2.6.18' /boot/grub/grub.conf >/dev/null
- then
- 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`
- 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.i686
- D=initramfs-2.6.32-71.el6.i686.img
- else
- A=vmlinuz-2.6.18-164.el5PAE
- B=initrd-2.6.18-164.el5PAE.img
- 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`
- 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.conf
- echo "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.conf
- echo "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.conf
- echo "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.conf
- echo "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.conf
- echo "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.conf
- echo "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.conf
- echo "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.conf
- perl -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/tty2
- if
- grep -q hda /proc/partitions
- then
- disktype=hda
- elif
- grep -q sda /proc/partitions
- then
- disktype=sda
- elif
- grep -q vda /proc/partitions
- then
- disktype=vda
- elif
- grep -q xvda /proc/partitions
- then
- disktype=xvda
- else
- disktype=sda
- fi
- cat >> /tmp/partitioning <<EOF
- clearpart --all
- # VIRTUAL MACHINE2(v2) NEED A DISK OF: 63G, AT LEASE 62G, SAME AS v1
- # /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
- # / at lease 11G
- # swap at lease 1G
- # 9 partitions: 1)4 +data 11G, 2) 1 +FRA 6G
- part /boot --size 100
- part swap --size 1024
- part pv.O11grhel501 --size 44984
- volgroup O11grhel5 pv.O11grhel501
- logvol / --vgname=O11grhel5 --size=10900 --name=root
- logvol /u01 --vgname=O11grhel5 --size=34000 --name=u01
- part pv.O11grhel502 --size 2750
- part pv.O11grhel503 --size 2750
- part pv.O11grhel504 --size 2750
- part pv.O11grhel505 --size 2750
- part pv.O11grhel506 --size 6000
- EOF
复制代码
生产环境中,如果是64环境需要以下compatible包:
7. 两次建库(模板和定制), 搞清楚create controlfile和create database的区别
- select open_mode from v$database;
- select * from v$database_incarnation;
- select d.RESETLOGS_CHANGE# ,
- d.CHECKPOINT_CHANGE#,
- d.CURRENT_SCN
- from v_$database d;
-
- select * from v$log;
-
- ----
-
- alter user dbsnmp identified by oracle_4U account unlock;
-
- alter user sysman identified by oracle_4U account unlock;
-
-
-
复制代码
|
|