使用Vmware EXS Server 3.5安装RAC

来源:互联网 发布:阿里云总部在哪里 编辑:程序博客网 时间:2024/06/05 03:47
 

说明:

本文档演示如何在Vmware EXS Server 3.5环境下,使用虚拟机技术安装RHEL 4.8 x86_64系统,然后搭建两个节点的oracle 10g RAC的过程。

仅供学习测试参考使用。

 

一、RAC简单知识

RAC的定义:指借助于“某种集群件产品”搭建出来的一个“多实例,单数据库”的环境。

(一)RAC环境拓扑图:

图中硬件用Hn表示,软件用Sn表示,其中n不代表数量,而是代表种类。

 

1、硬件环境:

a、节点(主机)H1

图中所示,两个节点或主机

b、网卡 H4:

每个主机至少有两块网卡,图中H4表示两块网卡:一个网卡用于对外提供服务,对应ip称为public ip,用实线表示;一个网卡用于集群内部通信,对应ip称为private ip,用虚线表示。

除public ip和private ip之外,每个节点还有第3个ip,称为VIP(virtual ip),真正对外提供服务的ip。当主机节点宕机,此节点的vip会转移到其他幸存的节点上,继续对外提供服务。

c、网络交换机H5和H6:

private ip的网卡连接到H5上,这个交换机只用于节点之间传递心跳数据和cache fusion数据,因此不要再连接其他设备。也就是说,这个网络是完全隔离的,oracle专用,至少G级交换机。

public ip的网卡连接到H6上,其他需要访问数据库的设备也连接到这个交换机上。dba日常维护也通过这个交换机。

d、共享存储H3:

整个RAC环境中,所有节点共享一个存储,即所有实例共享一个数据库。真实环境中,每个节点主机都需要安装HBA卡(图中H2),通过光纤线和光纤模块或光纤交换机与共享存储连接。

 

2、软件环境:

a、操作系统

每个节点的操作系统必须一致,包括小版本和补丁包必须一致。

b、集群件

集群件是安装在操作系统之上的一个特殊软件,负责管理整个集群环境中的硬件资源,并为上层的RAC集群提供基础服务。

集群件和OS之间的关系就像在单机环境下应用程序和OS的关系:在单机环境中,硬件资源是由OS内核管理的,应用程序不能直接访问硬件,必须通过OS内核提供的接口来间接访问硬件。OS除了要完成用户请求,还要通过进程调度等机制来控制多进程对资源的使用。

在集群环境下,硬件尤其存储设备是共享使用,不仅需要协调每台主机内多进程的共享使用,还要协调主机间的共享使用,仅靠传统的OS是无法控制的,因此就有了集群件。

可以把整个集群详细成一台虚拟的计算机,集群件就是这台计算机的操作系统,RAC是其上的一个应用。

从10g开始,oracle提供了oracle clusterware,并且提供了api接口,能够为其他软件提供HA功能。

c、集群文件系统

集群中所有实例共享一个数据库。data files、redo logs、control files、parameter files必须存放在共享存储上,以保证所有节点都能访问。这就需要对节点进行控制,普通的文件系统不具备这种集群功能,必须采用特殊的集群文件系统。

10g以前,oracle只提供了对raw device的支持,没有提供集群文件系统,因此需要选择第三方产品。从10g开始,oracle提供了两种集群文件系统:OCFS和ASM。OCFS目前已经开源,oracle大力推荐ASM。本测试环境中,同时演示了ocfs、asm、raw device的用法。

d、数据库软件

版本10.2.0.1,安装补丁升级到10.2.0.5

 

3、逻辑层

a、存储层

b、网络层

3个网络:public网卡接入的网络,对外提供服务;private网卡组成的网络,用于心跳和cache fusion;存储网络,提供共享存储。

c、集群件层

d、应用层

整个应用层由若干CRS resource组成,一个CRS resource通常是一个进程,或者由一组进程组成的一个完整服务。集群之所以能够提供高可用,是因为CRS对运行在上面的应用进行监视,并在发生异常时进行重启、切换等干预手段。这些被监控的对象就叫CRS resource。这些resource是在rac安装过程中自动或手动创建,并注册登记到CRS中,以metadata的形式记录在OCR磁盘上,包括resource的名称、如何启动、停止、如何检查监控等配置信息。

oracle把CRS resource分为两类:nodeapps和database-related resource

nodeapps:GSD(Global Services Daemon)、ONS(Oracle Notification Service)、VIP(Virtual Internet Protocol)、Listener (一个节点上只有一个)

database-related-resource:database、instance、service (和数据库相关,不受节点限制)

 

4、集群要解决的问题

a、并发控制:DLM

b、健忘症:OCR

c、脑裂:VOTINGDISK

d、IO隔离:软件方式

 

二、安装任务列表

 

三、安装规划

(一)网络规划

(二)存储方案选择

oracle推荐的顺序是ASM-OCFS-NFS-RAW

note:10g clusterware的voting disk、OCR目前只能创建在raw device或ocfs上。数据库文件可以存放上上述任何一种存储方案中。

本测试环境将voting disk和OCR即存放在ocfs2上,又存放在raw device上,以实现冗余。数据文件使用ASM存放。

ocr用来解决amnesia问题,votingdisk用来解决split brain问题。这两个文件必须放在共享存储上。

(三)文件布局

(四)磁盘分区规划

 

四、安装准备

(一)安装配置节点1

1、配置虚拟机

打开VC client,配置第一个虚拟机:

4个cpu,2个网卡,1536M内存,20G硬盘空间

 

ps:VMware Server(旧名称 VMware GSX Server)或workstation版本

创建虚拟机时只有一个网卡(网络类型选择桥接),因此需要再添加一块网卡,网络类型同样选择桥接。

 

2、安装操作系统:

(1)主机名称:zhh1

(2)配置两个网卡的ip:

eth0:ip 192.168.5.235 netmask 255.255.255.0 gateway 192.168.5.1

eth1:ip 10.0.0.2 netmask 255.255.255.0

(3)关闭防火墙和不启用selinux

(4)选择安装的包:

Desktops默认

Applications全不选择

Servers全不选择

Development选择development tools、x software development、gnome software development、compatibility arch development support、legacy software development均默认

System选择administration tools、system tools、compatibility arch support,其中system tools增加sysstat包。

 

3、配置oracle安装环境

(1)检查必须的包

(a)安装oracle database软件所需要的包

不同的OS需要的包不一样,请参考oracle安装手册,以下是RHEL4.8 x86_64所需要的包

binutils-2.15.92.0.2-21.x86_64.rpm

compat-db-4.1.25-9.i386.rpm

compat-db-4.1.25-9.x86_64.rpm

control-center-2.8.0-12.rhel4.5.x86_64.rpm

gnome-libs-1.4.1.2.90-44.1.x86_64.rpm

libstdc++-devel-3.4.6-3.i386.rpm 

libstdc++-devel-3.4.6-3.x86_64.rpm

xscreensaver-4.18-5.rhel4.11.x86_64.rpm

compat-gcc-32-3.2.3-47.3.x86_64.rpm

compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm

gcc-3.4.6-3.x86_64.rpm

gcc-c++-3.4.6-3.x86_64.rpm

glibc-2.3.4-2.25.i686

glibc-2.3.4-2.25.x86_64.rpm

glibc-common-2.3.4-2.25.x86_64.rpm

glibc-devel-2.3.4-2.25.i386.rpm

glibc-devel-2.3.4-2.25.x86_64.rpm

glibc-headers-2.3.4-2.25.x86_64.rpm

glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm

libaio-0.3.105-2.i386.rpm

libaio-0.3.105-2.x86_64.rpm

sysstat-5.0.5-11.rhel4.x86_64.rpm

compat-libstdc++-33-3.2.3-47.3.i386.rpm

compat-libstdc++-33-3.2.3-47.3.x86_64.rpm

libgcc-3.4.6-3.i386.rpm

libgcc-3.4.6-3.x86_64.rpm

libstdc++-3.4.6-3.i386.rpm

libstdc++-3.4.6-3.x86_64.rpm

make-3.80-6.EL4.x86_64.rpm

pdksh-5.2.14-30.3.x86_64.rpm

xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.i386.rpm

xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.x86_64.rpm

 

共计32个包

如果在选择包的时候,安装上面说的进行选择,上面这些包都应该安装了。

可以使用下面命令进行检查:

