ITPub博客

首页 > 数据库 > Oracle > 在oracle linux 5.6上安装oracle 11g RAC

在oracle linux 5.6上安装oracle 11g RAC

原创 Oracle 作者:oracle_zsx 时间:2013-08-22 12:46:06 0 删除 编辑
1、
vi /etc/hosts
192.168.20.41           rac1
192.168.20.42           rac2
10.0.0.41               rac1-priv
10.0.0.42               rac2-priv
192.168.20.43           rac1-vip
192.168.20.44           rac2-vip
192.168.20.45           rac-scan

2、
私有ip要写到eth1中      (两个节点)

3.
install rpms (光盘yum源安装) (两个节点都执行)                                         #
A.mount 光盘
[root@rac1 ~]# mkdir -p /mnt/cdrom                                         #
[root@rac1 ~]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only                      #                                       # 
B.配置yum源                                                   #
[root@rac1 yum.repos.d]# cat>>/etc/yum.repos.d/rhel-source.repo< [Server]
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0
EOF
4、
编辑脚本  (两个节点)
vi pack.sh
#!bin/bash
#start install required packages
echo "start installing requiredpackages"
yum -y install binutils-2.17.50.0.6*
yum -y install compat-libstdc++-33-3.2.3*
yum -y install elfutils-libelf-0.125*  
yum -y install elfutils-libelf-devel-0.125*
yum -y install elfutils-libelf-devel-static-0.125*
yum -y install gcc-4.1.2*
yum -y install gcc-c++-4.1.2*
yum -y install glibc-2.5-24*
yum -y install glibc-common-2.5*
yum -y install glibc-common-2.5*
yum -y install glibc-devel-2.5*
yum -y install glibc-headers-2.5*
yum -y install ksh-20060214*
yum -y install libaio-0.3.106*
yum -y install libaio-devel-0.3.106*
yum -y install libgcc-4.1.2*
yum -y install libgomp-4.1.2*
yum -y install libstdc++-4.1.2*
yum -y install libstdc++-devel-4.1.2*
yum -y install make-3.81*
yum -y install sysstat-7.0.2*
yum -y install unixODBC-2.2.11*
yum -y install unixODBC-devel-2.2.11*
yum -y install pdksh*
5、
安装rpm包(两个节点)
[root@rac1 ~]# chmod +x pack.sh
[root@rac1 ~]# sh pack.sh

6、
在解压的grid包中找到rpm路径下这个包安装(两个节点)
rpm -ihv cvuqdisk-1.0.9-1.rpm  
注意:
grid安装包只需要传到节点1上。
找到节点1中的这个包传到节点2.
 
7、
DISABLE FIREWALL(两个节点)
#service iptables stop
#chkconfig iptables off
8、
DISABLE SELINUX(两个节点)
vi /etc/selinux/config
SELinux=disable

9、 Create System Groups and Users(两个节点)
# /usr/sbin/groupadd -g 1001 oinstall
# /usr/sbin/groupadd -g 1002 dba
# /usr/sbin/groupadd -g 1003 oper
# /usr/sbin/groupadd -g 1021 asmadmin
# /usr/sbin/groupadd -g 1022 asmdba
# /usr/sbin/groupadd -g 1023 asmoper
# /usr/sbin/useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid
# /usr/sbin/useradd -g oinstall -G dba,oper,asmdba oracle
10、
用root用户给oracle和grid分配密码 (两个节点)
passwd oracle
passwd grid

11、
编辑.bash_profile(两个节点)
su - grid  
vi .bash_profile
export ORACLE_HOME=/u01/app/11.2.0/grid
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=+ASM1
export PATH=$PATH:$ORACLE_HOME/bin
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"
export PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'
stty erase ^H

12、
(两个节点)
su - oracle  
vi .bash_profile
export ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=$ORACLE_BASE/products/11.2.0
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=gis1
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_BASE/products/crs/bin:.
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"
export PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'
stty erase ^H

