CENTOS 6.6 x64 自動化安裝Oracle Database 11g R2 RAC指令碼

flywiththewind發表於2015-10-21
<span style="font-size:14px;">os:centos 6.6</span><br /> <span style="font-size:14px;">hostname:rac11g03,rac11g04</span><br /> <span style="font-size:14px;">IP:&nbsp; rac11g03 192.108.56.103 192.108.96.103 192.108.26.103</span><br /> <span style="font-size:14px;">&nbsp;&nbsp;&nbsp;&nbsp; rac11g04 192.108.56.104 192.108.96.104 192.108.26.104</span><br /> <span style="font-size:14px;">oracle:11.2.0.4</span><br /> <span style="font-size:14px;">storage:openfiler 192.108.26.100:3260</span><br /> <br /> <span style="font-size:14px;"><strong>說明:</strong><br /> 1.centos 6.6已經做了basic安裝,ip和主機名已設定.</span><br /> <span style="font-size:14px;">2.oracle安裝檔案p13390677_112040_Linux-x86-64_1of7.zip,p13390677_112040_Linux-x86-64_2of7.zip,p13390677_112040_Linux-x86-64_3of7.zip放在rac11g03的/root下,pdksh-5.2.14-30.x86_64.rpm包放在rac11g03的/root下.</span><br /> <span style="font-size:14px;">3.密碼都用的selectshen,可根據自己的需要修改</span><br /> <span style="font-size:14px;">4.三個網段,192.108.56.0:public,192.108.96.0:private,192.108.26.0:storage</span><br /> <span style="font-size:14px;">5.以下指令碼可以在健壯性和通用性上做一些調整,以用來在開發測試環境中快速部署RAC.<br /> </span><br /> <span style="font-size:14px;"><strong>實施:</strong></span><br /> <span style="font-size:14px;"><strong>#################################步驟一#################################</strong></span><br /> <span style="font-size:14px;">###################rac11g04_init.sh,以下內容放到一個檔案中,在rac11g04下sh執行即可:</span><br /> <span style="font-size:14px;">#!/bin/bash</span><br /> <span style="font-size:14px;">##此處用於載入光碟機為之後安裝缺少的包,也可改為網路方式.</span><br /> <span style="font-size:14px;">mkdir /media/cdrom</span><br /> <span style="font-size:14px;">mount /dev/cdrom /media/cdrom</span><br /> <span style="font-size:14px;">mv /etc/yum.repos.d/*.repo /root/</span><br /> <br /> <span style="font-size:14px;">cat &gt; /etc/yum.repos.d/CentOS-Media.repo &lt;&lt; EOF</span><br /> <span style="font-size:14px;">[c6-media]</span><br /> <span style="font-size:14px;">name=CentOS-$releasever - Media</span><br /> <span style="font-size:14px;">baseurl=file:///media/cdrom/</span><br /> <span style="font-size:14px;">gpgcheck=1</span><br /> <span style="font-size:14px;">enabled=1</span><br /> <span style="font-size:14px;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">yum clean all</span><br /> <span style="font-size:14px;">yum makecache</span><br /> <br /> <span style="font-size:14px;">#調整hosts檔案</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/hosts &lt;&lt; EOF</span><br /> <span style="font-size:14px;">192.108.56.103&nbsp; rac11g03</span><br /> <span style="font-size:14px;">192.108.56.104&nbsp; rac11g04</span><br /> <span style="font-size:14px;">192.108.56.203&nbsp; rac11g03-vip</span><br /> <span style="font-size:14px;">192.108.56.204&nbsp; rac11g04-vip</span><br /> <span style="font-size:14px;">192.108.56.205&nbsp; rac11g-scan</span><br /> <span style="font-size:14px;">192.108.96.103&nbsp; rac11g03-priv</span><br /> <span style="font-size:14px;">192.108.96.104&nbsp; rac11g04-priv</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#關閉防火牆,selinux</span><br /> <span style="font-size:14px;">chkconfig iptables off</span><br /> <span style="font-size:14px;">service iptables stop</span><br /> <span style="font-size:14px;">setenforce 0</span><br /> <span style="font-size:14px;">sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config</span><br /> <br /> <span style="font-size:14px;">#網路引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</span><br /> <span style="font-size:14px;">kernel.shmmni = 4096</span><br /> <span style="font-size:14px;">kernel.sem = 250 32000 100 128</span><br /> <span style="font-size:14px;">fs.aio-max-nr = 1048576</span><br /> <span style="font-size:14px;">fs.file-max = 6815744</span><br /> <span style="font-size:14px;">net.ipv4.ip_local_port_range = 9000 65500</span><br /> <span style="font-size:14px;">net.core.rmem_default = 1048576</span><br /> <span style="font-size:14px;">net.core.rmem_max = 4194304</span><br /> <span style="font-size:14px;">net.core.wmem_default = 262144</span><br /> <span style="font-size:14px;">net.core.wmem_max = 1048576</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">sysctl -p</span><br /> <br /> <span style="font-size:14px;">#資源限制引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/security/limits.conf&nbsp; &lt;&lt; EOF</span><br /> <span style="font-size:14px;">oracle soft nproc 2047</span><br /> <span style="font-size:14px;">oracle hard nproc 16384</span><br /> <span style="font-size:14px;">oracle soft nofile 1024</span><br /> <span style="font-size:14px;">oracle hard nofile 65536</span><br /> <span style="font-size:14px;">grid soft nproc 2047</span><br /> <span style="font-size:14px;">grid hard nproc 16384</span><br /> <span style="font-size:14px;">grid soft nofile 1024</span><br /> <span style="font-size:14px;">grid hard nofile 65536</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#登陸引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</span><br /> <span style="font-size:14px;">session required /lib64/security/pam_limits.so</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#安裝缺少的包</span><br /> <span style="font-size:14px;">yum -y install&nbsp; gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC unixODBC-devel</span><br /> <br /> <span style="font-size:14px;">yum -y install expect</span><br /> <br /> <span style="font-size:14px;">ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1</span><br /> <br /> <span style="font-size:14px;">#清除NTP服務</span><br /> <span style="font-size:14px;">service ntpd stop</span><br /> <span style="font-size:14px;">chkconfig ntpd off</span><br /> <span style="font-size:14px;">mv /etc/ntp.conf /etc/ntp.conf.bak</span><br /> <span style="font-size:14px;">mv /var/run/ntpd.pid /var/run/ntpd.pid.bak</span><br /> <br /> <span style="font-size:14px;">##建立配置grid,oracle使用者</span><br /> <span style="font-size:14px;">groupadd -g 1000 oinstall</span><br /> <span style="font-size:14px;">groupadd -g 1100 asmadmin</span><br /> <span style="font-size:14px;">groupadd -g 1200 dba</span><br /> <span style="font-size:14px;">groupadd -g 1300 asmdba</span><br /> <span style="font-size:14px;">useradd -u 1100 -d /home/oracle -g oinstall -G dba,asmdba oracle</span><br /> <span style="font-size:14px;">useradd -u 1101 -d /home/grid -g oinstall -G asmadmin,asmdba grid</span><br /> <span style="font-size:14px;">echo "selectshen"|passwd --stdin oracle</span><br /> <span style="font-size:14px;">echo "selectshen"|passwd --stdin grid</span><br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /home/grid/.bash_profile &lt;&lt; EOF</span><br /> <span style="font-size:14px;">export TMP=/tmp</span><br /> <span style="font-size:14px;">export TMPDIR=$TMP</span><br /> <span style="font-size:14px;">export ORACLE_BASE=/u01/app/grid</span><br /> <span style="font-size:14px;">export ORACLE_HOME=/u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">export GRID_HOME=/u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">export ORACLE_SID=+ASM1</span><br /> <span style="font-size:14px;">export ORACLE_TERM=xterm</span><br /> <span style="font-size:14px;">export PATH=/usr/sbin:\$PATH</span><br /> <span style="font-size:14px;">export PATH=\$ORACLE_HOME/bin:\$PATH</span><br /> <span style="font-size:14px;">export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/</span><br /> <span style="font-size:14px;">export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib</span><br /> <span style="font-size:14px;">ulimit -u 16384 -n 65536</span><br /> <span style="font-size:14px;">umask 022</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">.&nbsp; /home/grid/.bash_profile</span><br /> <br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /home/oracle/.bash_profile &lt;&lt; EOF</span><br /> <span style="font-size:14px;">export TMP=/tmp</span><br /> <span style="font-size:14px;">export TMPDIR=$TMP</span><br /> <span style="font-size:14px;">export ORACLE_BASE=/u01/app/oracle</span><br /> <span style="font-size:14px;">export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1</span><br /> <span style="font-size:14px;">export ORACLE_SID=rac11g</span><br /> <span style="font-size:14px;">export ORACLE_TERM=xterm</span><br /> <span style="font-size:14px;">export PATH=/usr/sbin:\$PATH</span><br /> <span style="font-size:14px;">export PATH=\$ORACLE_HOME/bin:\$PATH</span><br /> <span style="font-size:14px;">export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/</span><br /> <span style="font-size:14px;">export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib</span><br /> <span style="font-size:14px;">ulimit -u 16384 -n 65536</span><br /> <span style="font-size:14px;">umask 022</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">.&nbsp; /home/oracle/.bash_profile</span><br /> <br /> <br /> <span style="font-size:14px;">#建立安裝目錄 </span><br /> <span style="font-size:14px;">mkdir -p /u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">chown -R grid.oinstall /u01</span><br /> <span style="font-size:14px;">mkdir -p /u01/app/oracle/product/11.2.0/db_1 </span><br /> <span style="font-size:14px;">chown -R oracle.oinstall&nbsp;&nbsp; /u01/app/oracle</span><br /> <span style="font-size:14px;">chmod -R 775 /u01</span><br /> <br /> <span style="font-size:14px;">#配置iscsi連線openfiler儲存,此處要根據實際情況設定,這裡是一個40G的盤,分成兩個20G的區</span><br /> <span style="font-size:14px;">yum -y install iscsi-initiator-utils</span><br /> <span style="font-size:14px;">iscsiadm -m discovery -t sendtargets -p 192.108.26.100:3260</span><br /> <span style="font-size:14px;">service iscsi restart</span><br /> <br /> <span style="font-size:14px;">fdisk /dev/sdb &lt;&lt;EOF</span><br /> <span style="font-size:14px;">n</span><br /> <span style="font-size:14px;">p</span><br /> <span style="font-size:14px;">1</span><br /> <br /> <span style="font-size:14px;">+20G</span><br /> <span style="font-size:14px;">n</span><br /> <span style="font-size:14px;">p</span><br /> <span style="font-size:14px;">2</span><br /> <br /> <br /> <span style="font-size:14px;">w</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /etc/udev/rules.d/60-raw.rules &lt;&lt; EOF</span><br /> <span style="font-size:14px;">ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"</span><br /> <span style="font-size:14px;">ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"</span><br /> <span style="font-size:14px;">ACTION=="add", KERNEL=="/dev/sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"</span><br /> <span style="font-size:14px;">ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="18",RUN+="/bin/raw /dev/raw/raw2 %M %m"</span><br /> <span style="font-size:14px;">KERNEL=="raw[1-2]", OWNER="grid", GROUP="oinstall", MODE="660"</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">start_udev</span><br /> <span style="font-size:14px;">ls /dev/raw/ -l</span><br /> <br /> <br /> <span style="font-size:14px;">#配置ssh,這裡使用expect來自動來響應輸入</span><br /> <span style="font-size:14px;">mkdir ~/.ssh</span><br /> <span style="font-size:14px;">chmod 700 ~/.ssh</span><br /> <span style="font-size:14px;">cat &gt; /root/tempexpect.sh &lt;&lt;EOF</span><br /> <span style="font-size:14px;">set timeout -1</span><br /> <span style="font-size:14px;">spawn ssh-keygen -t rsa</span><br /> <span style="font-size:14px;">expect "(/root/.ssh/id_rsa):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "(empty for no passphrase):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "again:"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">spawn ssh-keygen -t dsa</span><br /> <span style="font-size:14px;">expect "(/root/.ssh/id_dsa):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "(empty for no passphrase):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "again:"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">expect /root/tempexpect.sh</span><br /> <span style="font-size:14px;">cat /root/.ssh/id_rsa.pub &gt;&gt; /root/.ssh/authorized_keys</span><br /> <span style="font-size:14px;">cat /root/.ssh/id_dsa.pub &gt;&gt; /root/.ssh/authorized_keys</span><br /> <br /> <span style="font-size:14px;"><strong>#################################步驟二#################################</strong></span><br /> <span style="font-size:14px;">####################rac11g03_init.sh,<span style="font-size:14px;">以下內容放到一個檔案中,</span>在rac11g03下sh執行即可:</span><br /> <span style="font-size:14px;">#!/bin/bash</span><br /> <span style="font-size:14px;">##此處用於載入光碟機為之後安裝缺少的包,也可改為網路方式.</span><br /> <span style="font-size:14px;">mkdir /media/cdrom</span><br /> <span style="font-size:14px;">mount /dev/cdrom /media/cdrom</span><br /> <span style="font-size:14px;">mv /etc/yum.repos.d/*.repo /root/</span><br /> <br /> <span style="font-size:14px;">cat &gt; /etc/yum.repos.d/CentOS-Media.repo &lt;&lt; EOF</span><br /> <span style="font-size:14px;">[c6-media]</span><br /> <span style="font-size:14px;">name=CentOS-$releasever - Media</span><br /> <span style="font-size:14px;">baseurl=file:///media/cdrom/</span><br /> <span style="font-size:14px;">gpgcheck=1</span><br /> <span style="font-size:14px;">enabled=1</span><br /> <span style="font-size:14px;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">yum clean all</span><br /> <span style="font-size:14px;">yum makecache</span><br /> <br /> <span style="font-size:14px;">#調整hosts檔案</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/hosts &lt;&lt; EOF</span><br /> <span style="font-size:14px;">192.108.56.103&nbsp; rac11g03</span><br /> <span style="font-size:14px;">192.108.56.104&nbsp; rac11g04</span><br /> <span style="font-size:14px;">192.108.56.203&nbsp; rac11g03-vip</span><br /> <span style="font-size:14px;">192.108.56.204&nbsp; rac11g04-vip</span><br /> <span style="font-size:14px;">192.108.56.205&nbsp; rac11g-scan</span><br /> <span style="font-size:14px;">192.108.96.103&nbsp; rac11g03-priv</span><br /> <span style="font-size:14px;">192.108.96.104&nbsp; rac11g04-priv</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#關閉防火牆,selinux</span><br /> <span style="font-size:14px;">chkconfig iptables off</span><br /> <span style="font-size:14px;">service iptables stop</span><br /> <span style="font-size:14px;">setenforce 0</span><br /> <span style="font-size:14px;">sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config</span><br /> <br /> <span style="font-size:14px;">#網路引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</span><br /> <span style="font-size:14px;">kernel.shmmni = 4096</span><br /> <span style="font-size:14px;">kernel.sem = 250 32000 100 128</span><br /> <span style="font-size:14px;">fs.aio-max-nr = 1048576</span><br /> <span style="font-size:14px;">fs.file-max = 6815744</span><br /> <span style="font-size:14px;">net.ipv4.ip_local_port_range = 9000 65500</span><br /> <span style="font-size:14px;">net.core.rmem_default = 1048576</span><br /> <span style="font-size:14px;">net.core.rmem_max = 4194304</span><br /> <span style="font-size:14px;">net.core.wmem_default = 262144</span><br /> <span style="font-size:14px;">net.core.wmem_max = 1048576</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">sysctl -p</span><br /> <br /> <span style="font-size:14px;">#資源限制引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/security/limits.conf&nbsp; &lt;&lt; EOF</span><br /> <span style="font-size:14px;">oracle soft nproc 2047</span><br /> <span style="font-size:14px;">oracle hard nproc 16384</span><br /> <span style="font-size:14px;">oracle soft nofile 1024</span><br /> <span style="font-size:14px;">oracle hard nofile 65536</span><br /> <span style="font-size:14px;">grid soft nproc 2047</span><br /> <span style="font-size:14px;">grid hard nproc 16384</span><br /> <span style="font-size:14px;">grid soft nofile 1024</span><br /> <span style="font-size:14px;">grid hard nofile 65536</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#登陸引數調整</span><br /> <span style="font-size:14px;">cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</span><br /> <span style="font-size:14px;">session required /lib64/security/pam_limits.so</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#安裝缺少的包</span><br /> <span style="font-size:14px;">yum -y install&nbsp; gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC unixODBC-devel</span><br /> <br /> <span style="font-size:14px;">yum -y install expect</span><br /> <br /> <span style="font-size:14px;">ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1</span><br /> <br /> <span style="font-size:14px;">#清除NTP服務</span><br /> <span style="font-size:14px;">service ntpd stop</span><br /> <span style="font-size:14px;">chkconfig ntpd off</span><br /> <span style="font-size:14px;">mv /etc/ntp.conf /etc/ntp.conf.bak</span><br /> <span style="font-size:14px;">mv /var/run/ntpd.pid /var/run/ntpd.pid.bak</span><br /> <br /> <span style="font-size:14px;">##建立配置grid,oracle使用者</span><br /> <span style="font-size:14px;">groupadd -g 1000 oinstall</span><br /> <span style="font-size:14px;">groupadd -g 1100 asmadmin</span><br /> <span style="font-size:14px;">groupadd -g 1200 dba</span><br /> <span style="font-size:14px;">groupadd -g 1300 asmdba</span><br /> <span style="font-size:14px;">useradd -u 1100 -d /home/oracle -g oinstall -G dba,asmdba oracle</span><br /> <span style="font-size:14px;">useradd -u 1101 -d /home/grid -g oinstall -G asmadmin,asmdba grid</span><br /> <span style="font-size:14px;">echo "selectshen"|passwd --stdin oracle</span><br /> <span style="font-size:14px;">echo "selectshen"|passwd --stdin grid</span><br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /home/grid/.bash_profile &lt;&lt; EOF</span><br /> <span style="font-size:14px;">export TMP=/tmp</span><br /> <span style="font-size:14px;">export TMPDIR=$TMP</span><br /> <span style="font-size:14px;">export ORACLE_BASE=/u01/app/grid</span><br /> <span style="font-size:14px;">export ORACLE_HOME=/u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">export GRID_HOME=/u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">export ORACLE_SID=+ASM1</span><br /> <span style="font-size:14px;">export ORACLE_TERM=xterm</span><br /> <span style="font-size:14px;">export PATH=/usr/sbin:\$PATH</span><br /> <span style="font-size:14px;">export PATH=\$ORACLE_HOME/bin:\$PATH</span><br /> <span style="font-size:14px;">export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/</span><br /> <span style="font-size:14px;">export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib</span><br /> <span style="font-size:14px;">ulimit -u 16384 -n 65536</span><br /> <span style="font-size:14px;">umask 022</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">.&nbsp; /home/grid/.bash_profile</span><br /> <br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /home/oracle/.bash_profile &lt;&lt; EOF</span><br /> <span style="font-size:14px;">export TMP=/tmp</span><br /> <span style="font-size:14px;">export TMPDIR=$TMP</span><br /> <span style="font-size:14px;">export ORACLE_BASE=/u01/app/oracle</span><br /> <span style="font-size:14px;">export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1</span><br /> <span style="font-size:14px;">export ORACLE_SID=rac11g</span><br /> <span style="font-size:14px;">export ORACLE_TERM=xterm</span><br /> <span style="font-size:14px;">export PATH=/usr/sbin:\$PATH</span><br /> <span style="font-size:14px;">export PATH=\$ORACLE_HOME/bin:\$PATH</span><br /> <span style="font-size:14px;">export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/</span><br /> <span style="font-size:14px;">export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib</span><br /> <span style="font-size:14px;">ulimit -u 16384 -n 65536</span><br /> <span style="font-size:14px;">umask 022</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">.&nbsp; /home/oracle/.bash_profile</span><br /> <br /> <br /> <span style="font-size:14px;">#建立安裝目錄 </span><br /> <span style="font-size:14px;">mkdir -p /u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">chown -R grid.oinstall /u01</span><br /> <span style="font-size:14px;">mkdir -p /u01/app/oracle/product/11.2.0/db_1 </span><br /> <span style="font-size:14px;">chown -R oracle.oinstall&nbsp;&nbsp; /u01/app/oracle</span><br /> <span style="font-size:14px;">chmod -R 775 /u01</span><br /> <br /> <span style="font-size:14px;">#配置iscsi連線openfiler儲存,此處要根據實際情況設定,這裡是一個40G的盤,分成兩個20G的區</span><br /> <span style="font-size:14px;">yum -y install iscsi-initiator-utils</span><br /> <span style="font-size:14px;">iscsiadm -m discovery -t sendtargets -p 192.108.26.100:3260</span><br /> <span style="font-size:14px;">service iscsi restart</span><br /> <br /> <span style="font-size:14px;">partprobe </span><br /> <br /> <span style="font-size:14px;">cat &gt;&gt; /etc/udev/rules.d/60-raw.rules &lt;&lt; EOF</span><br /> <span style="font-size:14px;">ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"</span><br /> <span style="font-size:14px;">ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"</span><br /> <span style="font-size:14px;">ACTION=="add", KERNEL=="/dev/sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"</span><br /> <span style="font-size:14px;">ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="18",RUN+="/bin/raw /dev/raw/raw2 %M %m"</span><br /> <span style="font-size:14px;">KERNEL=="raw[1-2]", OWNER="grid", GROUP="oinstall", MODE="660"</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">start_udev</span><br /> <span style="font-size:14px;">ls /dev/raw/ -l</span><br /> <br /> <br /> <span style="font-size:14px;">#配置ssh</span><br /> <span style="font-size:14px;">mkdir ~/.ssh</span><br /> <span style="font-size:14px;">chmod 700 ~/.ssh</span><br /> <span style="font-size:14px;">cat &gt; /root/tempexpect.sh &lt;&lt;EOF</span><br /> <span style="font-size:14px;">set timeout -1</span><br /> <span style="font-size:14px;">spawn ssh-keygen -t rsa</span><br /> <span style="font-size:14px;">expect "(/root/.ssh/id_rsa):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "(empty for no passphrase):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "again:"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">spawn ssh-keygen -t dsa</span><br /> <span style="font-size:14px;">expect "(/root/.ssh/id_dsa):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "(empty for no passphrase):"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">expect "again:"</span><br /> <span style="font-size:14px;">send "\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">expect /root/tempexpect.sh</span><br /> <br /> <span style="font-size:14px;">cat /root/.ssh/id_rsa.pub &gt;&gt; /root/.ssh/authorized_keys</span><br /> <span style="font-size:14px;">cat /root/.ssh/id_dsa.pub &gt;&gt; /root/.ssh/authorized_keys</span><br /> <span style="font-size:14px;">#配置ssh信任登陸.這裡也配置了root的信任關係,是為了方便在rac11g03下直接操作rac11g04,可在安裝完之後去掉.</span><br /> <span style="font-size:14px;">#這裡使用expect來響應輸入,這裡的指令碼可能不夠健壯,可考慮在自動安裝之前就配置好root的信任關係</span><br /> <span style="font-size:14px;">cat &gt; /root/tempexpect.sh &lt;&lt;EOF</span><br /> <span style="font-size:14px;">set timeout -1</span><br /> <span style="font-size:14px;">spawn scp 192.108.56.104:/root/.ssh/authorized_keys /root/.ssh/authorized_keys2</span><br /> <span style="font-size:14px;">expect "(yes/no)?"</span><br /> <span style="font-size:14px;">send "yes\r"</span><br /> <span style="font-size:14px;">expect "password:"</span><br /> <span style="font-size:14px;">send "selectshen\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">expect /root/tempexpect.sh</span><br /> <br /> <span style="font-size:14px;">cat /root/.ssh/authorized_keys2 &gt;&gt; /root/.ssh/authorized_keys</span><br /> <br /> <span style="font-size:14px;">cat &gt; /root/tempexpect.sh &lt;&lt;EOF</span><br /> <span style="font-size:14px;">set timeout -1</span><br /> <span style="font-size:14px;">spawn scp /root/.ssh/authorized_keys 192.108.56.104:/root/.ssh/authorized_keys</span><br /> <span style="font-size:14px;">expect "password:"</span><br /> <span style="font-size:14px;">send "selectshen\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">EOF</span><br /> <span style="font-size:14px;">expect /root/tempexpect.sh</span><br /> <br /> <span style="font-size:14px;">cat &gt; /root/tempexpect.sh &lt;&lt;EOF</span><br /> <span style="font-size:14px;">set timeout -1</span><br /> <span style="font-size:14px;">spawn ssh rac11g03 date</span><br /> <span style="font-size:14px;">expect "(yes/no)?"</span><br /> <span style="font-size:14px;">send "yes\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">spawn ssh rac11g03-priv date</span><br /> <span style="font-size:14px;">expect "(yes/no)?"</span><br /> <span style="font-size:14px;">send "yes\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">spawn ssh rac11g04 date</span><br /> <span style="font-size:14px;">expect "(yes/no)?"</span><br /> <span style="font-size:14px;">send "yes\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">spawn ssh rac11g04-priv date</span><br /> <span style="font-size:14px;">expect "(yes/no)?"</span><br /> <span style="font-size:14px;">send "yes\r"</span><br /> <span style="font-size:14px;">interact</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">expect /root/tempexpect.sh</span><br /> <br /> <span style="font-size:14px;">scp /root/tempexpect.sh 192.108.56.104:/root/tempexpect.sh</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 expect /root/tempexpect.sh</span><br /> <br /> <span style="font-size:14px;">cp -R /root/.ssh /home/oracle/</span><br /> <span style="font-size:14px;">cp -R /root/.ssh /home/grid/</span><br /> <span style="font-size:14px;">chown -R oracle.oinstall /home/oracle/.ssh</span><br /> <span style="font-size:14px;">chown -R grid.oinstall /home/grid/.ssh</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 cp -R /root/.ssh /home/oracle/</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 cp -R /root/.ssh /home/grid/</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 chown -R oracle.oinstall /home/oracle/.ssh</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 chown -R grid.oinstall /home/grid/.ssh</span><br /> <br /> <br /> <span style="font-size:14px;">#解壓安裝檔案</span><br /> <span style="font-size:14px;">mv /root/p13390677_112040_Linux-x86-64_3* /home/grid/</span><br /> <span style="font-size:14px;">mv /root/p13390677_112040_Linux-x86-64_* /home/oracle/</span><br /> <span style="font-size:14px;">chown -R grid.oinstall /home/grid/p13390677_112040_Linux-x86-64_*</span><br /> <span style="font-size:14px;">chown -R oracle.oinstall /home/oracle/p13390677_112040_Linux-x86-64_*</span><br /> <br /> <span style="font-size:14px;">su - grid -c "unzip /home/grid/p13390677_112040_Linux-x86-64_3of7.zip"</span><br /> <span style="font-size:14px;">su - oracle -c "unzip /home/oracle/p13390677_112040_Linux-x86-64_1of7.zip"</span><br /> <span style="font-size:14px;">su - oracle -c "unzip /home/oracle/p13390677_112040_Linux-x86-64_2of7.zip"</span><br /> <br /> <span style="font-size:14px;">#安裝缺少的包</span><br /> <span style="font-size:14px;">rpm -ivh /root/pdksh-5.2.14-30.x86_64.rpm</span><br /> <span style="font-size:14px;">rpm -ivh /home/grid/grid/rpm/cvuqdisk-1.0.9-1.rpm</span><br /> <br /> <span style="font-size:14px;">scp /root/pdksh-5.2.14-30.x86_64.rpm 192.108.56.104:~/</span><br /> <span style="font-size:14px;">ssh 192.108.56.104 rpm -ivh /root/pdksh-5.2.14-30.x86_64.rpm</span><br /> <br /> <span style="font-size:14px;">#配置gi安裝響應檔案</span><br /> <span style="font-size:14px;">su - grid -c cat &gt; /home/grid/gi_install.rsp &lt;&lt;EOF</span><br /> <span style="font-size:14px;">oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0</span><br /> <span style="font-size:14px;">ORACLE_HOSTNAME=rac11g03</span><br /> <span style="font-size:14px;">INVENTORY_LOCATION=/u01/app/oraInventory</span><br /> <span style="font-size:14px;">SELECTED_LANGUAGES=en</span><br /> <span style="font-size:14px;">oracle.install.option=CRS_CONFIG</span><br /> <span style="font-size:14px;">ORACLE_BASE=/u01/app/grid</span><br /> <span style="font-size:14px;">ORACLE_HOME=/u01/app/11.2.0/grid</span><br /> <span style="font-size:14px;">oracle.install.asm.OSDBA=asmdba</span><br /> <span style="font-size:14px;">oracle.install.asm.OSOPER=asmdba</span><br /> <span style="font-size:14px;">oracle.install.asm.OSASM=asmadmin</span><br /> <span style="font-size:14px;">oracle.install.crs.config.gpnp.scanName=rac11g-scan</span><br /> <span style="font-size:14px;">oracle.install.crs.config.gpnp.scanPort=1521</span><br /> <span style="font-size:14px;">oracle.install.crs.config.clusterName=rac11g-scan</span><br /> <span style="font-size:14px;">oracle.install.crs.config.gpnp.configureGNS=false</span><br /> <span style="font-size:14px;">oracle.install.crs.config.gpnp.gnsSubDomain=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.gpnp.gnsVIPAddress=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.autoConfigureClusterNodeVIP=false</span><br /> <span style="font-size:14px;">oracle.install.crs.config.clusterNodes=rac11g03:rac11g03-vip,rac11g04:rac11g04-vip</span><br /> <span style="font-size:14px;">oracle.install.crs.config.networkInterfaceList=eth0:192.108.56.0:1,eth1:192.108.96.0:2</span><br /> <span style="font-size:14px;">oracle.install.crs.config.storageOption=ASM_STORAGE</span><br /> <span style="font-size:14px;">oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.useIPMI=false</span><br /> <span style="font-size:14px;">oracle.install.crs.config.ipmi.bmcUsername=</span><br /> <span style="font-size:14px;">oracle.install.crs.config.ipmi.bmcPassword=</span><br /> <span style="font-size:14px;">oracle.install.asm.SYSASMPassword=selectshen</span><br /> <span style="font-size:14px;">oracle.install.asm.diskGroup.name=data</span><br /> <span style="font-size:14px;">oracle.install.asm.diskGroup.redundancy=EXTERNAL</span><br /> <span style="font-size:14px;">oracle.install.asm.diskGroup.AUSize=1</span><br /> <span style="font-size:14px;">oracle.install.asm.diskGroup.disks=/dev/raw/raw1,/dev/raw/raw2</span><br /> <span style="font-size:14px;">oracle.install.asm.diskGroup.diskDiscoveryString=/dev/raw/raw*</span><br /> <span style="font-size:14px;">oracle.install.asm.monitorPassword=selectshen</span><br /> <span style="font-size:14px;">oracle.install.crs.upgrade.clusterNodes=</span><br /> <span style="font-size:14px;">oracle.install.asm.upgradeASM=false</span><br /> <span style="font-size:14px;">oracle.installer.autoupdates.option=SKIP_UPDATES</span><br /> <span style="font-size:14px;">oracle.installer.autoupdates.downloadUpdatesLoc=</span><br /> <span style="font-size:14px;">AUTOUPDATES_MYORACLESUPPORT_USERNAME=</span><br /> <span style="font-size:14px;">AUTOUPDATES_MYORACLESUPPORT_PASSWORD=</span><br /> <span style="font-size:14px;">PROXY_HOST=</span><br /> <span style="font-size:14px;">PROXY_PORT=0</span><br /> <span style="font-size:14px;">PROXY_USER=</span><br /> <span style="font-size:14px;">PROXY_PWD=</span><br /> <span style="font-size:14px;">PROXY_REALM=</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#配置oracle安裝響應檔案</span><br /> <span style="font-size:14px;">su - oracle -c cat &gt; /home/oracle/db_install.rsp &lt;&lt;EOF</span><br /> <span style="font-size:14px;">oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0</span><br /> <span style="font-size:14px;">oracle.install.option=INSTALL_DB_SWONLY</span><br /> <span style="font-size:14px;">ORACLE_HOSTNAME=rac11g03</span><br /> <span style="font-size:14px;">UNIX_GROUP_NAME=oinstall</span><br /> <span style="font-size:14px;">INVENTORY_LOCATION=/u01/app/oraInventory</span><br /> <span style="font-size:14px;">SELECTED_LANGUAGES=en</span><br /> <span style="font-size:14px;">ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1</span><br /> <span style="font-size:14px;">ORACLE_BASE=/u01/app/oracle</span><br /> <span style="font-size:14px;">oracle.install.db.InstallEdition=EE</span><br /> <span style="font-size:14px;">oracle.install.db.EEOptionsSelection=false</span><br /> <span style="font-size:14px;">oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0</span><br /> <span style="font-size:14px;">oracle.install.db.DBA_GROUP=dba</span><br /> <span style="font-size:14px;">oracle.install.db.OPER_GROUP=dba</span><br /> <span style="font-size:14px;">oracle.install.db.CLUSTER_NODES=rac11g03,rac11g04</span><br /> <span style="font-size:14px;">oracle.install.db.isRACOneInstall=</span><br /> <span style="font-size:14px;">oracle.install.db.racOneServiceName=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.type=GENERAL_PURPOSE</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.globalDBName=rac11g</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.SID=rac11g</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.characterSet=AL32UTF8</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.memoryOption=true</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.memoryLimit=700</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.installExampleSchemas=true</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.enableSecuritySettings=false</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.password.ALL=selectshen</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.password.SYS=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.password.SYSTEM=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.password.SYSMAN=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.password.DBSNMP=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.control=DB_CONTROL</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.automatedBackup.enable=false</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.automatedBackup.osuid=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.automatedBackup.ospwd=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.storageType=ASM_STORAGE</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=</span><br /> <span style="font-size:14px;">oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=</span><br /> <span style="font-size:14px;">oracle.install.db.config.asm.diskGroup=DATA</span><br /> <span style="font-size:14px;">oracle.install.db.config.asm.ASMSNMPPassword=selectshen</span><br /> <span style="font-size:14px;">MYORACLESUPPORT_USERNAME=</span><br /> <span style="font-size:14px;">MYORACLESUPPORT_PASSWORD=</span><br /> <span style="font-size:14px;">SECURITY_UPDATES_VIA_MYORACLESUPPORT=false</span><br /> <span style="font-size:14px;">DECLINE_SECURITY_UPDATES=true</span><br /> <span style="font-size:14px;">PROXY_HOST=</span><br /> <span style="font-size:14px;">PROXY_PORT=</span><br /> <span style="font-size:14px;">PROXY_USER=</span><br /> <span style="font-size:14px;">PROXY_PWD=</span><br /> <span style="font-size:14px;">PROXY_REALM=</span><br /> <span style="font-size:14px;">COLLECTOR_SUPPORTHUB_URL=</span><br /> <span style="font-size:14px;">oracle.installer.autoupdates.option=SKIP_UPDATES</span><br /> <span style="font-size:14px;">oracle.installer.autoupdates.downloadUpdatesLoc=</span><br /> <span style="font-size:14px;">AUTOUPDATES_MYORACLESUPPORT_USERNAME=</span><br /> <span style="font-size:14px;">AUTOUPDATES_MYORACLESUPPORT_PASSWORD=</span><br /> <span style="font-size:14px;">EOF</span><br /> <br /> <span style="font-size:14px;">#安裝gi </span><br /> <span style="font-size:14px;">su - grid -c "/home/grid/grid/runInstaller -ignorePrereq -silent -force -responseFile /home/grid/gi_install.rsp"</span><br /> <br /> <span style="font-size:14px;">#安裝gi軟體時,安裝程式成為後臺程式,此時不能自動執行以下,因為後臺安裝程式還沒有執行完,所以要在rac11g03下手動執行下面的命令.此問題自動執行的方法還在測試中...</span><br /> <span style="font-size:14px;">###########################################################################</span><br /> <span style="font-size:14px;">#</span><br /> <span style="font-size:14px;">#/u01/app/oraInventory/orainstRoot.sh</span><br /> <span style="font-size:14px;">#</span><br /> <span style="font-size:14px;">#ssh 192.108.56.104 /u01/app/oraInventory/orainstRoot.sh</span><br /> <span style="font-size:14px;">#</span><br /> <span style="font-size:14px;">#/u01/app/11.2.0/grid/root.sh</span><br /> <span style="font-size:14px;">#</span><br /> <span style="font-size:14px;">#ssh 192.108.56.104 /u01/app/11.2.0/grid/root.sh</span><br /> <span style="font-size:14px;">#下面的四行是一起的,注意</span><br /> <span style="font-size:14px;">#cat &gt;&gt; /u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties &lt;&lt; EOF </span><br /> <span style="font-size:14px;">#oracle.assistants.asm|S_ASMPASSWORD=selectshen </span><br /> <span style="font-size:14px;">#oracle.assistants.asm|S_ASMMONITORPASSWORD=selectshen</span><br /> <span style="font-size:14px;">#EOF</span><br /> <span style="font-size:14px;">#su - grid -c "/u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties"</span><br /> <span style="font-size:14px;">############################################################################</span><br /> <br /> <span style="font-size:14px;">#安裝oracle軟體</span><br /> <span style="font-size:14px;">#su - oracle -c "/home/oracle/database/runInstaller -ignorePrereq -silent -force -responseFile /home/oracle/db_install.rsp" </span><br /> <span style="font-size:14px;">#安裝oracle軟體時,安裝程式成為後臺程式,此時不能自動執行以下,因為後臺安裝程式還沒有執行完,所以要在rac11g03下手動執行下面的命令.此問題自動執行的方法還在測試中...</span><br /> <span style="font-size:14px;">###########################################################################</span><br /> <span style="font-size:14px;">#/u01/app/oracle/product/11.2.0/db_1/root.sh</span><br /> <span style="font-size:14px;">#</span><br /> <span style="font-size:14px;">#ssh 192.108.56.104 /u01/app/oracle/product/11.2.0/db_1/root.sh<br /> #這裡用的ASM磁碟組是之前的DATA,實際中可以透過asmca -silent -configureASM -sysAsmPassword xxx -asmsnmpPassword xxx -diskString xxx -diskGroupName MYDATA -disk xxx -redundancy xxx靜默方式去加磁碟組</span><br /> <span style="font-size:14px;">#su - oracle -c "dbca -silent -createDatabase -templateName General_Purpose.dbc&nbsp; -gdbName rac11g -sid rac11g -sysPassword selectshen -systemPassword&nbsp; selectshen -storageType ASM -diskGroupName DATA -datafileJarLocation \$ORACLE_HOME/assistants/dbca/templates -nodeinfo rac11g03,rac11g04 -characterset AL32UTF8 -obfuscatedPasswords false -sampleSchema false -asmSysPassword selectshen"</span><br /> <span style="font-size:14px;">############################################################################<br /> </span><br /> <span style="font-size:14px;"><em>此文件參考luocs的Oracle Database 11g R2 RAC 靜默安裝文件: />

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26224914/viewspace-1815320/,如需轉載,請註明出處,否則將追究法律責任。

相關文章