[root@zhh1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' \

binutils \

compat-db \

compat-gcc-32 \

compat-gcc-32-c++ \

compat-libstdc++-33 \

control-center \

gcc \

gcc-c++ \

glibc \

glibc-common \

glibc-devel \

glibc-headers \

glibc-kernheaders \

gnome-libs \

libaio \

libgcc \

libstdc++-devel \

libstdc++ \

make \

pdksh \

sysstat \

xorg-x11-deprecated-libs \

xscreensaver

 

 

rpm -Uvh glibc-kernheaders-2.4-9.1.103.EL.i386.rpm

rpm -Uvh glibc-headers-2.3.4-2.43.i386.rpm

rpm -Uvh glibc-devel-2.3.4-2.43.i386.rpm

rpm -Uvh compat-gcc-32-*

rpm -Uvh libstdc++-devel-3.4.6-11.i386.rpm

rpm -Uvh gcc-3.4.6-11.i386.rpm

rpm -Uvh gcc-c++-3.4.6-11.i386.rpm

rpm -Uvh sysstat-5.0.5-25.el4.i386.rpm

根据查找结果,在光盘或iso中找到缺少的包并安装。

(b)本环境使用asmlib创建asm,因此需要安装asm的三个包,注意选择对应操作系统核心的版本。

下载地址:http://www.oracle.com/technetwork/topics/linux/downloads/rhel4-092650.html

oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.x86_64.rpm 

oracleasmlib-2.0.4-1.el4.x86_64.rpm 

oracleasm-support-2.1.3-1.el4.x86_64.rpm

 

(c)另外本环境还演示了使用ocfs2集群文件系统的用法,因此也需要安装相关的包。如果不使用ocfs管理集群文件,可以不安装。

下载地址:

http://oss.oracle.com/projects/ocfs2/files/RedHat/RHEL4/x86_64/1.2.9-1/2.6.9-89.EL/

http://oss.oracle.com/projects/ocfs2-tools/files/RedHat/RHEL4/x86_64/1.2.7-1/

ocfs2-2.6.9-89.ELsmp-1.2.9-1.el4.x86_64.rpm

ocfs2-tools-1.2.7-1.el4.x86_64.rpm

ocfs2console-1.2.7-1.el4.x86_64.rpm 

 

(2)网络设置

vi  /etc/hosts

 

127.0.0.1       localhost

 

192.168.5.235   zhh1

192.168.5.233   zhh1-vip

10.0.0.2        zhh1-priv

 

192.168.5.236   zhh2

192.168.5.234   zhh2-vip

10.0.0.3        zhh2-priv

 

192.168.12.22 dbp

192.168.12.24 dbs

 

10.0.0.22 dbp-priv

10.0.0.24 dbs-priv

192.168.12.23 dbp-vip

192.168.12.25 dbs-vip

 

192.168.12.22 rac1

192.168.12.24 rac2

 

10.0.0.22 rac1-priv

10.0.0.24 rac2-priv

192.168.12.23 rac1-vip

192.168.12.25 rac2-vip

 

(1)需要注意的是:节点名不能出现在回环地址中,即127.0.0.1 后面不能有zhh1。

(2)关于vip

当一个节点发生故障时,与其关联的 VIP 将被自动故障切换到另外某个节点上。当出现这种情况时,会发生两件事。

新的节点重新进行地址解析,显示该地址的一个新的 MAC 地址。对于直接连接的客户端,这通常使它们在连接旧地址时出现错误。

随后发送到 VIP 的数据包前往新的节点,该节点将把错误的 RST 数据包返回客户端。这导致客户端立即收到错误信息。

这意味着,当客户端向现在已经停机的节点发出 SQL 时,或者在连接状态下遍历地址列表时,客户端不会等待很长的 TCP/IP 超时(大约 10 分钟),而是接收到一个 TCP 重置信息。就 SQL 来说,该信息为 ORA-3113。对于连接,使用 tnsname 中的下一个地址。

如果不使用 VIP,连接停用节点的客户端经常要等待 10 分钟的 TCP 超时,然后才收到错误信息。因此,不使用 VIP 您就不会真正拥有好的高可用性解决方案

 

(3)关闭不必要的服务(不是必须)

service sendmail off

service cups off

service smartd off

service portmap off

service nfslock off

根据需求,设置开机不需要启动的服务,以节省系统资源。

chkconfig sendmail off

chkconfig cups off

chkconfig smartd off

chkconfig portmap off

chkconfig nfslock off

 

(4)创建Oracle用户和DBA组

要确保每个节点UID和GID相同

# groupadd -g 500 dba

# useradd -u 500 -g dba oracle

# passwd oracle

# mkdir /usr/oracle

# chown oracle:dba /usr/oracle

(5) 配置oracle用户资源限制

vi /etc/security/limits.conf

 

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

(6)配置内核参数

vi /etc/sysctl.conf

 

kernel.shmall = 2097152

kernel.shmmax = 568435456

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

(7)配置oracle用户环境变量:修改oracle用户的.bash_profile

vi  .bash_profile

 

ORACLE_SID=rac1

ORACLE_BASE=/usr/oracle

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1

LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib:$ORACLE_HOME/ctx/lib:/usr/lib:/lib:/usr/local/lib

TNS_ADMIN=$ORACLE_HOME/network/admin

ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

ORACLE_TERM=xterm

NLS_LANG="Simplified Chinese"_China.ZHS16GBK

PATH=$PATH:/home/oracle/OPatch:/bin:/usr/bin:/usr/local/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/ctx/bin

umask 022

export ORACLE_SID ORACLE_BASE ORACLE_HOME ORA_CRS_HOME  LD_LIBRARY_PATH TNS_ADMIN PATH ORACLE_TERM ORA_NLS33 NLS_LANG

 

4、配置时间同步

在安装 Oracle 集群件和 Oracle 数据库软件时,Oracle 安装程序将首先在本地节点上安装软件,然后再将软件远程复制到远程节点。如果两个RAC节点的日期和时间未同步,可能会收到类似于以下内容的错误:

"/bin/tar: ./inventory/Components21/oracle.ordim.server/10.2.0.1.0: time

stamp  2010-12-04 06:24:04 is 25 s in the future"

 

所有节点的时间必须同步,这通常是通过配置NTP服务实现的。如果用户的网络中已经有一个时间服务器,那么可以所有节点都指向它,否则可以从集群中挑选一个节点作为时间服务器,让其他节点与它同步。

(1)网络中有时间服务器(本环境采取这种方式)

vi /etc/ntp.conf

 

server 192.168.1.7 prefer

driftfile /var/lib/ntp/drift

broadcastdelay  0.008

(2)网络中没有时间服务器

可以选择集群中某个节点作为时间服务器,NTP服务只需要很少的系统资源。假设选择zhh1作为时间服务器,zhh2向它同步:

编辑zhh1的ntp配置文件

server  127.127.1.0           #注意不是127.0.0.1 

fudge   127.127.1.0 stratum 11 

driftfile /var/lib/ntp/drift  broadcastdelay  0.008

然后编辑zhh2的ntp配置文件

server 192.168.5.235 prefer 

driftfile /var/lib/ntp/drift 

broadcastdelay  0.008

(3)启动ntp服务,并设置开机启动

[root@zhh1 ~]# /etc/init.d/ntpd start

[root@zhh1 ~]# chkconfig  ntpd on

 

5、配置hangcheck-timer模块

9.2以前使用一个名为 watchdogd 的用户空间监视后台程序来监视集群的状态情况,并在出现故障时重新启动 RAC 节点。从 Oracle 9.2.0.2 开始,此监视后台程序已被名为 hangcheck-timer 的模块所代替,该模块可以更好地解决可用性和可靠性问题。hang-check 计时器被加载到 Linux 内核中并检查系统是否挂起。它将设置一个计时器,并在特定的时间量之后检查该计时器。有一个用于检查挂起情况的可配置阈值,如果超过该阈值,计算机将重新启动。尽管 Oracle CRS 并不需要 hangcheck-timer模块,但Oracle强烈建议使用它。

hangcheck-timer 模块使用了一个基于内核的计时器,该计时器周期性地检查系统任务调度程序,以捕获延迟,从而确定系统的运行状况。如果系统挂起或暂停,则计时器重置该节点。hangcheck-timer 模块使用时间戳计数器 (TSC) CPU 寄存器,该寄存器在每个时钟信号处递增。由于此寄存器由硬件自动更新,因此 TCS 提供了更精确的时间度量。

两个参数,即 hangcheck_tick(定义系统检查频率,默认60s,oracle建议30s)和 hangcheck_margin(定义在重置 RAC节点前的最大挂起延时,默认180s,oracle建议180s)来确定节点是否出现故障。hangcheck-timer模块会根据hangcheck_tick的设置,定时检查内核。只要响应时间小于hangcheck_tick+hangcheck_margin,都会认为内核运行正常。否则,就意味着运行异常,模块会自动重启系统。

 

注意:crs的参数MissCount必须大于hangcheck_tick+hangcheck_margin的和(需考证)

miscount的值用crsctl get css misscount查询,10gR2 linux平台,默认60s

 

设置 hangcheck 内核模块参数:

vi /etc/modprobe.conf

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

设置 hangcheck 内核模块开机加载

vi /etc/rc.d/rc.local

/sbin/modprobe hangcheck-timer

 

要立即加载模块,执行:

modprobe -v hangcheck-timer

检查加载情况:

[root@zhh1 ~]# lsmod  | grep hangcheck_timer

hangcheck_timer         5593  0

 

(二)安装配置节点2

(1)复制节点2

正常关闭节点1,打开VC server,右键zhh1虚拟机,选择 克隆 ,名称为 zhh2 ,然后全部默认,next即可。

(2)调整zhh2

启动zhh2,

1、修改hostname为zhh2

vi  /etc/sysconfig/network

2、修改ip,删除HWADDR(MAC地址),修改成相应的ip

vi  /etc/sysconfig/network-scripts/ifcfg-eth0

vi  /etc/sysconfig/network-scripts/ifcfg-eth1

或者

图形化界面,以root用户登陆并执行 system-config-network,edit 修改ip地址,在Hardware Device 选项卡点击probe 生成新的MAC地址。

3、修改oracle用户环境变量文件.bash_profile

ORACLE_SID=rac2

 

(三)配置oracle ssh用户等效

在安装 Oracle RAC 10g 期间,OUI 需要把文件复制到集群中的其他主机上并在其上执行程序。 为了允许 OUI 完成此任务,必须配置 SSH 以启用用户等效性。 用 SSH 建立用户等效性就提供了一种在集群中其他主机上复制文件和执行程序时不需要口令提示的安全方式。

第一步是生成 SSH 的公共密钥和专用密钥。 SSH 协议有两个版本;版本 1 使用 RSA,版本 2 使用 DSA,因此这里创建这两种类型的密钥,以确保 SSH 能够使用任一版本。 ssh-keygen 程序将根据传递给它的参数生成任一类型的公共密钥和专用密钥。

当运行 ssh-keygen 时,将提示输入一个用于保存密钥的位置。 当提示时只需按 Enter 接受默认值。 随后将提示输入一个口令短语。 输入能记住的口令,然后再次输入该口令进行确认。 当您完成以下步骤后,在 ~/.ssh 目录中将会有四个文件: id_rsa、id_rsa.pub、id_dsa 和 id_dsa.pub。 id_rsa 和 id_dsa 文件是你的专用密钥,千万不要告诉任何人。 id_rsa.pub 和 id_dsa.pub 文件是你的公共密钥,必须将其复制到集群中其他每个主机上。

zhh1节点:

[root@zhh1 ~]# su - oracle

[oracle@zhh1 ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/oracle/.ssh/id_rsa):

Created directory '/home/oracle/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/oracle/.ssh/id_rsa.

Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.

The key fingerprint is:

82:18:45:15:66:d5:49:16:02:26:ae:ef:45:bb:ef:58 oracle@zhh1

[oracle@zhh1 ~]$ ssh-keygen -t dsa

根据提示,输入即可。

 

zhh2节点:

[root@zhh2 ~]# su - oracle

[oracle@zhh2 ~]$ ssh-keygen -t rsa

[oracle@zhh2 ~]$ ssh-keygen -t dsa

 

zhh1节点:

[oracle@zhh1 ~]$ cat ~/.ssh/id_*sa.pub >> ~/.ssh/authorized_keys

[oracle@zhh1 ~]$ ssh zhh2 cat ~/.ssh/id_*sa.pub >> ~/.ssh/authorized_keys

[oracle@zhh1 ~]$ scp ~/.ssh/authorized_keys zhh2:~/.ssh/authorized_keys

 

在每个节点上测试,验证再次运行命令时,系统是否不提示输入口令。

首次运行时,需要输入yes,以后就不需要任何输入。

[oracle@zhh1 ~]$ ssh zhh2 hostname

[oracle@zhh1 ~]$ ssh zhh2-priv hostname

[oracle@zhh1 ~]$ ssh zhh1 hostname

[oracle@zhh1 ~]$ ssh zhh1-priv hostname

[oracle@zhh2 ~]$ ssh zhh2 hostname

[oracle@zhh2 ~]$ ssh zhh2-priv hostname

[oracle@zhh2 ~]$ ssh zhh1 hostname

[oracle@zhh2 ~]$ ssh zhh1-priv hostname

 

(四)配置共享存储

1、创建虚拟共享磁盘

在VMware ESX下建立虚拟共享磁盘的格式必须要为thick,否则在虚拟节点系统里挂接磁盘后操作系统无法启动,出现如下错误提示:

VMware ESX Server cannot open the virtual disk, "........vmdk"

for clustering. Please verify that the virtual disk was created

using the 'thick' option.

......

Reason: thin/TBZ disks cannot be opened in multiwriter mode..

使用ssh登陆zhh1和zhh2的宿主机,进入虚拟磁盘的目录:

[root@exs-server root]# cd /vmfs/volumes/exs-server\:storage1/

[root@exs-server exs-server:storage1]# ls zhh*

zhh1:

vmware-1.log  vmware-3.log  zhh1-8f87c67a.vswp  zhh1.nvram  zhh1.vmsd  zhh1.vmxf

vmware-2.log  vmware.log    zhh1-flat.vmdk      zhh1.vmdk   zhh1.vmx

 

zhh2:

vmware-1.log  vmware-3.log  zhh2-8f87c67b.vswp  zhh2.nvram  zhh2.vmsd  zhh2.vmxf

vmware-2.log  vmware.log    zhh2-flat.vmdk      zhh2.vmdk   zhh2.vmx

[root@exs-server exs-server:storage1]# mkdir shared_storage

使用下面的语句创建虚拟共享磁盘

[root@exs-server shared_storage]# vmkfstools -c 300m -a lsilogic -d thick ocr.vmdk

[root@exs-server shared_storage]# vmkfstools -c 300m -a lsilogic -d thick votingdisk.vmdk

[root@exs-server shared_storage]# vmkfstools -c 300m -a lsilogic -d thick raw1.vmdk

[root@exs-server shared_storage]# vmkfstools -c 300m -a lsilogic -d thick raw2.vmdk

[root@exs-server shared_storage]# vmkfstools -c 300m -a lsilogic -d thick raw3.vmdk

[root@exs-server shared_storage]# vmkfstools -c 4096m -a lsilogic -d thick asm1.vmdk

[root@exs-server shared_storage]# vmkfstools -c 4096m -a lsilogic -d thick asm2.vmdk

[root@exs-server shared_storage]# vmkfstools -c 4096m -a lsilogic -d thick asm3.vmdk

[root@exs-server shared_storage]# vmkfstools -c 4096m -a lsilogic -d thick asm4.vmdk

[root@exs-server shared_storage]# ll

total 18313792

-rw-------    1 root     root     4294967296 Dec 27 16:34 asm1-flat.vmdk

-rw-------    1 root     root          369 Dec 27 16:34 asm1.vmdk

-rw-------    1 root     root     4294967296 Dec 27 16:34 asm2-flat.vmdk

-rw-------    1 root     root          369 Dec 27 16:34 asm2.vmdk

-rw-------    1 root     root     4294967296 Dec 27 16:34 asm3-flat.vmdk

-rw-------    1 root     root          369 Dec 27 16:34 asm3.vmdk

-rw-------    1 root     root     4294967296 Dec 27 16:34 asm4-flat.vmdk

-rw-------    1 root     root          369 Dec 27 16:34 asm4.vmdk

-rw-------    1 root     root     314572800 Dec 27 16:33 ocr-flat.vmdk

-rw-------    1 root     root          366 Dec 27 16:33 ocr.vmdk

-rw-------    1 root     root     314572800 Dec 27 16:34 raw1-flat.vmdk

-rw-------    1 root     root          367 Dec 27 16:34 raw1.vmdk

-rw-------    1 root     root     314572800 Dec 27 16:34 raw2-flat.vmdk

-rw-------    1 root     root          367 Dec 27 16:34 raw2.vmdk

-rw-------    1 root     root     314572800 Dec 27 16:34 raw3-flat.vmdk

-rw-------    1 root     root          367 Dec 27 16:34 raw3.vmdk

-rw-------    1 root     root     314572800 Dec 27 16:33 votingdisk-flat.vmdk

-rw-------    1 root     root          373 Dec 27 16:33 votingdisk.vmdk

 

2、添加共享磁盘到虚拟机

正常关闭两个节点

(1)进入VC,右键 zhh1 ,选择 编辑设置添加硬盘使用现有虚拟磁盘浏览(选择 刚刚创建的ocr.vmdk)- 虚拟设备节点(选择SCSI(1:0)),模式(选择独立)- 完成确定

(2)设置SCSI controller 1 为虚拟

第一步完成后,可以看到zhh1的设备中自动添加了一个SCSI controller 1,把这个SCSI设置为虚拟或物理。

(3)重复第(1)步,添加依次所有硬盘,注意虚拟设备节点(选择SCSI(1:n))。

(4)在其他节点中重复1-3步骤

3、为什么?

为什么添加共享磁盘要在所有节点中操作?很麻烦,为何不在创建第一个虚拟机时添加,然后第二个虚拟机直接复制不就OK了?

测试时发现,如果在创建第一个虚拟机时添加共享磁盘,然后采取clone方式创建第二个虚拟机时,连同共享磁盘一起物理地复制了,囧!

当然,可以创建一个共享磁盘,然后在这个磁盘上划分出多个分区。

 

(五)磁盘配置

1、格式化分区

(1)分区

只需在一个节点zhh1上执行分区操作

[root@zhh1 ~]# fdisk /dev/sdb

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-300, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-300, default 300):