13、
#创建目录     (两个节点)
#mkdir /u01
#mkdir /u02
#chown -R oracle:oinstall /u02
#chown -R grid:oinstall /u01
#su - grid
#mkdir -p $ORACLE_HOME
#su - oracle
#mkdir -p $ORACLE_BASE
#mkdir -p $ORACLE_HOME
 
14、
(两个节点)
#vi /etc/profile 添加:   
if [ \$USER = "grid" ]; then
if [ \$SHELL = "/bin/bash" ]; then
   ulimit -p 16384
   ulimit -n 65536
else
   ulimit -u 16384 -n 65536
fi
   umask 022
fi
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/bash" ]; then
   ulimit -p 16384
   ulimit -n 65536
else
   ulimit -u 16384 -n 65536
fi
   umask 022
fi
 

15、
Checking Resource Limits (两个节点)
#vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
 
16、
Configuring Kernel Parameters(两个节点)
#vi /etc/sysctl.conf
##add for rac
kernel.shmall = 2097152
kernel.shmmax = 17179869184
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
 
17、
时间同步(两个节点)
方法二:使用CTSS
################################
集群时间同步服务:
配置集群时间同步服务 — (CTSS):
# /sbin/service ntpd stop
# chkconfig ntpd off
# chkconfig --list ntpd
# mv /etc/ntp.conf  /etc/ntp.conf.org
# rm /var/run/ntpd.pid
 
18、
配置/etc/hosts(两个节点),如果第一步做了,则不做
# vi /etc/hosts
# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               rac1 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
#public
192.168.50.100   rac1
192.168.50.101   rac2
#private
10.0.0.100   rac1-priv
10.0.0.101   rac2-priv
#vip
192.168.50.110   rac1-vip
192.168.50.111   rac2-vip
#scan
192.168.50.150   rac-scan
注意:将private IP要写到eth1 (两个节点)
 
19、
配置SSH互通 (两个节点)
在 rac1、rac2上执行(oracle、grid、root用户都需要执行)
#su - oracle             --oracle 用户
ssh-keygen -t rsa
ssh-keygen -t dsa
#su - grid               --grid 用户
ssh-keygen -t rsa
ssh-keygen -t dsa
#su –                    --root用户
ssh-keygen -t rsa
ssh-keygen -t dsa

20、
在 rac1 上执行
#su – root
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
#su - oracle
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
#su - grid
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
 

21、
在每个节点上测试连接  (两个节点都要确认)
#su -
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date   
#su - oracle
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
#su - grid
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
结果如下:
grid@rac1:/home/grid>ssh rac1 date
Thu May 16 16:29:51 CST 2013
grid@rac1:/home/grid>ssh rac2 date
Thu May 16 16:29:57 CST 2013
grid@rac1:/home/grid>ssh rac1-priv date
The authenticity of host 'rac1-priv (10.0.0.41)' can't be established.
RSA key fingerprint is 74:08:14:a8:6d:bb:b0:6f:f9:1f:9c:e6:06:09:9a:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac1-priv,10.0.0.41' (RSA) to the list of known hosts.
Thu May 16 16:30:03 CST 2013
grid@rac1:/home/grid>ssh rac1-priv date
Thu May 16 16:30:04 CST 2013
grid@rac1:/home/grid>ssh rac1-priv date
Thu May 16 16:30:05 CST 2013
grid@rac1:/home/grid>ssh rac2-priv date
The authenticity of host 'rac2-priv (10.0.0.42)' can't be established.
RSA key fingerprint is 74:08:14:a8:6d:bb:b0:6f:f9:1f:9c:e6:06:09:9a:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2-priv,10.0.0.42' (RSA) to the list of known hosts.
Thu May 16 16:30:12 CST 2013
grid@rac1:/home/grid>ssh rac2-priv date
Thu May 16 16:30:14 CST 2013
grid@rac1:/home/grid>ssh rac2-priv date
Thu May 16 16:30:14 CST 2013
grid@rac1:/home/grid>
 

