ITPub博客

首页 > 数据库 > Oracle > CENTOS 6.6 x64 自动化安装Oracle Database 11g R2 RAC脚本

CENTOS 6.6 x64 自动化安装Oracle Database 11g R2 RAC脚本

Oracle 作者:flywiththewind 时间:2015-10-21 10:26:04 0 删除 编辑
<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 静默安装文档:http://www.luocs.com/archives/306.html</em></span><br />

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26224914/viewspace-1815320/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-08-30

  • 博文量
    140
  • 访问量
    133389