Using default value 300

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

(2)、重复上述步骤,格式化所有磁盘

(3)fdisk –l 在所有节点上检查磁盘分区

2、配置ocfs2设备

(1)创建 OCFS2 配置文件

图形化界面,在 zhh1 上,以 root 用户身份执行

# ocfs2console

a、OCFS2 控制台:选择 Cluster,然后选择 Configure Nodes。

b、“集群堆栈已经启动”:单击 Close。

c、节点配置:单击 Add。

d、新增节点:添加以下节点,然后单击 Apply。

名称:zhh1

IP 地址: 192.168.5.235

IP 端口: 7777

名称:zhh2

IP 地址: 192.168.5.236

IP 端口: 7777

e、验证生成的配置文件。

[root@zhh1 ~]#  less /etc/ocfs2/cluster.conf

node:

        ip_port = 7777

        ip_address = 192.168.5.235

        number = 0

        name = zhh1

        cluster = ocfs2

 

node:

        ip_port = 7777

        ip_address = 192.168.5.236

        number = 1

        name = zhh2

        cluster = ocfs2

 

cluster:

        node_count = 2

        name = ocfs2

f、将配置文件传播到 zhh2。可以在 zhh2 上重新运行上述步骤以生成配置文件,或者在 zhh1 的 OCFS2 控制台上选择 Cluster 和 Propagate Configuration 以将配置文件传播到 zhh2。

