分类:
2014-09-03 13:23:25
概述
本文详细介绍了如何在基于Solaris 10 X86的节点上来安装Oracle 10g RAC的具体步骤和注意事项,同时也提供了具体的命令操作以及安装过程的截屏,最后是创建一个Cluster数据库的具体步骤。
系统环境
两台Sun的基于 AMD64的机器(V20Z)
一台Sun的Storage(3510)
一个百兆交换机
Solaris 10 X86 1/06
Oracle 10g 10.1.0.3 EE RAC for Solaris X86 with Oracle patch 4186426
其中两个V20Z节点通过光纤卡直接和Storage3510相连接
安装前期配置
本文中的Oracle RAC的安装是基于两个节点的配置,很多步骤需要在两个节点(RAC1 和RAC2)上都要完成,以下是安装Oracle RAC前需要做的准备工作:
1,在所有节点上创建Oracle用户组和帐号
bash-3.00# groupadd -g 100 oinstall
bash-3.00# groupadd -g 101 dba
bash-3.00# mkdir -p /export/home
bash-3.00# useradd -u 200 -g oinstall -G dba -s /usr/bin/bash -d /export/home/oracle -m oracle
bash-3.00# id -a oracle
uid=200(oracle) gid=100(oinstall) groups=101(dba)
添加完用户后需要为oracle用户设置密码,使得帐号生效。
2,在所有节点上验证用户nobody是否存在
bash-3.00# id -a nobody
uid=60001(nobody) gid=60001(nobody) groups=60001(nobody)
3,为所有的节点设置网络地址
对于每个节点,Oracle RAC需要设置一个公共的网络地址,一个虚拟的未用网络地址和一个私有网络地址,对于公共的网络地址,这里假设已经在安装系统时已经配置完成,即将bge0配置为公共地址,以下是配置其他网络地址的具体步骤,
bash-3.00# ifconfig bge0:1 plumb up
bash-3.00# ifconfig bge0:1 10.0.100.212 netmask 255.255.255.0
bash-3.00# ifconfig bge1 plumb up
bash-3.00# ifconfig bge1 192.168.0.12 netmask 255.255.255.0
可以将这些步骤写入/etc/profile,使得每次系统启动后,这些地址自动就配置完成。最终的网络配置为:
bash-3.00# ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843
inet 10.0.100.222 netmask ffffff00 broadcast 10.0.100.255
ether 0:9:3d:0:75:20
bge0:1: flags=1000843
inet 10.0.100.212 netmask ffffff00 broadcast 10.0.100.255
bge1: flags=1000803
inet 192.168.0.12 netmask ffffff00 broadcast 192.168.0.255
ether 0:9:3d:0:75:21
bash-3.00$ netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.0.0 192.168.0.11 U 1 0 bge1
10.0.100.0 10.0.100.221 U 1 47 bge0
10.0.100.0 10.0.100.211 U 1 0 bge0:1
224.0.0.0 10.0.100.221 U 1 0 bge0
127.0.0.1 127.0.0.1 UH 23 25657 lo0
4,在所有节点上,生成文件/etc/hostname.bge0 和/etc/hostname.bge1
具体内容如下,并需将网络配置写入文件/etc/hosts
bash-3.00$ more /etc/host*
::::::::::::::
/etc/hostname.bge0
::::::::::::::
RAC1
::::::::::::::
/etc/hostname.bge1
::::::::::::::
rac_priv_host1
::::::::::::::
/etc/hosts
::::::::::::::
#
# Internet host table
#
127.0.0.1 localhost
10.0.100.221 RAC1.prc.sun.com RAC1
10.0.100.222 RAC2.prc.sun.com RAC2
10.0.100.211 RAC1-VIR.prc.sun.com RAC1-VIR
10.0.100.212 RAC2-VIR.prc.sun.com RAC2-VIR
192.168.0.11 rac_priv_host1
192.168.0.12 rac_priv_host2
5,配置信任主机
Oracle RAC需要将所有节点配置成为信任主机,即在所有节点上生成具有以下内容的文件/etc/hosts.equiv,并进行测试
bash-3.00$ more /etc/hosts.equiv
RAC1.prc.sun.com oracle
RAC2.prc.sun.com oracle
RAC1 oracle
RAC2 oracle
Thu Jan 19 02:12:12 CST 2006
RAC2
6,在所有节点上创建Oracle RAC安装目录并设置权限
bash-3.00# mkdir -p /u01/app/oracle/product/10.1.0.3/oracle
bash-3.00# chown -R oracle:oinstall /u01/app/oracle /product/10.1.0.3/oracle
bash-3.00# chmod -R 755 /u01/app/oracle/product/10.1.0.3/oracle
bash-3.00# mkdir -p /u01/crs/oracle/product/10.1.0.3/crs
bash-3.00# chown -R oracle:oinstall /u01/crs/oracle/product/10.1.0.3/crs
bash-3.00# chmod -R 755 /u01/crs/oracle/product/10.1.0.3/crs
为安装Oracle CRS在所有节点上设置Oracle的环境变量在$HOME/.profile,$HOME为用户oracle的起始目录
bash-3.00$ cat .profile
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/crs/oracle/product/10.1.0.3/crs
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/ccs/bin:/bin:/usr/openwin/bin
export PATH
在所有节点上将以下系统设置写入文件/etc/system
set semsys:seminfo_semmni 100
set semsys:seminfo_semmns 1024
set semsys:seminfo_semmsl 256
set semsys:seminfo_semvmx 32767
set shmsys:shminfo_shmmax 4294967295
set shmsys:shminfo_shmmin 100
7,存储设备的配置:
在这里,我们用了Sun Storage3510来做为安装Oracle 10g RAC的设备,并将其配置为raw partitions,以下为具体的需求:
Oracle和Oracle CRS需要的Raw Partitions数目和大小
从以上的表格可以看出,对于两个节点的Oracle RAC,我们需要在存储器上配置17个raw partitions(创建Oracle数据库需要15个,安装Oracle CRS需要2个),由于每个Solaris的磁盘最多只能有7个slice供使用(slice 2,8,9是不能用做分区的),所以需要在Storage 3510上来分多个磁盘来满足需要,然后在Solaris中对每个盘进行分区,注意的是为了避免CRS或是Oracle数据库文件覆盖磁盘中的分区表,在分slices时不能从cylinder 0(比如slice 2)开始。
由于3510的分区在Solaris中的设备名为一个很长的字符串,为了更方便的表示这些设备,这里采用了创建连接到这些设备的方法,并设置相应的属性和权限,这两个设备是为Oracel CRS安装用的,见以下步骤:
安装Oracle CRS
当以上所有的配置完成后,我们就可以进行Oracle CRS的安装了
启动Oracle CRS安装脚本,注意参数-ignoreSysPrereqs是为了忽略版本检查带来的错误,
以下是具体的安装步骤和图示,
1,欢迎界面,直接点击next
2,指定详细目录和凭证
此时会弹出一个提示栏要求在RAC1上运行一个脚本,如下:
chmod: WARNING: can't access /var/opt/oracle
Creating the Oracle inventory pointer file (/var/opt/oracle/oraInst.loc)
Changing groupname of /u01/crs/oracle/oraInventory to oinstall.
2,指定安装文件的路径,缺省的安装路径来自于我们先前在$HOME/.profile的设置
3,选择语言---->点击下一步
4,配置cluster
5,指定网络接口的用途,这里我们指定bge0做为公共网络接口,bge1做为私有网络接口
6,指定OCR的路径为/ORACLE/ocr
7,指定Vote的路径为 /ORACLE/ocr
此时需要用户在所有节点上以root身份来运行脚本orainstRoot.sh,如下:
Creating the Oracle inventory pointer file (/var/opt/oracle/oraInst.loc)
Changing groupname of /u01/crs/oracle/oraInventory to oinstall.
chmod: WARNING: can't access /var/opt/oracle
Creating the Oracle inventory pointer file (/var/opt/oracle/oraInst.loc)
Changing groupname of /u01/crs/oracle/oraInventory to oinstall.
8,然后会出现安装配置的小结界面,点击下一步后就进入安装阶段:
9,安装过程,从图中我们看到CRS安装程序自动向另一个节点RAC2拷贝文件
在安装后期,会提示用户在所有节点上以 root身份来运行root.sh,如下:
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/crs/oracle/product/10.1.0.3/crs
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Checking to see if Oracle CRS stack is already up...
Setting the permissions on OCR backup directory
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/crs/oracle/product/10.1.0.3' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
clscfg: EXISTING configuration version 2 detected.
clscfg: version 2 is 10G Release 1.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
node 1: rac1 rac_priv_host1 rac1
node 2: rac2 rac_priv_host2 rac2
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Adding daemons to inittab
Preparing Oracle Cluster Ready Services (CRS):
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/crs/oracle/product/10.1.0.3/crs
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Checking to see if Oracle CRS stack is already up...
Setting the permissions on OCR backup directory
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/crs/oracle/product/10.1.0.3' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
node 1: rac1 rac_priv_host1 rac1
node 2: rac2 rac_priv_host2 rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /ORACLE/vote
Successful in setting block0 for voting disk.
Format complete.
Adding daemons to inittab
Preparing Oracle Cluster Ready Services (CRS):
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
以上步骤完成后,整个CRS的安装就完成了
我们可以做一些测试来验证CRS的安装是否正确
/u01/crs/oracle/product/10.1.0.3/crs/bin
rac1 1
rac2 2
同时要注意,当Oracle CRS安装完成后,以下进程是必须要在运行状态的:
1,oprocd – Cluster的进程监控器
2,evmd – 事件管理守护进程
3,ocssd – Cluster节点关系管理进程
4, crsd -- 高可靠性恢复和管理操作进程
安装Oracle10g数据库
安装好CRS后,就可以在此基础上安装Oracle 10g 了,由于Oracle 10g和Solaris 10 X86在内存管理方式有些不兼容,对于双CPU的V20Z机器,我们需要将一个CPU暂时离线,等Oracle安装好后可以将离线的CPU重新起动,暂停一个CPU的步骤如下:
0 on-line since 01/19/2006 16:47:51
1 off-line since 01/19/2006 18:48:26
为安装Oracle 10g在所有节点上重新设置Oracle的环境变量在$HOME/.profile,$HOME为用户oracle的起始目录
bash-3.00$ cat .profile
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/crs/oracle/product/10.1.0.3/oracle
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/ccs/bin:/bin:/usr/openwin/bin
export PATH
开始安装Oralce 10g,如下,同样, 参数-ignoreSysPrereqs是为了忽略版本检查带来的错误
以下为具体的步骤和截屏
1,欢迎界面后就进入到指定安装路径界面,缺省路径来自于$HOME/.profile的设置
3,制定Cluster安装模式,在这里我们选中两个节点,RAC1和RAC2
4,接下来的界面中选择安装类型为”Enterprise Edition”,在其后的数据库配置中,这里选择先不创建一个起始数据库,本文中将在Oracle 10g安装好后再创建一个数据库