注意:11G的RAC安装,如果升级,则会新建目录在放软件,原来的不删除,所以所需空间比较大。
1。安装系统,把所有的开发包全部安装上
关掉防火墙和SELinux
yum -y install compat-libstdc++*
yum -y install elfutils-libelf-devel*
yum -y install elfutils-libelf-devel-static*
yum -y install gcc*
yum -y install gcc-c++*
yum -y install glibc*
yum -y install glibc-common*
yum -y install glibc-devel*
yum -y install glibc-headers*
yum -y install kernel-headers*
yum -y install ksh*
yum -y install libaio*
yum -y install libaio-devel*
yum -y install libgcc*
yum -y install libgomp*
yum -y install libstdc++*
yum -y install libstdc++-devel*
yum -y install make*
yum -y install sysstat*
yum -y install unixODBC*
yum -y install unixODBC-devel*
yum -y install libXp*
2。修改参数,在文件后面添加如下内容
1)配置核心参数
vi /etc/sysctl.conf
kernel.msgmnb = 65536
fs.file-max = 6815744
kernel.msgmni = 2878
kernel.msgmax = 8192
kernel.msgmnb = 65536
kernel.sem = 250 32000 100 142
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.sysrq = 1
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 3145728
net.ipv4.ip_local_port_range = 9000 65500
vm.min_free_kbytes = 51200
修改完执行此命令 : sysctl -p
2)vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
之后,执行:$ulimit验证一下.
3) vi /etc/csh.login
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
4) vi /etc/pam.d/login
session required pam_limits.so
5) vi /etc/security/limits.conf
oracle soft nofile 655360
oracle hard nofile 635360
oracle soft nproc 10240
oracle hard nproc 16384
3。创建用户 和组
/usr/sbin/groupadd -g 551 oinstall
/usr/sbin/groupadd -g 552 dba
/usr/sbin/groupadd -g 554 asmadmin
/usr/sbin/groupadd -g 556 asmdba
/usr/sbin/groupadd -g 557 asmoper
/usr/sbin/useradd -u 551 -g oinstall -G asmadmin,asmdba,asmoper grid
/usr/sbin/useradd -u 552 -g oinstall -G dba,asmdba oracle
设置密码
4。 网络
五个共有ip
每个节点两个:物理ip,vip
一个scan ip
两个私有ip
#scanip
192.168.56.245 scanip
#rac3
192.168.56.203 rac3
192.168.56.234 rac3vip
10.10.10.203 rac3priv
#rac4
192.168.56.204 rac4
192.168.56.243 rac4vip
10.10.10.204 rac4priv
如果使用dns,需要三个scan ip
DNS server, then, as the root user, change the hosts search order in
/etc/nsswitch.conf on all nodes as shown here:
Old:
hosts: files nis dns
New:
hosts: dns files nis
5。创建目录
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
#创建Oracle Grid Infrastructure Home Directory
mkdir -p /u01/11.2.0/grid
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01/11.2.0/grid
chmod -R 775 /u01/11.2.0/grid
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01/app/grid
#创建Oracle Base Directory
mkdir -p /u01/app/oracle
mkdir /u01/app/oracle/cfgtoollogs
#创建Oracle RDBMS Home Directory
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
Oracle用户环境变量
export ORACLE_SID=jun1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1/
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH:$ORACLE_HOME/OPatch
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
grid 用户环境变量
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/11.2.0/grid
export ORACLE_SID=+ASM1
export PATH=$PATH:$ORACLE_HOME/bin
6。划分磁盘和裸设备映射
fdisk -l 查看盘为 /dev/sdb
rac3添加了两个:
fdisk /dev/sdb
另一个节点执行:fdisk /dev/sdb ,最后输入w
修改两个节点的文件
cd /etc/udev/rules.d
vi 60-raw.rules
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
KERNEL=="raw[1-2]", OWNER="grid", GROUP="asmadmin", MODE="0660"
最后可以不用,但是必须修改权限,但是生产环境一般都有。
两个节点都执行 start_udev
查看 ls –l /dev/raw
7。配置互信(用grid用户执行,在一边配就可以了。)
Setup SSH user equivalency
===================================================
Use grid user on all nodes: rm -rf $HOME/.ssh
$GI_OUI/sshsetup/sshUserSetup.sh -user grid -hosts "rac3 rac4" -advanced -noPromptPassphrase
$OUI_HOME/sshsetup/sshUserSetup.sh -user oracle -hosts "rac3 rac4" -advanced -noPromptPassphrase
配置后测试互信是否通
8。安装grid
用grid 用户安装
如果遇到如下所示,纯属正常,可直接点skip跳过之。
9。安装oracle软件(oracle用户)
10。建库