(2)配置 O2CB 驱动程序

O2CB 是一组集群服务,负责管理节点与集群文件系统之间的通信。下面是对各个服务的说明:

NM:用于跟踪 cluster.conf 中的所有节点的节点管理器

HB:当节点加入或离开集群时向上/向下发出通知的心跳服务

TCP:处理节点之间的通信

DLM:用于跟踪所有锁、这些锁的所有者以及状态的分布式锁管理器

CONFIGFS:在 /config 中挂载的用户空间驱动的配置文件系统

DLMFS:用户空间与内核空间 DLM 的接口

在zhh1和zhh2两个节点上执行下面的过程,将 O2CB 配置为在引导时启动。

当系统提示指定心跳死亡阈值时,必须指定一个大于 7 的值,以防止节点由于较慢的磁盘驱动器而崩溃。心跳死亡阈值是一个用于计算隔离时间的变量。

Fence time (seconds) = (heartbeat dead threshold -1) * 2

在本测试环境中,我们使用默认值。两个节点上的心跳死亡阈值应该完全相同。

在两个节点上都执行下列操作:

[root@zhh1 ~]# /etc/init.d/o2cb unload

Stopping O2CB cluster ocfs2: OK

Unmounting ocfs2_dlmfs filesystem: OK

Unloading module "ocfs2_dlmfs": OK

Unmounting configfs filesystem: OK

Unloading module "configfs": OK

[root@zhh1 ~]# /etc/init.d/o2cb configure

Configuring the O2CB driver.

 

This will configure the on-boot properties of the O2CB driver.

The following questions will determine whether the driver is loaded on

boot.  The current values will be shown in brackets ('[]').  Hitting

<ENTER> without typing an answer will keep that current value.  Ctrl-C

will abort.

 

Load O2CB driver on boot (y/n) [n]: y

Cluster to start on boot (Enter "none" to clear) [ocfs2]:

Specify heartbeat dead threshold (>=7) [31]:

Specify network idle timeout in ms (>=5000) [30000]:

Specify network keepalive delay in ms (>=1000) [2000]:

Specify network reconnect delay in ms (>=2000) [2000]:

Writing O2CB configuration: OK

Loading module "configfs": OK

Mounting configfs filesystem at /config: OK

Loading module "ocfs2_nodemanager": OK

Loading module "ocfs2_dlm": OK

Loading module "ocfs2_dlmfs": OK

Mounting ocfs2_dlmfs filesystem at /dlm: OK

Starting O2CB cluster ocfs2: OK

 

在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有活动,因为文件系统未挂载。

[root@zhh1 ~]# /etc/init.d/o2cb status

Module "configfs": Loaded

Filesystem "configfs": Mounted

Module "ocfs2_nodemanager": Loaded

Module "ocfs2_dlm": Loaded

Module "ocfs2_dlmfs": Loaded

Filesystem "ocfs2_dlmfs": Mounted

Checking O2CB cluster ocfs2: Online

  Heartbeat dead threshold: 31

  Network idle timeout: 30000

  Network keepalive delay: 2000

  Network reconnect delay: 2000

Checking O2CB heartbeat: Not active

(3)格式化文件系统

只需在一个节点上格式化文件系统。在 zhh1 上,图形化界面以 root 用户身份执行:

# ocfs2console

a、OCFS2 控制台:选择 Tasks、Format。

b、格式化:

可用设备:/dev/sdb1

卷标:oracle

集群大小:Auto

节点插槽数量: 4

块大小:Auto

c、OCFS2 控制台:按 CTRL-Q 退出。

d、重复abc步骤格式化/dev/sdc1

或者使用下列命令格式

mkfs.ocfs2 -L "ocr" /dev/sdb1

mkfs.ocfs2 -L "votingdisk" /dev/sdb2

(4)挂载文件系统

在zhh1和zhh2两个节点上,执行下列命令

[root@zhh1 ~]# mkdir /ocr

