软硬件环境准备:
1.1 虚拟环境:
VirtualBox上两个虚拟机,3G内存1核
1.2 软件环境:
数据库安装软件:p10404530_112030_LINUX_1of7.zip p10404530_112030_LINUX_2of7.zip
grid安装软件: p10404530_112030_LINUX_3of7.zip
1.3 磁盘设定:
本地磁盘: 各虚拟机每个50G
共享存储: 表决磁盘1Gx3;数据磁盘10Gx1,回闪5Gx1
1.4 网络规划
|
public ip |
VIP |
priv ip |
rac1 |
192.168.0.201 |
192.168.0.203 |
192.168.3.201 |
rac2 |
192.168.0.202 |
192.168.0.204 |
192.168.3.202 |
rac-scan |
192.168.0.200 |
1.5 主机名设置
节点1 --> rac1
节点2 --> rac2
1.6 设置/etc/hosts文件,这里没使用DNS,所以scan在hosts里配置
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.201 rac1 192.168.0.202 rac2 #Private IP 192.168.3.201 rac1-priv 192.168.3.202 rac2-priv #Virtual IP 192.168.0.203 rac1-vip 192.168.0.204 rac2-vip #Scan IP 192.168.0.200 rac-scan
1.7 网卡配置
节点一,节点二类似
1.8 关闭防火墙和selinux
service iptables stop chkconfig iptables off sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux setenforce 0
1.9 禁止NTP服务启动
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
2.0 添加组和用户,并为用户设定密码
groupadd -g 501 oinstall groupadd -g 502 dba groupadd -g 503 oper groupadd -g 504 asmadmin groupadd -g 505 asmoper groupadd -g 506 asmdba useradd -g oinstall -G dba,asmdba,oper oracle useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
passwd oracle
passwd grid
2.1 创建软件安装目录
mkdir -p /u01/app/grid mkdir -p /u01/app/11.2.0/grid mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/11.2.0 chmod -R 775 /u01
2.2 配置环境变量,都写在~/.bash_profile里面
oracle用户
export ORACLE_SID=racdb1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS" export TMP=/tmp export TMPDIR=$TMP export PATH=$PATH:$ORACLE_HOME/bin
grid用户
export ORACLE_SID=+ASM1 export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/11.2.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS" export PATH=$ORACLE_HOME/bin:$PATH
注意节点二的ORACLE_SID=racdb2和+ASM2