22、
配置共享存储   (这一步是在服务器中做的,注意在自己对应的目录里面做)
# cd /vmfs/volumes/datastore1/SHAREDISK/szsc/VM03009   (这个目录不一定全部正确,要看服务器上是不是有)
#vmkfstools -c 2048m -a lsilogic -d eagerzeroedthick  data01_2g.vmdk
#vmkfstools -c 2048m -a lsilogic -d eagerzeroedthick  data02_2g.vmdk
#vmkfstools -c 2048m -a lsilogic -d eagerzeroedthick  data03_2g.vmdk
#vmkfstools -c 512m  -a lsilogic -d eagerzeroedthick  dbfs01_0.5g.vmdk
#vmkfstools -c 1024m -a lsilogic -d eagerzeroedthick  reco01_1g.vmdk
 
23、
共享磁盘上创建完成之后,去虚拟机设置里面,将这五块磁盘添加上来  
(两个虚拟机都要做,注意是自己的目录中,不要用别人的)
 
24、
进入服务器中对应的自己的虚拟机上做   (不要改别人的,要注意)
#cd /vmfs/volumes/datastore1/VM03001
#vi VM03001.vmx
#cd /vmfs/volumes/datastore1/VM03002
#vi VM03002.vmx
修改虚拟机配置文件,增加如下内容:
disk.UUIDEnable="TRUE"
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"
#scsi1.sharedBus = "none"  注释掉改行,使用上面的值
 

25.
磁盘检查   (两个节点)
[root@rac1 ~]# ls -l /dev/sd*
brw-r----- 1 root disk 8,  0 Jan  7 13:39 /dev/sda
brw-r----- 1 root disk 8,  1 Jan  7 13:39 /dev/sda1
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda2
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda3
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda4
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda5
brw-r----- 1 root disk 8, 16 Jan  7 13:39 /dev/sdb
brw-r----- 1 root disk 8, 32 Jan  7 13:39 /dev/sdc
brw-r----- 1 root disk 8, 48 Jan  7 13:39 /dev/sdd
brw-r----- 1 root disk 8, 64 Jan  7 13:39 /dev/sde
brw-r----- 1 root disk 8, 80 Jan  7 13:39 /dev/sdf
[root@rac2 ~]# ls -l /dev/sd*
brw-r----- 1 root disk 8,  0 Jan  7 13:39 /dev/sda
brw-r----- 1 root disk 8,  1 Jan  7 13:39 /dev/sda1
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda2
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda3
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda4
brw-r----- 1 root disk 8,  2 Jan  7 13:39 /dev/sda5
brw-r----- 1 root disk 8, 16 Jan  7 13:39 /dev/sdb
brw-r----- 1 root disk 8, 32 Jan  7 13:39 /dev/sdc
brw-r----- 1 root disk 8, 48 Jan  7 13:39 /dev/sdd
brw-r----- 1 root disk 8, 64 Jan  7 13:39 /dev/sde
brw-r----- 1 root disk 8, 80 Jan  7 13:39 /dev/sdf
 
26、
配置UDEV
检查UDEV包
UDEV Mapping SCSI:
[root@rac1 ~]# rpm -qa|grep udev
udev-095-14.24.el5
[root@rac2 ~]# rpm -qa|grep udev
udev-095-14.24.el5
 
27、
首先确认是 Linux 5.0及以上版本
[root@rac1 ~]# cat /etc/issue
Oracle Linux Server release 5.6
[root@rac2 ~]# cat /etc/issue
Oracle Linux Server release 5.6
2.4.3.添加记录到/etc/scsi_id.config
#vi /etc/scsi_id.config
options=-g
注:把options=-b注释掉,加入options=-g,该选项保证所有连接的SCSI设备返回一个UUID.如果该文件不存在,可以手动创建一个.