[root@zhh1 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocr

[root@zhh1 ~]# mkdir /votingdisk

[root@zhh1 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdc1 /votingdisk

[root@zhh1 ~]# less /etc/fstab

/dev/sdb1               /ocr                   ocfs2 _netdev,datavolume,nointr 0 0

/dev/sdc1               /votingdisk             ocfs2 _netdev,datavolume,nointr 0 0

[root@zhh1 ~]# chown -R oracle:dba /ocr

[root@zhh1 ~]# chown -R oracle:dba /votingdisk

[root@zhh1 /]# /etc/init.d/o2cb status

Module "configfs": Loaded

Filesystem "configfs": Mounted

Module "ocfs2_nodemanager": Loaded

Module "ocfs2_dlm": Loaded

Module "ocfs2_dlmfs": Loaded

Filesystem "ocfs2_dlmfs": Mounted

Checking O2CB cluster ocfs2: Online

  Heartbeat dead threshold: 31

  Network idle timeout: 30000

  Network keepalive delay: 2000

  Network reconnect delay: 2000

Checking O2CB heartbeat: Active

(5)验证读写

在两个节点的共享集群文件系统上读写文件

[root@zhh1 ocr]# touch test.txt

[root@zhh2 ocr]# vi test.txt

[root@zhh1 ocr]# less test.txt

[root@zhh1 ocr]# rm test.txt

3、配置raw device

2.6内核以后,内核默认不再支持裸设备,RHEL4仍提供对裸设备的支持。

在两个节点zhh1和zhh2都要执行下面的操作。

(1)绑定裸设备与块设备

vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/sdd1

/dev/raw/raw2 /dev/sde1

/dev/raw/raw3 /dev/sdf1

(2)配置裸设备的权限

vi /etc/udev/permissions.d/50-udev.permissions

# raw devices

ram*:root:disk:0660

raw/*:oracle:dba:0660

(3)检查裸设备是否开机启动

[root@zhh1 /]# chkconfig --list rawdevices

rawdevices      0:off   1:off   2:off   3:on    4:on    5:on    6:off

(4)启动rawdevices服务

[root@zhh1 /]# service rawdevices start

Assigning devices:

           /dev/raw/raw1  -->   /dev/sdd1

/dev/raw/raw1:  bound to major 8, minor 49

           /dev/raw/raw2  -->   /dev/sde1

/dev/raw/raw2:  bound to major 8, minor 65

           /dev/raw/raw3  -->   /dev/sdf1

/dev/raw/raw3:  bound to major 8, minor 81

done

[root@zhh1 /]# ll /dev/raw/*

crw-rw----  1 oracle dba 162, 1 Dec 28 08:53 /dev/raw/raw1

crw-rw----  1 oracle dba 162, 2 Dec 28 08:53 /dev/raw/raw2

crw-rw----  1 oracle dba 162, 3 Dec 28 08:53 /dev/raw/raw3

(5)在其他节点重复上述步骤

4、创建ASM设备

有两个不同方法可在 Linux 上配置 ASM:

使用 ASMLib I/O 的 ASM:此方法使用 ASMLib 调用在由 ASM 管理的原始块设备上创建所有 Oracle 数据库文件。由于 ASMLib 使用块设备,因此该方法不需要原始设备。

使用标准 Linux I/O 的 ASM:此方法使用标准 Linux I/O 系统调用在 ASM 管理的原始字符设备上创建所有 Oracle 数据库文件。您将需要为 ASM 使用的所有磁盘分区创建原始设备。

本测试环境使用ASMlib方式创建ASM磁盘,因此需要先安装相关包

(1)配置ASMlib

以 root身份在两个节点上配置 ASMLib:

# /etc/init.d/oracleasm configure

Configuring the Oracle ASM library driver.

 

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

 

Default user to own the driver interface []: oracle

Default group to own the driver interface []: dba

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

 

(2)创建ASM磁盘

在一个节点zhh1上以root执行:

[root@zhh1 /]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdg1

Marking disk "VOL1" as an ASM disk: [  OK  ]

[root@zhh1 /]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdh1

Marking disk "VOL2" as an ASM disk: [  OK  ]

[root@zhh1 /]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdi1

Marking disk "VOL3" as an ASM disk: [  OK  ]

[root@zhh1 /]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdj1

Marking disk "VOL4" as an ASM disk: [  OK  ]

[root@zhh1 /]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@zhh1 /]# /etc/init.d/oracleasm listdisks

VOL1

VOL2

VOL3

VOL4

(3)在其他节点zhh2上以root执行:

[root@zhh2 ~]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@zhh2 ~]# /etc/init.d/oracleasm listdisks

VOL1

VOL2

VOL3

VOL4

 

至此,所有准备工作做完了。

 

ps:VMware Server(旧名称 VMware GSX Server)或workstation版本

1、虚拟机目录规划

创建三个目录,创建虚拟机或添加共享磁盘时指定目录:

zhh1 用于存放zhh1虚拟机文件

zhh2用于存放zhh2虚拟机文件

shared_storage用于存放共享磁盘文件

2、创建第一个虚拟机

3、添加共享磁盘时,同样 虚拟设备节点:选择 SCSI 1:n

4、修改zhh1的.vmx文件

a、定义scsi 1:n的类型,如果已有类型定义,省略此步骤

形如:scsi1:0.deviceType = "disk"

每个磁盘都应该定义

b、设置磁盘共享,加入下面的参数

disk.locking = "FALSE"

5、在zhh1上完成上面的步骤完成下列工作:只要是两个节点都需要配置的步骤,都可以先在第一个虚拟机上配置好,然后复制为第二个虚拟机。

安装操作系统配置oracle安装环境、配置时间同步、配置hangcheck-timer模块、配置共享存储、格式化分区、配置raw device

6、关闭zhh1,复制为zhh2

把zhh1目录下的文件全部复制zhh2目录下。

修改zhh2目录下的.vmx文件,修改此参数

displayName = "zhh2"

7、创建第二个虚拟机。

以打开已存在的虚拟机方式启动zhh2,修改ip和hostname

8、在zhh1和zhh2上配置用户等价、创建ASM设备等操作

 

五、安装oracle clusterware

Oracle CRS 包含所有集群和数据库配置元数据以及多个适用于 RAC 的系统管理特性。通过它,数据库管理员可以将一个 Oracle 实例(或多个实例)注册和调用到集群。通常,CRS 将向集群中配置的所有节点发送消息(通过一种特殊的 ping 操作),通常称作“心跳”。如果针对任何节点的心跳检测失败,则它将核对 CRS 配置文件(位于共享磁盘上)以辨别是节点故障还是网络故障。

安装 CRS 后,用于安装 Oracle 数据库 10g 的 Oracle Universal Installer (OUI) 将自动识别这些节点。与安装CRS一样,只需从一个节点运行 Oracle 10g 数据库软件。OUI 将把此软件程序包复制到 RAC 集群中配置的所有节点。

 

必须在安装 oracle database前先安装并运行 CRS。

必须将 CRS_HOME 和 ORACLE_HOME 安装在不同的位置。

在安装 CRS 之前,必须提供表决文件(votingdisk)和 Oracle 配置信息库 (OCR) 文件的共享位置或设备。表决文件的大小至少应为20MB,OCR 文件的大小至少应为100MB。

 

强烈建议在安装前使用CVU工具来检测一下安装环境,用法见“cluvfy用法”一文。事实上,在安装完clusterware后,OUI会调用CVU来检查安装情况。

1、到oracle网站下载clusterware软件,并解压,,两个节点都需要

gunzip 10201_clusterware_linux_x86_64.cpio.gz

cpio -idmv <10201_clusterware_linux_x86_64.cpio

2、在zhh1节点,图形化界面以oracle用户登陆

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]$ cd /usr/oracle/soft/clusterware

[oracle@zhh1 clusterware]$ ./runInstaller

3、出现提示:Has 'rootpre.sh' been run by root? [y/n] (n)

在两个节点上都以root用户运行rootpre.sh

[root@zhh1 oracle]# sh /usr/oracle/soft/clusterware/rootpre/rootpre.sh

No OraCM running

[root@zhh2 soft]# sh /usr/oracle/soft/clusterware/rootpre/rootpre.sh

No OraCM running

4、欢迎页面:单击 Next。

5、指定 Inventory 目录和身份证明:

输入 inventory 目录的完整路径:/usr/oracle/oraInventory。

指定操作系统组名:dba。

6、指定 Home 详细内容:

名称:OraCrs10g_home

/usr/oracle/product/10.2.0/crs_1

7、特定于产品的必要条件检查:

忽略有关物理内存要求的警告。

8、指定集群配置:单击 Add。

公共节点名称:zhh2

专用节点名称:zhh2-priv

虚拟主机名称:zhh2-vip

9、指定网络接口用法:

接口名称:eth0

子网: 192.168.5.0

接口类型:Public

接口名称:eth1

子网: 10.0.0.0

接口类型:Private

10、指定 Oracle 集群注册表 (OCR) 位置:选择 Normal Redundancy。

指定 OCR 位置:/dev/raw/raw1

镜像位置/ocr/ocr

11、指定表决磁盘位置:选择 External Redundancy。

表决磁盘位置:/dev/raw/raw2

镜像1:/dev/raw/raw3

镜像2:/votingdisk/votingdisk

12、摘要:单击 Install。

13、执行配置脚本:以 root 用户身份按顺序执行以下脚本(一次执行一个)。在当前脚本完成后,再继续执行下一个脚本。

在 zhh1 上执行/usr/oracle/oraInventory/orainstRoot.sh

在 zhh2 上执行/usr/oracle/oraInventory/orainstRoot.sh

在 zhh1 上执行/usr/oracle/product/10.2.0/crs_1/root.sh

在 zhh2 上执行/usr/oracle/product/10.2.0/crs_1/root.sh

 

[root@zhh1 /]# sh /usr/oracle/oraInventory/orainstRoot.sh

Changing permissions of /usr/oracle/oraInventory to 770.

Changing groupname of /usr/oracle/oraInventory to dba.

The execution of the script is complete

 

[root@zhh2 ~]# sh /usr/oracle/oraInventory/orainstRoot.sh

Changing permissions of /usr/oracle/oraInventory to 770.

Changing groupname of /usr/oracle/oraInventory to dba.

The execution of the script is complete

 

[root@zhh1 /]# sh /usr/oracle/product/10.2.0/crs_1/root.sh

WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root

WARNING: directory '/usr/oracle/product' is not owned by root

WARNING: directory '/usr/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

/etc/oracle does not exist. Creating it now.

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root

WARNING: directory '/usr/oracle/product' is not owned by root

WARNING: directory '/usr/oracle' is not owned by root

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: zhh1 zhh1-priv zhh1

node 2: zhh2 zhh2-priv zhh2

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

Now formatting voting device: /dev/raw/raw2

Now formatting voting device: /dev/raw/raw3

Now formatting voting device: /votingdisk/votingdisk

Format of 3 voting devices complete.

Startup will be queued to init within 90 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        zhh1

CSS is inactive on these nodes.

        zhh2

Local node checking complete.

Run root.sh on remaining nodes to start CRS daemons.

 

[root@zhh2 ~]# sh /usr/oracle/product/10.2.0/crs_1/root.sh

WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root

WARNING: directory '/usr/oracle/product' is not owned by root

WARNING: directory '/usr/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

/etc/oracle does not exist. Creating it now.

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root

WARNING: directory '/usr/oracle/product' is not owned by root

WARNING: directory '/usr/oracle' is not owned by root

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: zhh1 zhh1-priv zhh1

node 2: zhh2 zhh2-priv zhh2

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

Startup will be queued to init within 90 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        zhh1

        zhh2

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 vipca(silent) for configuring nodeapps

The given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs.

 

zhh2 上的 root.sh 脚本会自动调用 VIPCA,但会因为“The given interface(s), "eth0" is not public.Public interfaces should be used to configure virtual IPs.”错误而失败。如果公共接口使用不可路由的 IP 地址 (192.168.x.x),则 Oracle 集群验证实用程序 (CVU) 将无法找到合适的公共接口。解决方法是手动运行 VIPCA。

在两个节点上检查CRS是否安装成功。

[root@zhh2 ~]# /usr/oracle/product/10.2.0/crs_1/bin/crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy

 

14、图形化界面以 root 用户身份在第二个节点zhh2上手动调用 VIPCA。

# /usr/oracle/product/10.2.0/crs_1/bin/vipca

15、欢迎页面:单击 Next。

16、网络接口:选择 eth0。

17、集群节点的虚拟 IP:

只需要在“IP Alias Name”中填入名称,tab键自动补全ip address

节点名称:zhh1

IP 别名:zhh1-vip

IP 地址: 192.168.5.233

子网掩码: 255.255.255.0

节点名称:zhh2

IP 别名:zhh2-vip

IP 地址: 192.168.5.234

子网掩码: 255.255.255.0

18、摘要:单击Finish

19、配置助手进度对话框:配置完成后,单击 OK。

20、配置结束:单击 Exit。

21、返回到 zhh1 的执行配置脚本屏幕,然后单击 OK。

22、配置助手:验证所有检查均成功。OUI 在最后会执行集群件安装后检查。

23、确认clusterware安装成功

[root@zhh1 ~]#  /usr/oracle/product/10.2.0/crs_1/bin/crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy

[root@zhh1 ~]# cd /usr/oracle/product/10.2.0/crs_1/bin/

[root@zhh1 bin]# ./olsnodes

zhh1

zhh2

[root@zhh1 bin]# ./crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy

 [root@zhh1 bin]# ./crs_stat -t -v

Name           Type           R/RA   F/FT   Target    State     Host       

----------------------------------------------------------------------

ora.zhh1.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh1       

ora.zhh1.ons   application    0/3    0/0    ONLINE    ONLINE    zhh1       

ora.zhh1.vip   application    0/0    0/0    ONLINE    ONLINE    zhh1       

ora.zhh2.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh2       

ora.zhh2.ons   application    0/3    0/0    ONLINE    ONLINE    zhh2       

ora.zhh2.vip   application    0/0    0/0    ONLINE    ONLINE    zhh2 

 

ps:

1、这一步的root.sh会在/etc/inittab文件最下边增加3行:

h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null

h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null

h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null

熟悉linux的都会知道respawn参数的意思:如果crsd和evmd进程发生异常,则系统自动重启这两个进程;如果cssd进程发生异常,则系统会立即重启。因此想通过kill -9 pid来停掉crs是行不通的。

2、如果clusterware安装失败,需要干净地卸载才能重装。请参考metalink 239998.1文档。

一般情况下在每个节点上先运行$ORA_CRS_HOME/install/rootdelete.sh,然后运行$ORA_CRS_HOME/install/rootdeinstall.sh即可。

 

六、安装oracle database

(一)安装数据库软件

只需在一个节点上安装database,图形化界面,以oracle用户登陆,注意先检查一下环境变量。

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]# cd /usr/oracle/soft/database

[oracle@zhh1 database]#./ runInstaller

1、欢迎页面:单击 Next。

2、选择安装类型:

选择 Enterprise Edition。

3、指定 Home 详细内容:

名称:OraDb10g_home1

路径:/usr/oracle/product/10.2.0/db_1

4、指定硬件集群安装模式:

选择 Cluster Installation。

单击 Select All。

5、特定于产品的必要条件检查:

忽略有关物理内存要求的警告。

6、选择配置选项:

只安装数据库软件。

7、摘要

单击 install

8、执行配置脚本:

在两个节点上以root执行root.sh脚本

[root@zhh1 soft]# sh /usr/oracle/product/10.2.0/db_1/root.sh

[root@zhh2 soft]# sh /usr/oracle/product/10.2.0/db_1/root.sh

9、OK,exit。

 

(二)安装补丁,升级到10.2.0.5

因为我们只安装了clusterware和database软件,没有创建数据库,因此打补丁升级就简单了很多。

必须先升级clusterware才能升级database

(1)升级clusterware

只需在一个节点上执行

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]$ cd /usr/oracle/soft/Disk1/

[oracle@zhh1 Disk1]#./ runInstaller

1、欢迎页面:单击 Next。

2、指定 Home 详细内容:

注意name选项的下拉框有两个选项:OraCrs10g_home和OraDb10g_home,选择OraCrs10g_home

名称:OraCrs10g_home

路径:/usr/oracle/product/10.2.0/crs_1

3、指定硬件集群安装模式:

OUI 自动选中的cluster的安装方式,并选中了所有可用的节点,next

4、特定于产品的必要条件检查:

忽略有关物理内存要求的警告。

5、摘要

无异常,单击install

6、执行结束安装脚本

在每个节点上以root用户按照下面顺序执行:

[root@zhh1 ~]# /usr/oracle/product/10.2.0/crs_1/bin/crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@zhh1 ~]# /usr/oracle/product/10.2.0/crs_1/install/root102.sh

Creating pre-patch directory for saving pre-patch clusterware files

Completed patching clusterware files to /usr/oracle/product/10.2.0/crs_1

Relinking some shared libraries.

Relinking of patched files is complete.

WARNING: directory '/usr/oracle/product/10.2.0' is not owned by root

WARNING: directory '/usr/oracle/product' is not owned by root

WARNING: directory '/usr/oracle' is not owned by root

Preparing to recopy patched init and RC scripts.

Recopying init and RC scripts.

Startup will be queued to init within 30 seconds.

Starting up the CRS daemons.

Waiting for the patched CRS daemons to start.

  This may take a while on some systems.

.

10205 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 1 values from OCR.

Successfully deleted 1 keys from OCR.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: zhh1 zhh1-priv zhh1

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

clscfg -upgrade completed successfully

Creating '/usr/oracle/product/10.2.0/crs_1/install/paramfile.crs' with data used for CRS configuration

Setting CRS configuration values in /usr/oracle/product/10.2.0/crs_1/install/paramfile.crs

[root@zhh2 ~]# /usr/oracle/product/10.2.0/crs_1/bin/crsctl stop crs

[root@zhh2 ~]# /usr/oracle/product/10.2.0/crs_1/install/root102.sh

 

(2)升级database

只需在一个节点上执行

 [oracle@zhh1 Disk1]#./ runInstaller

1、欢迎页面:单击 Next。

2、指定 Home 详细内容:

名称:OraDb10g_home1

路径:/usr/oracle/product/10.2.0/db_1

3、填写oracle support 邮件和密码

直接忽略

4、指定硬件集群安装模式:

OUI 自动选中的cluster的安装方式,并选中了所有可用的节点,next

5、特定于产品的必要条件检查:

忽略有关物理内存要求的警告。

6、摘要

无异常,单击install

7、直接结束脚本

在两个节点 ,以root用户执行:

[root@zhh1 ~]#/usr/oracle/product/10.2.0/db_1/root.sh

[root@zhh2 ~]#/usr/oracle/product/10.2.0/db_1/root.sh

8、OK,exit

 

(3)配置监听器

在任意节点上执行netca,这个工具同样会自动感应到集群环境。

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]$netca

1、选择配置类型:cluster configuration,next

2、选择要配置的节点:当然select all nodes,next

3、选择配置listener configuration,next

4、选择add,next

5.、填写监听器名称,这里采用默认listener,next

6、填写监听端口,这里不采用默认端口,填写3173,next

7、是否需要其他配置,no,next

8、显示配置完成,next,finish,exit。

9、验证监听器配置成功

[root@zhh1 ~]# /usr/oracle/product/10.2.0/crs_1/bin/crs_stat -t -v

Name           Type           R/RA   F/FT   Target    State     Host       

----------------------------------------------------------------------      

ora....H1.lsnr  application    0/5    0/0    ONLINE   ONLINE    zhh1       

ora.zhh1.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh1       

ora.zhh1.ons   application    0/3    0/0    ONLINE    ONLINE    zhh1       

ora.zhh1.vip   application    0/0    0/0    ONLINE    ONLINE    zhh1            

ora....H2.lsnr  application   0/5    0/0    ONLINE    ONLINE   zhh2       

ora.zhh2.gsd   application    0/5    0/0    ONLINE    ONLINE    zhh2       

ora.zhh2.ons   application    0/3    0/0    ONLINE    ONLINE    zhh2       

ora.zhh2.vip   application    0/0    0/0    ONLINE    ONLINE    zhh2

10、查看监听器配置文件

LISTENER_ZHH1 =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = zhh1-vip)(PORT = 3173)(IP = FIRST))

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.235)(PORT = 3173)(IP = FIRST))

    )

  )

LISTENER_ZHH2 =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = zhh2-vip)(PORT = 3173)(IP = FIRST))

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.236)(PORT = 3173)(IP = FIRST))

    )

  )

各个节点都只监听自己的public ip和vip。当某个节点故障后,故障节点的vip会转移到幸存其他节点上。这个时候这个节点上就有3个ip了:自己的public ip、vip和转移过来的故障节点的VIP。从这里可以看出,客户端需要通过vip和RAC节点通信。

 

(4)创建ASM

在任意节点上执行dbca,这个工具同样会自动感应到集群环境。

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]$dbca

1、肯定选择 oracle real application clusters database,next

2、选择configure automatic storage management,next

3、选择所有节点 select all,next

4、设置ASM实例的sys密码,参数文件选择pfile,next

5、ASM实例参数确认,点击close

6、确认是否创建ASM实例,点击OK确认

ASM创建完毕后,ASM实例自动启动,可以创建ASM磁盘组了。

7、create New创建磁盘组:

这里我们只创建两个磁盘组(oracle建议创建两个磁盘组:一个保存数据,一个给Flash Recovery Area使用)

DATA:选择HIGH冗余(即数据存放三份),disk选择VOL1、VOL2、VOL3

RECOVERY,选择external冗余(即数据只存一份),disk选择VOL4。

8、finish退出。

 

 

(5)创建数据库

这个大家都很熟悉

在任意节点上

[oracle@zhh1 ~]$ source .bash_profile

[oracle@zhh1 ~]$dbca

1、肯定选择 oracle real application clusters database,next

2、create database,next

3、选择节点 select all,next

4、选择数据库节点 general purpose,next

5、填写数据库名,实例前缀名:rac

6、配置EM,这里安装EM,默认

7、设置sys密码

8、存储选项,选择ASM

9、选择DISK GROUPS,选择DATA

10、指定数据文件位置,默认我们选择的+DATA disk group

11、配置recovery,我们启用闪回,闪回区指定为+RECOVERY disk group,闪回区大小默认2G;

不启用归档。

12、是否安装示例schema和执行定制脚本,默认不安装

13、是否配置service,我们这里暂时不配置service

可以使用 DBCA 或 srvctl 实用程序来创建数据库服务

一个很重要的服务就是TAF, TAF 中的故障切换机制使任何失败的数据库连接能够重新连接到集群中的其他节点。故障切换对用户是透明的。Oracle 在故障切换实例上重新执行查询并继续向用户显示余下的结果。

14、初始化参数设置

这里内存设置为80%,字符集选择简体中文:zhs16gbk

15、设置数据文件位置,默认

16、创建数据库,我们同时选择生成创建数据库脚本,便于学习dbca建库过程。点击finish

17、摘要信息,OK

18、首先生成创建脚本,然后创建数据库,显示创建进度。

19、创建完毕,信息确认对话框,exit

20、系统自动启动rac数据库和实例。

21、数据创建完毕后,数据库及每个节点的实例信息都会注册到crs中。

[oracle@zhh1 ~]$ crs_stat -t -v

名称           类型           R/RA   F/FT   目标      状态      主机       

----------------------------------------------------------------------

ora.rac.db     application    0/0    0/1    ONLINE    ONLINE    zhh2       

ora....c1.inst application    0/5    0/0    ONLINE    ONLINE    zhh1       

ora....c2.inst application    0/5    0/0    ONLINE    ONLINE    zhh2  

 

七、简单测试

(一)测试failover

客户端tns添加如下内容:

rac =

       (DESCRIPTION =

              (ADDRESS = (PROTOCOL = TCP)(HOST = zhh1-vip)(PORT = 3173))

              (ADDRESS = (PROTOCOL = TCP)(HOST = zhh2-vip)(PORT = 3173))

              (LOAD_BALANCE = yes)     

              (CONNECT_DATA =

                     (SERVER = DEDICATED)

                     (SERVICE_NAME = rac)       

                     (FAILOVER_MODE =

                            (TYPE = select)

                            (METHOD =basic)

                            (RETRIES = 180)

                            (DELAY = 5)

                     )

              )

       )

1、客户端连接到rac上,查询连接的实例

C:\Documents and Settings\huizheng>sqlplus sys/sys@rac as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on 星期一 1月 3 15:00:49 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME

----------------

rac2

 

2、强制关闭上面session连接的实例rac2

[oracle@zhh2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on 星期一 1月 3 15:03:06 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

SQL> shutdown abort

ORACLE instance shut down.

 

3、查询当前连接的实例:rac1

SQL> select instance_name from v$instance;

INSTANCE_NAME

----------------

rac1

可以看到session会转移到rac1上了。

(二)、测试loadbalance

这里我们采用张晓明的例子。

准备两个脚本,一个是Shell脚本test.sh,另一个是SQL脚本test.sql

1、test.sh的内容

#!/bin/bash

count=0

while [ $count -lt $2 ]

        do

                count=`expr $count + 1`

                sqlplus -s system/sys@$1 @test.sql

                sleep 1

        done

2、test.sql的内容

col "Instance_name" format  a20

select instance_name from v$instance

/

3、执行

sh test.sh rac 60 

4、查看执行结果

SQL> select inst_id,count(*) from gv$session

  2  group by inst_id;

   INST_ID   COUNT(*)

---------- ----------

         1         31

         2         29

可以看出基本上两个实例的负载分配权重为1:1,需要注意的是这种分配并不是简单的算术平均。

 

八、关闭和启动RAC

1、关闭顺序

[oracle@zhh1 ~]$ srvctl  stop database -d rac

[oracle@zhh1 ~]$ srvctl  stop asm -n zhh1

[oracle@zhh1 ~]$ srvctl  stop asm -n zhh2

[oracle@zhh1 ~]$ srvctl  stop nodeapps -n  zhh1

[oracle@zhh2 ~]$ crs_stat -t -v

名称           类型           R/RA   F/FT   目标      状态      主机       

----------------------------------------------------------------------

ora.rac.db     application    0/0    0/1    OFFLINE   OFFLINE              

ora....c1.inst application    0/5    0/0    OFFLINE   OFFLINE              

ora....c2.inst application    0/5    0/0    OFFLINE   OFFLINE              

ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE              

ora....H1.lsnr application    0/5    0/0    OFFLINE   OFFLINE              

ora.zhh1.gsd   application    0/5    0/0    OFFLINE   OFFLINE              

ora.zhh1.ons   application    0/3    0/0    OFFLINE   OFFLINE              

ora.zhh1.vip   application    0/0    0/0    OFFLINE   OFFLINE              

ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE              

ora....H2.lsnr application    0/5    0/0    OFFLINE   OFFLINE              

ora.zhh2.gsd   application    0/5    0/0    OFFLINE   OFFLINE              

ora.zhh2.ons   application    0/3    0/0    OFFLINE   OFFLINE              

ora.zhh2.vip   application    0/0    0/0    OFFLINE   OFFLINE              

 

10gR2和更高版本启动和关闭crs

#crsctl start crs

#crsctl stop crs

 

2、启动顺序

 

九、启用归档

(1)NFS

(2)CIA

(3)ASM

十、clusterware和rac的关系

在整个rac集群中,有两个集群环境存在。一个是由clusterware软件组成的集群;一个是由database组成的集群。clusterware组成的集群负责管理整个集群环境中的硬件资源,并为上层的database集群提供基础服务。

二者之间的关系就像单机环境下的应用程序和OS的关系。可以把clusterware集群看成OS内核,rac是其上的database应用。或者说clusterware集群把所有节点虚拟成一个计算机,而rac把所有节点的实例虚拟成一个实例。

严格地说,rac特指借助于“某种集群件产品”搭建出来的一个“多实例,但数据库”的环境。集群件可以不是oracle clusterware,可以选用其他厂商提供的集群件。

区分清楚什么是clusterware(集群层),什么是rac database(数据库层),有助于理解问题分析,知道问题出在哪个层次上。

(一)、相关进程

查看v$bgprocess这个视图查看所有后台进程的说明

 

1、clusterware

a、CSS(cluster synchronization services)

init.cssd   ocssd.bin

ocssd这个进程是clusterware中最关键的进程,如果这个进程出现异常,会导致系统重启。这个进程提供CSS服务,通过多种心跳机制,实时监控集群健康状态,提供脑裂保护等基础集群服务功能。

CSS--Manages the cluster configuration by controlling which nodes are members of the cluster and by notifying members when a node joins or leaves the cluster. If you are using third-party clusterware, then the css process interfaces with your clusterware to manage node membership information.

b、CRS(cluster ready services)

init.crsd  crsd.bin

crsd是实现高可用性(HA)的主要进程,提供CRS服务,监控应用层资源,并在这些资源运行异常时进行干预,包括关闭、重启进程或转移服务。

CRS--The primary program for managing high availability operations within a cluster. Anything that the crs process manages is known as a cluster resource which could be a database, an instance, a service, a Listener, a virtual IP (VIP) address, an application process, and so on. The crs process manages cluster resources based on the resource's configuration information that is stored in the OCR. This includes start, stop, monitor and failover operations. The crs process generates events when a resource status changes. When you have installed Oracle RAC, crs monitors the Oracle instance, Listener, and so on, and automatically restarts these components when a failure occurs. By default, the crs process makes five attempts to restart a resource and then does not make further restart attempts if the resource does not restart.

c、EVM (Event Management)

init.evmd        evmd.bin       evmlogger.bin

evmd进程负责发布CRS产生的各种事件,还负责crs和css之间的通信。

EVM--A background process that publishes events that crs creates.

d、ONS(oracle notification service)

ons

ONS--A publish and subscribe service for communicating Fast Application Notification (FAN) events.

e、PCM(process monitor daemon)

oprocd  oprocd.bin  

在非linux平台,用来检测节点的process Hang,提供“IO隔离”功能;linux平台利用hangcheck-timer模块来实现“IO隔离”。

OPROCD--This process is locked in memory to monitor the cluster and provide I/O fencing. OPROCD performs its check, stops running, and if the wake up is beyond the expected time, then OPROCD resets the processor and reboots the node. An OPROCD failure results in Oracle Clusterware restarting the node. OPROCD uses the hangcheck timer on Linux platforms.

f、RACG

racgimon

racgimon进程负责检查数据库健康状态,负责service的启动、停止、故障转移。

RACG--Extends clusterware to support Oracle-specific requirements and complex resources. Runs server callout scripts when FAN events occur.

 

2、rac database

(1)实例进程

ora_cjq0_rac1作业队列

ora_j000_rac1

 

ora_qmnc_rac1高级队列

ora_q001_rac1

 

ora_mman_rac1 自动内存管理

 

ora_mmon_rac1 管理监视器,AWR数据收集

ora_mmnl_rac1

 

ora_d000_rac1 dispatcher进程

ora_s000_rac1

 

ora_psp0_rac1 process spawner进程

 

ora_pmon_rac1 主要进程

ora_dbw0_rac1

ora_lgwr_rac1

ora_ckpt_rac1

ora_smon_rac1

ora_reco_rac1

(2)ASM实例进程

ora_asmb_rac1

ora_rbal_rac1

ora_o001_rac1

(3)RAC进程

ora_lms0_rac1   cache fusion的主要进程,负责数据块在实例内的传递,对应GCS

ora_lms1_rac1   (global cache service)服务,进程数量由gcs_server_processes控制

                        默认2,取值范围0-9

ora_lmd0_rac1   提供GES服务,在各实例间协调对数据库的访问顺序,保证数据的一致性,负责锁管理

ra_lck0_rac1    负责non_cache fusion资源的同步访问

ora_lmon_rac1   各实例的lmon进程会定期互相通信,检查集群中各节点的监控状态,当             某个节点出现故障,负责集群重构,grd恢复等操作,提供CGS服务。

ora_diag_rac1    监控实例的健康状态,在出现错误的时候收集诊断数据,记录到alert日志

ora_pz99_rac1

 

* PZ (PQ slaves used for global Views) are RAC Parallel Server Slave processes, but they are not normal parallel slave processes, PZnn processes (starting at 99) are used to query GV$ views which is done using Parallel Execution on all instances, if more than one PZ process is needed, then PZ98, PZ97,... (in that order) are created automatically.

* O00 (ASM slave processes) A group of slave processes establish connections to the ASM instance. Through this connection pool database processes can send messages to the ASM instance. For example opening a file sends the open request to the ASM instance via a slave. However slaves are not used for long running operations such as creating a file. The use slave (pool) connections eliminate the overhead of  logging into the ASM instance for short requests

* x000 - Slave used to expell disks after diskgroup reconfiguration

(二)clusterware和rac的交互

在集群中,当某个实例故障时,集群必须能够根据集群状态的变迁自动重构,这一点单靠数据库实例自己是不能完成的,必须要和clusterw交互。

clusterware决定集群组成、成员身份、成员状态。clusterware并不关心上层的应用是一个数据库还是一个web,它只负责集群的节点状态完整视图,并向上层提供这个视图。

而RAC依赖于clusterware,它需要从clusterware获得这个视图,根据这个视图来调整自己。RAC也不完全依赖于clusterware:先看clusterware能不能解决问题;如果不能,rac亲自登场。

所有节点的clusterware组成一个集群,这些节点构成了一个集群成员列表(cluster membership list),每个节点分配一个成员id(node id)。这些cluster之间互相通信,以了解各节点的状态,并从中选择一个节点作为master node,master node负责管理集群状态的变迁。当有新的节点接入集群或有节点离开集群,集群的状态就会发生变迁,到达一个新的稳态。每个稳定的集群状态用一个数值(cluster incarnation number)表示。

rac中的各实例也构成一个实例成员列表(instance membership list),rac的每个实例也使用clusterware层的node id作为身份标识,这个id在整个集群的生命期内是不会变化的。rac instance会在启动时把lmon、dbwr等需要操作共享存储的进程作为一个组注册到clusterware中,并从clusterware获得node id作为组id。

注意:

clusterware集群和rac集群是两个层次的集群,两个集群都有“脑裂”、“IO隔离”等问题。这两个集群有各自的故障检测机制,二者之间的机制可以有重叠也可以有不同。

如果rac层检测到节点故障:rac集群会做如下工作:

a、rac暂停对外服务;

b、rac通知clusterware这种异常,并等待clusterware完成clusterware集群重构,达到新的稳态;

c、clusterware集群完成重构后,通知上层的rac集群,rac集群收到这个信息后,开始自己的rac集群重构。

 

(三)相关工具及命令

1、工具

OUI

CVU

OEM

SRVCTL

SRVCTL is a command-line interface that you can use to manage an Oracle RAC database from a single point. You can use SRVCTL to start and stop the database and instances, and to delete or move instances and services. You can also use SRVCTL to add services and manage configuration

information. You use SVRCTL to start and stop a group of applications that includes virtual IP addresses, Listeners, Oracle Notification Services, node-level applications, and Oracle Enterprise Manager agents (for maintenance purposes).

CRSCTL

CRSCTL is a command-line tool that you can use to manage Oracle Clusterware. You can use CRSCTL to start and stop Oracle Clusterware and to determine the current status of your Oracle Clusterware installation.

2、命令

节点层:osnodes

网络层:oifcfg

集群层:crsctl, ocrcheck,ocrdump,ocrconfig

应用层:srvctl,onsctl,crs_stat

 

 

十一、参考

1、2 Day + Real Application Clusters Guide

2、Database Oracle Clusterware and Oracle Real Application Clusters Installation Guide for Linux

3、Oracle Database 10g: Real Application Clusters Student Guide

4、Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide

5、大话 Oracle RAC一书

6、google

原创粉丝点击