CENTOS 6.6 x64 自动化安装Oracle Database 11g R2 RAC脚本
os:centos 6.6
hostname:rac11g03,rac11g04
IP: rac11g03 192.108.56.103 192.108.96.103 192.108.26.103
rac11g04 192.108.56.104 192.108.96.104 192.108.26.104
oracle:11.2.0.4
storage:openfiler 192.108.26.100:3260
说明:
1.centos 6.6已经做了basic安装,ip和主机名已设置.
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下.
3.密码都用的selectshen,可根据自己的需要修改
4.三个网段,192.108.56.0:public,192.108.96.0:private,192.108.26.0:storage
5.以下脚本可以在健壮性和通用性上做一些调整,以用来在开发测试环境中快速部署RAC.
实施:
#################################步骤一#################################
###################rac11g04_init.sh,以下内容放到一个文件中,在rac11g04下sh执行即可:
#!/bin/bash
##此处用于加载光驱为之后安装缺少的包,也可改为网络方式.
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
mv /etc/yum.repos.d/*.repo /root/
cat > /etc/yum.repos.d/CentOS-Media.repo << EOF
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
yum clean all
yum makecache
#调整hosts文件
cat >> /etc/hosts << EOF
192.108.56.103 rac11g03
192.108.56.104 rac11g04
192.108.56.203 rac11g03-vip
192.108.56.204 rac11g04-vip
192.108.56.205 rac11g-scan
192.108.96.103 rac11g03-priv
192.108.96.104 rac11g04-priv
EOF
#关闭防火墙,selinux
chkconfig iptables off
service iptables stop
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#网络参数调整
cat >> /etc/sysctl.conf << EOF
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
sysctl -p
#资源限制参数调整
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
EOF
#登陆参数调整
cat >> /etc/pam.d/login << EOF
session required /lib64/security/pam_limits.so
EOF
#安装缺少的包
yum -y install 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
yum -y install expect
ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1
#清除NTP服务
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
mv /var/run/ntpd.pid /var/run/ntpd.pid.bak
##创建配置grid,oracle用户
groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1300 asmdba
useradd -u 1100 -d /home/oracle -g oinstall -G dba,asmdba oracle
useradd -u 1101 -d /home/grid -g oinstall -G asmadmin,asmdba grid
echo "selectshen"|passwd --stdin oracle
echo "selectshen"|passwd --stdin grid
cat >> /home/grid/.bash_profile << EOF
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:/$PATH
export PATH=/$ORACLE_HOME/bin:/$PATH
export LD_LIBRARY_PATH=/$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=/$ORACLE_HOME/JRE:/$ORACLE_HOME/jlib:/$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/grid/.bash_profile
cat >> /home/oracle/.bash_profile << EOF
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=rac11g
export ORACLE_TERM=xterm
export PATH=/usr/sbin:/$PATH
export PATH=/$ORACLE_HOME/bin:/$PATH
export LD_LIBRARY_PATH=/$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=/$ORACLE_HOME/JRE:/$ORACLE_HOME/jlib:/$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/oracle/.bash_profile
#创建安装目录
mkdir -p /u01/app/11.2.0/grid
chown -R grid.oinstall /u01
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle.oinstall /u01/app/oracle
chmod -R 775 /u01
#配置iscsi连接openfiler存储,此处要根据实际情况设置,这里是一个40G的盘,分成两个20G的区
yum -y install iscsi-initiator-utils
iscsiadm -m discovery -t sendtargets -p 192.108.26.100:3260
service iscsi restart
fdisk /dev/sdb <<EOF
n
p
1
+20G
n
p
2
w
EOF
cat >> /etc/udev/rules.d/60-raw.rules << EOF
ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="18",RUN+="/bin/raw /dev/raw/raw2 %M %m"
KERNEL=="raw[1-2]", OWNER="grid", GROUP="oinstall", MODE="660"
EOF
start_udev
ls /dev/raw/ -l
#配置ssh,这里使用expect来自动来响应输入
mkdir ~/.ssh
chmod 700 ~/.ssh
cat > /root/tempexpect.sh <<EOF
set timeout -1
spawn ssh-keygen -t rsa
expect "(/root/.ssh/id_rsa):"
send "/r"
expect "(empty for no passphrase):"
send "/r"
expect "again:"
send "/r"
interact
spawn ssh-keygen -t dsa
expect "(/root/.ssh/id_dsa):"
send "/r"
expect "(empty for no passphrase):"
send "/r"
expect "again:"
send "/r"
interact
EOF
expect /root/tempexpect.sh
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
cat /root/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
#################################步骤二#################################
####################rac11g03_init.sh,以下内容放到一个文件中,在rac11g03下sh执行即可:
#!/bin/bash
##此处用于加载光驱为之后安装缺少的包,也可改为网络方式.
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
mv /etc/yum.repos.d/*.repo /root/
cat > /etc/yum.repos.d/CentOS-Media.repo << EOF
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
yum clean all
yum makecache
#调整hosts文件
cat >> /etc/hosts << EOF
192.108.56.103 rac11g03
192.108.56.104 rac11g04
192.108.56.203 rac11g03-vip
192.108.56.204 rac11g04-vip
192.108.56.205 rac11g-scan
192.108.96.103 rac11g03-priv
192.108.96.104 rac11g04-priv
EOF
#关闭防火墙,selinux
chkconfig iptables off
service iptables stop
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#网络参数调整
cat >> /etc/sysctl.conf << EOF
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
sysctl -p
#资源限制参数调整
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
EOF
#登陆参数调整
cat >> /etc/pam.d/login << EOF
session required /lib64/security/pam_limits.so
EOF
#安装缺少的包
yum -y install 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
yum -y install expect
ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1
#清除NTP服务
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
mv /var/run/ntpd.pid /var/run/ntpd.pid.bak
##创建配置grid,oracle用户
groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1300 asmdba
useradd -u 1100 -d /home/oracle -g oinstall -G dba,asmdba oracle
useradd -u 1101 -d /home/grid -g oinstall -G asmadmin,asmdba grid
echo "selectshen"|passwd --stdin oracle
echo "selectshen"|passwd --stdin grid
cat >> /home/grid/.bash_profile << EOF
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:/$PATH
export PATH=/$ORACLE_HOME/bin:/$PATH
export LD_LIBRARY_PATH=/$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=/$ORACLE_HOME/JRE:/$ORACLE_HOME/jlib:/$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/grid/.bash_profile
cat >> /home/oracle/.bash_profile << EOF
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=rac11g
export ORACLE_TERM=xterm
export PATH=/usr/sbin:/$PATH
export PATH=/$ORACLE_HOME/bin:/$PATH
export LD_LIBRARY_PATH=/$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=/$ORACLE_HOME/JRE:/$ORACLE_HOME/jlib:/$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/oracle/.bash_profile
#创建安装目录
mkdir -p /u01/app/11.2.0/grid
chown -R grid.oinstall /u01
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle.oinstall /u01/app/oracle
chmod -R 775 /u01
#配置iscsi连接openfiler存储,此处要根据实际情况设置,这里是一个40G的盘,分成两个20G的区
yum -y install iscsi-initiator-utils
iscsiadm -m discovery -t sendtargets -p 192.108.26.100:3260
service iscsi restart
partprobe
cat >> /etc/udev/rules.d/60-raw.rules << EOF
ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="18",RUN+="/bin/raw /dev/raw/raw2 %M %m"
KERNEL=="raw[1-2]", OWNER="grid", GROUP="oinstall", MODE="660"
EOF
start_udev
ls /dev/raw/ -l
#配置ssh
mkdir ~/.ssh
chmod 700 ~/.ssh
cat > /root/tempexpect.sh <<EOF
set timeout -1
spawn ssh-keygen -t rsa
expect "(/root/.ssh/id_rsa):"
send "/r"
expect "(empty for no passphrase):"
send "/r"
expect "again:"
send "/r"
interact
spawn ssh-keygen -t dsa
expect "(/root/.ssh/id_dsa):"
send "/r"
expect "(empty for no passphrase):"
send "/r"
expect "again:"
send "/r"
interact
EOF
expect /root/tempexpect.sh
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
cat /root/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
#配置ssh信任登陆.这里也配置了root的信任关系,是为了方便在rac11g03下直接操作rac11g04,可在安装完之后去掉.
#这里使用expect来响应输入,这里的脚本可能不够健壮,可考虑在自动安装之前就配置好root的信任关系
cat > /root/tempexpect.sh <<EOF
set timeout -1
spawn scp 192.108.56.104:/root/.ssh/authorized_keys /root/.ssh/authorized_keys2
expect "(yes/no)?"
send "yes/r"
expect "password:"
send "selectshen/r"
interact
EOF
expect /root/tempexpect.sh
cat /root/.ssh/authorized_keys2 >> /root/.ssh/authorized_keys
cat > /root/tempexpect.sh <<EOF
set timeout -1
spawn scp /root/.ssh/authorized_keys 192.108.56.104:/root/.ssh/authorized_keys
expect "password:"
send "selectshen/r"
interact
EOF
expect /root/tempexpect.sh
cat > /root/tempexpect.sh <<EOF
set timeout -1
spawn ssh rac11g03 date
expect "(yes/no)?"
send "yes/r"
interact
spawn ssh rac11g03-priv date
expect "(yes/no)?"
send "yes/r"
interact
spawn ssh rac11g04 date
expect "(yes/no)?"
send "yes/r"
interact
spawn ssh rac11g04-priv date
expect "(yes/no)?"
send "yes/r"
interact
EOF
expect /root/tempexpect.sh
scp /root/tempexpect.sh 192.108.56.104:/root/tempexpect.sh
ssh 192.108.56.104 expect /root/tempexpect.sh
cp -R /root/.ssh /home/oracle/
cp -R /root/.ssh /home/grid/
chown -R oracle.oinstall /home/oracle/.ssh
chown -R grid.oinstall /home/grid/.ssh
ssh 192.108.56.104 cp -R /root/.ssh /home/oracle/
ssh 192.108.56.104 cp -R /root/.ssh /home/grid/
ssh 192.108.56.104 chown -R oracle.oinstall /home/oracle/.ssh
ssh 192.108.56.104 chown -R grid.oinstall /home/grid/.ssh
#解压安装文件
mv /root/p13390677_112040_Linux-x86-64_3* /home/grid/
mv /root/p13390677_112040_Linux-x86-64_* /home/oracle/
chown -R grid.oinstall /home/grid/p13390677_112040_Linux-x86-64_*
chown -R oracle.oinstall /home/oracle/p13390677_112040_Linux-x86-64_*
su - grid -c "unzip /home/grid/p13390677_112040_Linux-x86-64_3of7.zip"
su - oracle -c "unzip /home/oracle/p13390677_112040_Linux-x86-64_1of7.zip"
su - oracle -c "unzip /home/oracle/p13390677_112040_Linux-x86-64_2of7.zip"
#安装缺少的包
rpm -ivh /root/pdksh-5.2.14-30.x86_64.rpm
rpm -ivh /home/grid/grid/rpm/cvuqdisk-1.0.9-1.rpm
scp /root/pdksh-5.2.14-30.x86_64.rpm 192.108.56.104:~/
ssh 192.108.56.104 rpm -ivh /root/pdksh-5.2.14-30.x86_64.rpm
#配置gi安装响应文件
su - grid -c cat > /home/grid/gi_install.rsp <<EOF
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=rac11g03
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmdba
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=rac11g-scan
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.clusterName=rac11g-scan
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=rac11g03:rac11g03-vip,rac11g04:rac11g04-vip
oracle.install.crs.config.networkInterfaceList=eth0:192.108.56.0:1,eth1:192.108.96.0:2
oracle.install.crs.config.storageOption=ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=selectshen
oracle.install.asm.diskGroup.name=data
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/raw/raw1,/dev/raw/raw2
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/raw/raw*
oracle.install.asm.monitorPassword=selectshen
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=0
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
EOF
#配置oracle安装响应文件
su - oracle -c cat > /home/oracle/db_install.rsp <<EOF
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=rac11g03
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
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
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.CLUSTER_NODES=rac11g03,rac11g04
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=rac11g
oracle.install.db.config.starterdb.SID=rac11g
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=700
oracle.install.db.config.starterdb.installExampleSchemas=true
oracle.install.db.config.starterdb.enableSecuritySettings=false
oracle.install.db.config.starterdb.password.ALL=selectshen
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=ASM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=DATA
oracle.install.db.config.asm.ASMSNMPPassword=selectshen
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
EOF
#安装gi
su - grid -c "/home/grid/grid/runInstaller -ignorePrereq -silent -force -responseFile /home/grid/gi_install.rsp"
#安装gi软件时,安装进程成为后台进程,此时不能自动执行以下,因为后台安装进程还没有执行完,所以要在rac11g03下手动执行下面的命令.此问题自动执行的方法还在测试中...
###########################################################################
#
#/u01/app/oraInventory/orainstRoot.sh
#
#ssh 192.108.56.104 /u01/app/oraInventory/orainstRoot.sh
#
#/u01/app/11.2.0/grid/root.sh
#
#ssh 192.108.56.104 /u01/app/11.2.0/grid/root.sh
#下面的四行是一起的,注意
#cat >> /u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties << EOF
#oracle.assistants.asm|S_ASMPASSWORD=selectshen
#oracle.assistants.asm|S_ASMMONITORPASSWORD=selectshen
#EOF
#su - grid -c "/u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties"
############################################################################
#安装oracle软件
#su - oracle -c "/home/oracle/database/runInstaller -ignorePrereq -silent -force -responseFile /home/oracle/db_install.rsp"
#安装oracle软件时,安装进程成为后台进程,此时不能自动执行以下,因为后台安装进程还没有执行完,所以要在rac11g03下手动执行下面的命令.此问题自动执行的方法还在测试中...
###########################################################################
#/u01/app/oracle/product/11.2.0/db_1/root.sh
#
#ssh 192.108.56.104 /u01/app/oracle/product/11.2.0/db_1/root.sh
#这里用的ASM磁盘组是之前的DATA,实际中可以通过asmca -silent -configureASM -sysAsmPassword xxx -asmsnmpPassword xxx -diskString xxx -diskGroupName MYDATA -disk xxx -redundancy xxx静默方式去加磁盘组
#su - oracle -c "dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName rac11g -sid rac11g -sysPassword selectshen -systemPassword selectshen -storageType ASM -diskGroupName DATA -datafileJarLocation /$ORACLE_HOME/assistants/dbca/templates -nodeinfo rac11g03,rac11g04 -characterset AL32UTF8 -obfuscatedPasswords false -sampleSchema false -asmSysPassword selectshen"
############################################################################
此文档参考luocs的Oracle Database 11g R2 RAC 静默安装文档:http://www.luocs.com/archives/306.html
正文到此结束