Oracle11gR2_RAC_for_redhat6.3 安装手册
原创 2016年06月02日 21:46:53
软件环境
数据库:
P10404530_112030_linux-x86-64_1of7.zip
P10404530_112030_linux-x86-64_2of7.zip
集群件(11G中的GRID):
P10404530_112030_linux-x86-64_3of7.zip
操作系统:
Redhat6.3
RAC拓扑图
网络规划
——–public IP——–
rac1 172.16.64.129
rac2 172.16.64.130
——–VIP——–
racvip1 172.16.64.131
racvip2 172.16.64.132
——–PRIV IP——–
racpriv1 10.10.10.10
racpriv 210.10.10.11
——–SCAN IP——–
scanip 172.16.64.133
安装目录规划
grid base目录:/u01/app/grid #grid用户的ORACLE_BASE
grid asm安装目录:/u01/app/11.2.0/grid #grid用户的ORACLE_HOME
Oracle base目录:/u01/app/oracle #oracle用户的ORACLE_BASE
Oracle home目录:/u01/app/oracle/product/11.2.0/dbhome_1 #oracle用户的ORACLE_HOME
安装PATCHES列表
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
glibc-2.12-1.7.el6 (x86_64)
ksh-*.el6 (x86_64) <== any version of ksh is acceptable
libaio-0.3.107-10.el6 (x86_64)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
make-3.81-19.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (x86_64)
sysstat-9.0.4-11.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
glibc-2.12-1.7.el6 (i686)
glibc-devel-2.12-1.7.el6 (i686)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (i686)
libgcc-4.4.4-13.el6 (i686)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (i686)
elfutils-libelf-devel-0.97
安装PATCHES
rpm -ivh --nodeps --force binutils-2.20.51.0.2-5.34.el6.x86_64.rpm rpm -ivh --nodeps --force compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm rpm -ivh --nodeps --force glibc-2.12-1.80.el6.x86_64.rpm rpm -ivh --nodeps --force ksh-*.rpm rpm -ivh --nodeps --force libaio-0.3.107-10.el6.x86_64.rpm rpm -ivh --nodeps --force libgcc-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force libstdc++-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force make-3.81-20.el6.x86_64.rpm rpm -ivh --nodeps --force compat-libcap1-1.10-1.x86_64.rpm rpm -ivh --nodeps --force gcc-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force gcc-c++-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force glibc-devel-2.12-1.80.el6.x86_64.rpm rpm -ivh --nodeps --force libaio-devel-0.3.107-10.el6.x86_64.rpm rpm -ivh --nodeps --force libstdc++-devel-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force sysstat-9.0.4-20.el6.x86_64.rpm rpm -ivh --nodeps --force compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm rpm -ivh --nodeps --force glibc-2.12-1.80.el6.x86_64.rpm rpm -ivh --nodeps --force glibc-devel-2.12-1.80.el6.x86_64.rpm rpm -ivh --nodeps --force libaio-0.3.107-10.el6.x86_64.rpm rpm -ivh --nodeps --force libaio-devel-0.3.107-10.el6.x86_64.rpm rpm -ivh --nodeps --force libgcc-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force libstdc++-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force libstdc++-devel-4.4.6-4.el6.x86_64.rpm rpm -ivh --nodeps --force elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
主机网络配置
主机网络设置检查:hosts文件系修改、网卡IP配置。
1. 编辑hosts文件,将如下内容添加到hosts文件中,指定Public IP、VIP、Private IP。
2. Vi /etc/hosts
172.16.64.129 rac1 172.16.64.130 rac2 10.10.10.10 racpriv1 10.10.10.11 racpriv2 172.16.64.131 racvip1 172.16.64.132 racvip2 172.16.64.133 scanip
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
网卡的IP地址已经在系统安装过程中配置完成,可以使用如下命令检查IP配置情况:#ifconfig
创建操作系统组和用户
在两个节点创建相应的操作系统组和用户,先创建组,然后创建用户:
以root用户使用如下命
#groupadd -g 1301 asmadmin #groupadd -g 1302 asmdba #groupadd -g 1303 asmoper #groupadd -g 1304 oinstall #groupadd -g 1305 dba #useradd -u 1300 -g oinstall -G asmadmin,asmdba,asmoper grid #useradd -u 1310 -g oinstall -G dba,asmdba oracle 使用passwd命令为grid(密码:grid)和oracle(密码:oracle)账户设置密码。
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
创建软件安装目录结构并更改权限
在两个节点创建相应的目录改变属主并改变权限
以root用户使用如下命
#mkdir /grid #mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1 #mkdir -p /u01/app/grid/11.2.0 #chown -R grid:oinstall /u01 #chown -R grid:oinstall /grid #chown -R oracle:oinstall /u01/app/oracle #chmod -R 775 /u01
- 1
- 2
- 3
- 4
- 5
- 6
- 7
修改用户概要文件
在两个节点上分别修改
grid用户.bash_profile
添加如下内容:
export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/11.2.0/grid export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
- 1
- 2
- 3
- 4
export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
- 1
- 2
- 3
- 4
#vim /etc/security/limits.conf grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
修改内核参数关闭所有节点防火墙
用root用户在两个节点分别编辑/etc/sysctl.conf
添加下图内容:
#Service iptables status #Service iptables stop
- 1
- 2
配置互信
两个节点都要执行
集群软件解压之后
[root@node1 ~]# rm -rf $HOME/.ssh cd /grid/grid/sshsetup [grid@rac1 sshsetup]$ pwd /u01/grid/grid/sshsetup
- 1
- 2
- 3
- 4
此步骤只要在一个节点上执行
[grid@rac1 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "rac1 rac2" -advanced –noPromptPassphrase
- 1
两个用户(Grid和Oracle)都要验证互信
ssh rac1 date ssh racpriv1 date ssh rac2 date ssh racpriv2 date
- 1
- 2
- 3
- 4
没有提示输入密码则成功
存储分区(在一个节点上执行)
所有规划的设备进行分区,例如在节点1上对sdc盘进行划盘
[root@db1 ~]# fdisk /dev/sdc WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): p Disk /dev/sde: 536.9 GB,536870912000 bytes 255 heads,63 sectors/track,65270 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d60dc Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-65270,default 1): Using default value 1 Last cylinder,+cylinders or +size{K,M,G} (1-65270,default 65270): Using default value 65270 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
所有节点同步分区
Partprobe
- 1
注意:本例的存储是按照一般情况来配置的,实际划分请根据情况而定。
绑定裸设备
用root用户两个节点都需执行:
vi /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add",KERNEL=="sda",RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda,or # ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="1",RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8,minor 1. #for ocr_voting ACTION=="add",KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add",KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add",KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add",KERNEL=="sdd2",RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add",KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add",KERNEL=="sde2",RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add",KERNEL=="sdf1",RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add",KERNEL=="sdf2",RUN+="/bin/raw /dev/raw/raw8 %N" KERNEL=="raw[1-8]",OWNER="grid",GROUP="asmadmin",MODE="0660"
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
重启 UDEV:
# /sbin/start_udev
- 1
验证:
[root@db1 rules.d]# ll /dev/raw total 0 crw-rw---- 1 grid asmadmin 162,1 Jul 28 15:19 raw1 crw-rw---- 1 grid asmadmin 162,2 Jul 28 15:19 raw2 crw-rw---- 1 grid asmadmin 162,3 Jul 28 15:19 raw3 crw-rw---- 1 grid asmadmin 162,4 Jul 28 15:19 raw4 crw-rw---- 1 grid asmadmin 162,5 Jul 28 15:19 raw5 crw-rw---- 1 grid asmadmin 162,6 Jul 28 15:19 raw6 crw-rw---- 1 grid asmadmin 162,7 Jul 28 15:19 raw7 crw-rw---- 1 grid asmadmin 162,8 Jul 28 15:19 raw8 crw-rw---- 1 root disk 162,0 Jul 28 15:19 rawctl
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
安装Grid
节点1用GRID用执行:
[grid@db1 grid]$ ./runI*
注:执行上述脚本千万要注意顺序
先在节点1和节点2执行:
/u01/app/oraInventory/orainstRoot.sh
其次在节点1和节点2执行:
/u01/app/11.2.0/grid/root.sh
点击Close安装完成
安装数据库软件
这里只安装数据库软件,之后再用dbca命令建立集群实例。安装完database软件后,需要建立ASM磁盘组。
使用oracle用户登录进行安装。
安装进度大概至94%时,提示需要运行相关脚本,按要求顺序执行,正确执行完毕后点击:OK
关闭窗口,完成database的安装
创建ASM磁盘组
在建库前需要先创建存储数据文件的ASM磁盘组。以grid用户登录,执行asmca命令:
DBCA创建数据库
使用oracle用户,运行dbca来建立RAC集群实例。
$dbca
验证 后面补充 查看集群状态:grid用户执行 crs_stat -t