Linux version : Oracle Enterprice Linux 6.5 (64bit)
Grid version: 11.2.0.4
Oracle version 11.2.0.4 (64bit)
本文出自:http://www.solgle.com/news/157.html
一:安装linux系统;
注:1:安装中请附带部分必要插件:如桌面系统、iscsi initiator;
2:每个节点机器的硬件及软件配置应完全相同;
3:每个节点两个网卡配置及属性完全相同;
安装具体步骤见相关linux安装文档
二:配置系统参数:
(注:以下请用root用户操作,每个节点均要执行)
1:vi /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
2:vi /etc/pam.d/login 增加以下内容
session required /lib64/security/pam_limits.so
3:vi /etc/sysctl.conf 增加以下内容,参数大小仅供参考
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni=4096
kernel.sem=250 32000 100 128
fs.file-max=6815744
fs.aio-max-nr=1048576
net.ipv4.ip_local_port_range=9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
4:完成以上内容后执行:sysctl –p
三:配置网络环境,以rac2为例
1:配置主机网络名称vi /etc/sysconfig/network 增加或修改以下内容
NETWORKING=yes
HOSTNAME=rac2 (节点名称为rac2,下一节点则为rac3,以此类推)
2:配置rac2网卡eth0属性 vi /etc/sysconfig/network-scripts/ifcfg-eth0(注:配置信息仅供参考,红色部分是需要修改的)
DEVICE=eth0
HWADDR=00:50:56:28:F4:A2
TYPE=Ethernet
UUID=6e1c23df-eb0e-4b0c-a1ba-4b206e3e1348
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.16.3.60
NETMASK=255.255.255.0
3:配置rac2网卡eth1属性 vi /etc/sysconfig/network-scripts/ifcfg-eth1(注:配置信息仅供参考,红色部分是需要修改的)
DEVICE=eth1
HWADDR=00:50:56:37:60:22
TYPE=Ethernet
UUID=dca2f01c-496a-4a89-b6c7-0be9a5ad78dd
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.16.6.2
NETMASK=255.255.255.0
网卡需要重启,特殊环境还需要配置网关,这里暂不作介绍。
4:配置hosts信息:
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.16.3.50 rac1
192.16.3.60 rac2
192.16.3.33 rac1-vip
192.16.3.34 rac2-vip
10.16.6.3 rac1-priv
10.16.6.2 rac2-priv
192.16.3.35 s-scan
以上所有每个节点都需要配置,其它节点的配置略…
四:配置目录用户权限
1:创建相应组及用户(注:以下请用root用户操作,每个节点均要执行)
groupadd –g 501 oinstall
groupadd –g 502 dba
groupadd –g 504 asmadmin
groupadd –g 506 asmdba
groupadd –g 507 asmoper
useradd –u 501 –g oinstall –G asmadmin,asmdba,asmoper grid
useradd –u 502 –g oinstall –G dba,asmdba oracle
2:创建目录及设置所有者
mkdir /u01
mkdir /u01/grid
mkdir /u01/app
mkdir /u01/app/grid/
mkdir /u02
mkdir /u02/app
mkdir /u02/app/product
chmod –R grid:oinstall /u01
chmod –R oracle:oinstall /u02
3:设置用户密码
passwd grid
。。。
passwd oracle
。。。
4:配置oracle用户 .bash_profile (注意hostname要与节点名称对应)
export ORACLE_HOSTNAME=rac1
export ORACLE_BASE=/u02/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbname_1
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib/:/usr/lib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
保存后在oracle用户下执行:source .bash_profile
5:配置grid用户 .bash_profile (注意hostname要与节点名称对应)
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export THREADS_FLAG=native
export PATH=$ORAClE_HOME/bin:$PATH
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
保存后在grid用户下执行:source .bash_profile
五:挂载共享磁盘阵列
(注:每台节点上面都需要执行)
1:确保每台节点上面都安装好了iscsi initiator
2:启动设置
chkconfig iscsid on
chkconfig iscsi on
3:设置挂载点
iscsiadm –m discovery –t sendtargets –p 192.16.3.100
4:刷新挂载
/etc/init.d/iscsi restart
5:使用fdiks –l 查看磁盘挂载情况
[root@rac1 ~]# fdisk -l
... ...
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe591bcf6
Disk /dev/sdc: 43.2 GB, 43243274240 bytes
64 heads, 32 sectors/track, 41240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x87f7ea70
Disk /dev/sdb及/dev/sdc为挂载进来的共享磁盘,则表示挂载成功
6:创建分区(该步请在一个节点上面执行即可)
相关命令如下:fdisk /dev/sdb
fdisk /dev/sdc
查看结果列表:fdisk –l
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe591bcf6
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 43.2 GB, 43243274240 bytes
64 heads, 32 sectors/track, 41240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x87f7ea70
Device Boot Start End Blocks Id System
/dev/sdc1 1 41240 42229744 83 Linux
如上可以看出:/dev/sdb1,/dev/sdc1为新的分区
六:配置asm磁盘
1:为每个节点安装以下rpm
(下载地址参考:http://www.solgle.com/news/?177.html)
oracleasm-support-2.1.8-1.el6.x86_64.rpm
oracleasmlib-2.0.4-1.el6.x86_64.rpm
2:为每个节点配置oracleasm
执行:/etc/init.d/oracleasm configure
/usr/sbin/oracleasm init
3:标记候选设备:(注:请在一个节点上面执行)
执行:dd if=/dev/zero of=/dev/sdb1 bs=1M count=10
dd if=/dev/zero of=/dev/sdc1 bs=1M count=10
4:创建asm磁盘:(注:请在一个节点上面执行)
执行:oracleasm createdisk DISK1 /dev/sdb1
oracleasm createdisk DISK2 /dev/sdc1
5:为每个节点扫描asm disk:
执行:oracleasm scandisks
oracleasm listdisks
七:配置其它服务
(注:每个节点都需要设置)
1:关闭或设置好防火墙及selinux;
chkconfig iptables off
chkconfig selinux off
service iptables stop
service selinux stop
2:请将每个节点的时间调整为一致,局域网内请停掉网络时间同步
chkconfig ntpd off
service ntpd stop
3:检查各节点保证各网卡互通
八:安装grid
(仅在一个节点上面执行)
1:减压p13390677_112040_Linux-x86-64_3of7.zip,
unzip p13390677_112040_Linux-x86-64_3of7.zip
解压成功后会在当前目录生成grid文件夹
2:启动桌面
startx
3:运行安装grid
[grid@rac1 ~]$ cd grid
[grid@rac1 grid]$ ll
drwxr-xr-x. 4 grid oinstall 4096 8æ 26 2013 install
-rw-r--r--. 1 grid oinstall 30016 8æ 27 2013 readme.html
drwxr-xr-x. 2 grid oinstall 4096 8æ 26 2013 response
drwxr-xr-x. 2 grid oinstall 4096 8æ 26 2013 rpm
-rwxr-xr-x. 1 grid oinstall 4878 8æ 26 2013 runcluvfy.sh
-rwxr-xr-x. 1 grid oinstall 3268 8æ 26 2013 runInstaller
drwxr-xr-x. 2 grid oinstall 4096 8æ 26 2013 sshsetup
drwxr-xr-x. 14 grid oinstall 4096 8æ 26 2013 stage
-rw-r--r--. 1 grid oinstall 500 8æ 27 2013 welcome.html
执行: ./ runInstaller
... ...