28、
配置裸设备      (两个节点)
[root@rac1 ~]# /bin/raw /dev/raw/raw1 /dev/sdb
/dev/raw/raw1:  bound to major 8, minor 16
[root@rac1 ~]#  /bin/raw /dev/raw/raw2 /dev/sdc
/dev/raw/raw2:  bound to major 8, minor 32
[root@rac1 ~]# /bin/raw /dev/raw/raw3 /dev/sdd
/dev/raw/raw3:  bound to major 8, minor 48
[root@rac1 ~]# /bin/raw /dev/raw/raw4 /dev/sde
/dev/raw/raw4:  bound to major 8, minor 64
[root@rac1 ~]# /bin/raw /dev/raw/raw5 /dev/sdf
Last login: Thu May 16 15:07:11 2013 from 192.168.20.54
[root@rac1 ~]#
[root@rac1 ~]#
[root@rac1 ~]# /bin/raw /dev/raw/raw5 /dev/sdf
/dev/raw/raw5:  bound to major 8, minor 80
[root@rac1 ~]# raw -qa
/dev/raw/raw1:  bound to major 8, minor 16
/dev/raw/raw2:  bound to major 8, minor 32
/dev/raw/raw3:  bound to major 8, minor 48
/dev/raw/raw4:  bound to major 8, minor 64
/dev/raw/raw5:  bound to major 8, minor 80

29、
修改/etc/udev/rules.d/60-raw.rules文件  (两个节点)
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add",KERNEL=="/dev/sdb",  RUN+="/bin/raw /dev/raw/raw1 %N",OWNER="grid", GROUP="oinstall", MODE="775"
ACTION=="add",KERNEL=="/dev/sdc",  RUN+="/bin/raw /dev/raw/raw2 %N",OWNER="grid", GROUP="oinstall", MODE="775"
ACTION=="add",KERNEL=="/dev/sdd",  RUN+="/bin/raw /dev/raw/raw3 %N",OWNER="grid", GROUP="oinstall", MODE="775"
ACTION=="add",KERNEL=="/dev/sde",  RUN+="/bin/raw /dev/raw/raw4 %N",OWNER="grid", GROUP="oinstall", MODE="775"
ACTION=="add",KERNEL=="/dev/sdf",  RUN+="/bin/raw /dev/raw/raw5 %N",OWNER="grid", GROUP="oinstall", MODE="775"
KERNEL=="raw*", WNER="grid", GROUP="oinstall", MODE="775"
chown grid:oinstall /dev/raw/raw*

30、
RAW盘的绑定(两个节点)
# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb
/dev/raw/raw2 /dev/sdc
/dev/raw/raw3 /dev/sdd
/dev/raw/raw4 /dev/sde
/dev/raw/raw5 /dev/sdf
 
31、
RAW盘授权(两个节点)
# vi /etc/rc.local
#ADD
/bin/raw /dev/raw/raw1 /dev/sdb
/bin/raw /dev/raw/raw2 /dev/sdc
/bin/raw /dev/raw/raw3 /dev/sdd
/bin/raw /dev/raw/raw4 /dev/sde
/bin/raw /dev/raw/raw5 /dev/sdf
chown grid:oinstall /dev/raw/raw*    //开机自动授权
chmod 775 /dev/raw/raw*
 
32
在安装grid之前检查共享磁盘
grid@szscdb1:/u01/grid>./runcluvfy.sh stage -post hwos -n rac1,rac2  -verbose
grid@szscdb1:/u01/grid>./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
遇到DNS错误的时候可以忽略
 
33、
成功通过后,开始装grid
grid@rac1:/u01/grid>./runInstaller
 
34
配置ASM(图形化界面,省略)
# su  - grid
#asmca
 
35
安装数据库软体
 

36
用dbca创建数据库。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29107230/viewspace-769030/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-08-22

  • 博文量
    25
  • 访问量
    134534