[oracle]linux oracle rac 搭建全过程

孤街醉人 提交于 2021-02-15 12:31:01

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

p Step  y by  p step  l Install  e Oracle  11gR2(11.2.0.3.0)

RAC  e +Active  d Dataguard  n on  Oracle

e Enterprise  Linux(OEL 5 5.5  X86_64)

1 1 1  概述和说明

1 1.1  概述

本文档用于详细记录在 OEL 5.5 X86_64 位系统上 安装配置  e Oracle  11gR2(11.2.0.3.0)

RAC 的步骤、 RAC  数据库的基本维护、为  RAC  创建单实例  e Active  l Physical  Dataguard、

验证  e Active  Dataguard  的功能、 RAC  主库同单实例物理备库的角色转换等内容。

安装平台选择 VMware 公司的VMware ESXi Version 4.0 的虚拟主机,通过在该虚拟机

上配置两台 OEL 5.5 X86_64 位 Linux 系统的机器,然后在这两台 Linux 机器上配置 Oracle

11gR2 RAC 系统。其中,操作系统选择Oracle 公司的 OEL 5.5 X86_64 位 Linux 系统,数据

库软件采用目前 Oracle 11gR2 最新版本的11.2.0.3.0。

本文档中假定你已经安装配置好 VMware ESXi Version 4.0 的虚拟主机,如果没有该环

境的话,也可以通过自行安装 VMware Server 来完成 11gR2 RAC 的安装配置。

2 1.2  软件获取

操作系统: Oracle Enterprise Linux 5

Oracle 软件:Oracle 11g Release 2 (11.2) Software(64 bit)

虚拟机软件:VMware Server

其中,Oracle 软件可以通过上述连接直接获取版本为 11.2.0.1.0 的安装介质,或者通过

MetaLink 官方网站获取最新版本的 11.2.0.3.0 安装介质,其中 patch 编号为10404530。

2 2 2  安装前准备工作

1 2.1  配置虚拟机,安装  OEL  5 5.5  4 X86_64 位 位  x Linux  操作系统

这里,我们需要在 VMware ESXiVersion 4.0 的虚拟主机上创建两台虚拟机,其中每台

机器至少需要配置双网卡,一块网卡作为 Public,另一块作为 Private,建议 IP 地址均选择

手动配置,而不是 DHCP 动态分配,且要求指定的 IP 在网络里是唯一的。主机名也分别要

求指定为唯一,避免冲突。主机名、IP 地址在前期规划要慎重,一经指定,最好不要轻易

改变,避免一些不必要的麻烦。这里列出两台机器前期规划的主机名、IP 地址信息:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

H H H H ostname

Short

Hostname

T T T T ype IP Address Interface

node1.localdomain node1 Public IP 172.16.0.191 eth0

node1-vip.localdomain node1-vip Virtual IP 172.16.0.193 eth0:1

node1-priv.localdomain node1-priv Private IP 192.168.94.11 eth1

node2.localdomain node2 Public IP 172.16.0.192 eth0

node2-priv.localdomain node2-vip Virtual IP 172.16.0.194 eth0:1

node2-priv.localdomain node2-priv Private IP 192.168.94.12 eth1

scan-cluster.localdomain scan-cluster SCAN IP 172.16.0.203 eth0

(Figure 2.1 网络配置信息表)

其中,每台机器至少需要配置 3 个 IP 地址,在安装操作系统的过程中,我们需要配置

公网 IP 和私有 IP 即可,虚拟 IP 在安装集群件时分配。Public IP、Virtual IP、SCANIP 必

须配置在同一网段。SCAN IP 是 Oracle 11g 新推出的,在配置 11g RAC 时需要指定。我们

的 SCAN IP 通过配置 DNS 服务器来实现,在下文中将给出配置步骤。

1 2.1.1  登录  e VMware  i ESXi  n Version  0 4.0  虚拟主机,创建新虚拟机

以 root 用户登录 172.16.0.181的虚拟主机:

进入虚拟主机管理界面:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

新建虚拟机:

选择 Custom,Next 进入下一步:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

给虚拟机命名为 11gnode1,Next:

选择 Datastore 位置,这里选择第 1 个名为 snap-0f000dba-SQL-Server 的存储设备,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

虚拟机版本选择 version 7,Next:

操作系统类型选择 Linux,版本选择 Red Hat Enterprise Linux 5(64-bit),Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CPU 核数选择 2,Next:

内存选择 2G,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

网卡选择 2 块,一块作为 Public,另外一块作为 Private,Next:

SCSI 驱动器类型选择 LSI Logic Parallel,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

选择创建新磁盘,Next:

磁盘大小选择 20G,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

虚拟设备节点选择默认 SCSI(0:0),Next:

选中在虚拟机创建之前编辑选项,Continue:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

编辑光驱设备,选择 ISO 文件,找到之前已经准备就绪的 OEL 5.5 X86_64 位的 ISO 文

件:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

选中光驱在启动时连接选项,最后,单击 Finish 完成。

至此,一台新的虚拟机配置完成。

2 2.1.2  启动  1 11gnode1  虚拟机,安装操作系统

给 11gnode1 虚拟机加电,进入图形界面安装系统:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

回车,进入安装:

Skip,跳过光驱检查:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Next,开始安装 Oracle Enterprise Linux:

语言选择--->English,键盘选择-->U.S.English 美式键盘,硬盘分区选择最后一个选项

Createcustomlayout,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

给硬盘分区,其中 SWAP 分区选择 3500M,剩余空间全部划给根分区/,Next:

网络配置,参照 2.1 节中 IP 配置信息,分别配置eth0,eht1 两块网卡的 IP、及子网掩码 、

网关、主机名,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

时区选择,亚洲/上海,Next:

配置 root 用户口令,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

选择定制软软包,Next:

其中:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Desktop Environments:

GNOME Desktop Environment

Applications:

Editors

Development:

Development Libraries

Development Tools

GNOME Software Development

Legacy Software Development

X software Development

Base System :

Administration Tools

Base

Legacy Software Support

System Tools

X Window System

其它的软件包,可以忽略,暂时不装,一来加快操作系统的安装进度,二来其余的软件

包对于配置 Oracle 11gR2 RAC 不需要,如果在将来的安装过程中,系统提示缺失软件包的

时候,我们也可以手工从安装光盘中自行安装。Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

进入格式化文件系统,安装软件包,直到最后:

根据提示,选择 Reboot 系统:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

系统重启之后,Forward:

选择关闭 Firewall,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

禁用 SELinux,Next:

直到最后一步,按照提示,再次重新启动系统,使刚才的配置生效:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

重启之后,进入图形界面的登录框:

到此,node1 节点机器创建成功。

接下来,完全参照上述创建虚拟机步骤,创建第 2 个节点,虚拟机命名为 11gnode2,

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

在配置网络步骤中,需要注意,将其 eth0 配置为 172.16.0.192,eth1配置为 192.168.94.12 ,

主机名为 node2.localdomain。

最后,两个节点的机器配置完成!

 

. 2.2 2 2  配置

 vi /etc/hosts  文件

参照 Figure 2.1 网络配置信息表,修改节点1 的/etc/hosts 配置文件。

[root@node1~]#cp/etc/hosts/etc/hosts.bak

[root@node1~]#cat/etc/hosts

#Donotremovethefollowingline,orvariousprograms

#thatrequirenetworkfunctionalitywillfail.

127.0.0.1 localhost

::1 localhost6.localdomain6localhost6

#node1

172.16.0.191 node1.localdomain node1

172.16.0.193 node1-vip.localdomain node1-vip

192.168.94.11 node1-priv.localdomain node1-priv

#node2

172.16.0.192 node2.localdomain node2

172.16.0.194 node2-vip.localdomain node2-vip

192.168.94.12 node2-priv.localdomain node2-priv

#scan-ip

172.16.0.203 scan-cluster.localdomain scan-cluster

[root@node1~]#

3 2.3  配置  S DNS  服务器,确认  SCAN  IP  可以被解析

从 Oracle 11gR2 开始,引入 SCAN(Single Client Access Name) IP 的概念,相当于在客户

端和数据库之间增加一层虚拟的网络服务层,即是 SCAN IP 和 SCAP IP Listener。在客户端

的 tnsnames.ora 配置文件中,只需要配置SCAN IP 的配置信息即可,客户端通过 SCAN IP 、

SCAN IP Listener 来访问数据库。同之前各版本的 RAC 相比,使用 SCAN IP 的好处就是,

当后台 RAC 数据库添加、删除节点时,客户端配置信息无需修改。可以通过配置 DNS服

务器或 GNS 来配置 SCAN,我们这里以 DNS 为例来进行配置。

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

1 2.3.1  配置  DNS  服务器

这里,选择 IP 地址为 172.16.0.176的服务器来配置 DNS 服务器。

①安装 DNS 软件包:

[root@rdddns_rpm]#ifconfigeth0

eth0 Linkencap:Ethernet HWaddr00:0C:29:99:DA:22

inetaddr:172.16.0.176 Bcast:172.16.15.255

Mask:255.255.240.0

inet6addr:fe80::20c:29ff:fe99:da22/64Scope:Link

UPBROADCASTRUNNINGMULTICAST MTU:1500 Metric:1

RXpackets:10237921errors:0dropped:0overruns:0frame:0

TXpackets:1394986errors:0dropped:0overruns:0carrier:0

collisions:0txqueuelen:1000

RX bytes:3375785216 (3.1 GiB) TX bytes:596171214(568.5 MiB)

[root@rdddns_rpm]#pwd

/root/dns_rpm

[root@rdddns_rpm]#ll

total1112

-rw-r--r--1rootroot1015531Apr2314:53

bind-9.3.6-4.P1.el5_4.2.x86_64.rpm

-rw-r--r--1rootroot 45360Apr2314:53

bind-chroot-9.3.6-4.P1.el5_4.2.x86_64.rpm

-rw-r--r--1rootroot 62251Apr2314:53

caching-nameserver-9.3.6-4.P1.el5_4.2.x86_64.rpm

[root@rdddns_rpm]#rpm-ivhbind-9.3.6-4.P1.el5_4.2.x86_64.rpm

warning:bind-9.3.6-4.P1.el5_4.2.x86_64.rpm:HeaderV3DSAsignature:

NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:bind

###########################################[100%]

[root@rdd dns_rpm]# rpm -ivh bind-chroot-9.3.6-4.P1.el5_4.2.x86_64.rpm

warning:bind-chroot-9.3.6-4.P1.el5_4.2.x86_64.rpm:HeaderV3DSA

signature:NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:bind-chroot

###########################################[100%]

[root@rdddns_rpm]#rpm-ivh

caching-nameserver-9.3.6-4.P1.el5_4.2.x86_64.rpm

warning:caching-nameserver-9.3.6-4.P1.el5_4.2.x86_64.rpm:HeaderV3

DSAsignature:NOKEY,keyID1e5e0159

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Preparing...

###########################################[100%]

1:caching-nameserver

###########################################[100%]

[root@rdddns_rpm]#

② 配置/var/named/chroot/etc/named.conf 文件

先拷贝生成该文件:

[root@rdddns_rpm]#cd/var/named/chroot/etc/

[root@rddetc]#ll

total16

-rw-r--r--1rootroot 405Apr1807:50localtime

-rw-r----- 1 root named 1230 Jan 21 2010 named.caching-nameserver.conf

-rw-r-----1rootnamed 955Jan21 2010named.rfc1912.zones

-rw-r-----1rootnamed 113Apr2314:55rndc.key

[root@rddetc]#cp-pnamed.caching-nameserver.confnamed.conf

[root@rddetc]#

修改后的该文件内容如下:

[root@rddetc]#pwd

/var/named/chroot/etc

[root@rddetc]#catnamed.conf

//

//named.caching-nameserver.conf

//

//ProvidedbyRedHatcaching-nameserverpackagetoconfigurethe

//ISCBINDnamed(8)DNSserverasacachingonlynameserver

//(asalocalhostDNSresolveronly).

//

//See/usr/share/doc/bind*/sample/forexamplenamedconfiguration

files.

//

//DONOTEDITTHISFILE-usesystem-config-bindoraneditor

//tocreatenamed.conf-editstothisfilewillbeloston

//caching-nameserverpackageupgrade.

//

options{

listen-onport53{  any; ; };

listen-on-v6port53{::1;};

directory "/var/named";

dump-file "/var/named/data/cache_dump.db";

statistics-file"/var/named/data/named_stats.txt";

memstatistics-file"/var/named/data/named_mem_stats.txt";

// Those options should be used carefully because they disable

port

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

//randomization

//query-source port53;

//query-source-v6port53;

allow-query { ; any; };

allow-query-cache{ ; any; };

};

logging{

channeldefault_debug{

file"data/named.run";

severitydynamic;

};

};

viewlocalhost_resolver{

match-clients { ; any; };

match-destinations{ ; any; };

recursionyes;

include"/etc/named.rfc1912.zones";

};

[root@rddetc]#

说明:为简单起见,将该文件中的 127.0.0.1、localhost 全部修改成any,且修改时,需

要注意左右两边留空格。修改部分在上述配置文件中以红色加粗标示。

通过拷贝来生成/var/named/chroot/etc/named.conf 文件时,注意加上-p 选项,来保证文

件的权限问题,否则会导致 DNS 服务启不来!

③ 配置 Zone 文件,修改/var/named/chroot/etc/named.rfc1912.zones 文件

配置 Zone 的目的是为了解析 SCANIP,在该文件末尾添加以下反向 Zone:

zone"0.16.172.in-addr.arpa."IN{

typemaster;

file"0.16.172.in-addr.arpa";

allow-update{none;};

};

配置反向 Zone 之后的该文件内容如下:

[root@rddetc]#pwd

/var/named/chroot/etc

[root@rddetc]#ll

total20

-rw-r--r--1rootroot 405Apr1807:50localtime

-rw-r----- 1 root named 1230 Jan 21 2010 named.caching-nameserver.conf

-rw-r-----1rootroot 1200Apr2315:03named.conf

-rw-r-----1rootnamed1085Apr2315:19named.rfc1912.zones

-rw-r-----1rootnamed 113Apr2314:55rndc.key

[root@rddetc]#catnamed.rfc1912.zones

//named.rfc1912.zones:

//

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

//ProvidedbyRedHatcaching-nameserverpackage

//

//ISCBINDnamedzoneconfigurationforzonesrecommendedby

//RFC1912section4.1:localhostTLDsandaddresszones

//

//See/usr/share/doc/bind*/sample/forexamplenamedconfiguration

files.

//

zone"."IN{

typehint;

file"named.ca";

};

zone"localdomain"IN{

typemaster;

file"localdomain.zone";

allow-update{none;};

};

zone"localhost"IN{

typemaster;

file"localhost.zone";

allow-update{none;};

};

zone"0.0.127.in-addr.arpa"IN{

typemaster;

file"named.local";

allow-update{none;};

};

zone

"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.ar

pa"IN{

typemaster;

file"named.ip6.local";

allow-update{none;};

};

zone"255.in-addr.arpa"IN{

typemaster;

file"named.broadcast";

allow-update{none;};

};

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

zone"0.in-addr.arpa"IN{

typemaster;

file"named.zero";

allow-update{none;};

};

e zone " "0.16.172.in-addr.arpa." N IN { {

e type  master;

e file  "0.16.172.in-addr.arpa";

e allow-update { { ; none;  };

};

[root@rddetc]#

说明 :正常情况下还应该配置正向 Zone 文件。这里,我们的 RAC 双节点 node1、node2

的 域 名 domain都 设 置 为 localdomain , 而 默 认 情 况 下 , 该 配 置 文 件

(/var/named/chroot/etc/named.rfc1912.zones)的第 15 行到第 20 行中已经自带下述正向 Zone 文

件配置信息,所以无需再添加。

zone"localdomain"IN{

typemaster;

file"localdomain.zone";

allow-update{none;};

};

④ 配置正、反向解析数据库文件。在/var/named/chroot/var/named路径下进行配置

首先,生成正、反向解析数据库文件。利用/var/named/chroot/var/named/localhost.zone

复制生成正向解析的数据库文件,利用/var/named/chroot/var/named/localhost.zone 复制生成

名为 0.16.172.in-addr.arpa 的反向解析的数据库文件。

[root@rddetc]#pwd

/var/named/chroot/etc

[root@rddetc]#cd/var/named/chroot/var/named/

[root@rddnamed]#ll

total36

drwxrwx---2namednamed4096Aug26 2004data

-rw-r-----1root named 198Jan21 2010localdomain.zone

-rw-r-----1root named 195Jan21 2010localhost.zone

-rw-r-----1root named 427Jan21 2010named.broadcast

-rw-r-----1root named1892Jan21 2010named.ca

-rw-r-----1root named 424Jan21 2010named.ip6.local

-rw-r-----1root named 426Jan21 2010named.local

-rw-r-----1root named 427Jan21 2010named.zero

drwxrwx---2namednamed4096Jul27 2004slaves

[root@rddnamed]#cp-pnamed.local0.16.172.in-addr.arpa

[root@rddnamed]#ll

total40

-rw-r-----1root named 426Apr2316:100.16.172.in-addr.arpa

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

drwxrwx---2namednamed4096Aug26 2004data

-rw-r-----1root named 198Jan21 2010localdomain.zone

-rw-r-----1root named 195Jan21 2010localhost.zone

-rw-r-----1root named 427Jan21 2010named.broadcast

-rw-r-----1root named1892Jan21 2010named.ca

-rw-r-----1root named 424Jan21 2010named.ip6.local

-rw-r-----1root named 426Jan21 2010named.local

-rw-r-----1root named 427Jan21 2010named.zero

drwxrwx---2namednamed4096Jul27 2004slaves

[root@rddnamed]#

说明: :在上述步骤③中我们没有配置正向 Zone 文件,故只需生成反向解析数据库文件 ,

正向解析数据库文件利用默认的 localdomain.zone 文件。

生成的正、反向解析数据库文件名一定要同上述步骤③中定义的正、反向 Zone 文件一

致,否则 DNS 出错!

然后,定义正、反向解析数据库文件。

在正向解析数据库文件 localdomain.zone 末尾添加下述内容:

scan-cluster INA 172.16.0.203

添加后内容如下:

[root@rddnamed]#pwd

/var/named/chroot/var/named

[root@rddnamed]#catlocaldomain.zone

$TTL 86400

@ INSOA localhostroot(

42 ;serial(d.

adams)

3H ;refresh

15M ;retry

1W ;expiry

1D) ;minimum

INNS localhost

localhost INA 127.0.0.1

scan-cluster INA 172.16.0.203

[root@rddnamed]#

在反向解析数据库文件 0.16.172.in-addr.arpa 末尾添加下述内容:

203 INPTR scan-cluster.localdomain.

添加后内容如下:

[root@rddnamed]#pwd

/var/named/chroot/var/named

[root@rddnamed]#cat0.16.172.in-addr.arpa

$TTL 86400

@ IN SOA localhost.root.localhost. (

1997022700;Serial

28800 ;Refresh

14400 ;Retry

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

3600000 ;Expire

86400) ;Minimum

IN NS localhost.

1 IN PTR localhost.

203 INPTR scan-cluster.localdomain.

[root@rddnamed]#

2 2.3.2  测试  DNS  服务器解析  SCAN  IP  正常

首先,在 DNS 服务器 172.16.0.176 上启动 DNS 服务:

[root@rddnamed]#/etc/init.d/namedstatus

rndc:connectfailed:127.0.0.1#953:connectionrefused

namedisstopped

[root@rddnamed]#/etc/init.d/namedstart

Startingnamed:[ OK ]

[root@rddnamed]#/etc/init.d/namedstatus

numberofzones:7

debuglevel:0

xfersrunning:0

xfersdeferred:0

soaqueriesinprogress:0

queryloggingisOFF

recursiveclients:0/1000

tcpclients:0/100

serverisupandrunning

named(pid 23307)isrunning...

[root@rddnamed]#chkconfignamedon

[root@rddnamed]#

然后,分别在 RAC 节点 node1、node2 的/etc/resolv.conf 配置文件中添加下述配置信息:

searchlocaldomain

nameserver172.16.0.176

添加之后:

[root@node1~]#cat/etc/resolv.conf

searchlocaldomain

nameserver172.16.0.176

[root@node1~]#

最后,测试 SCAN IP 解析是否成功?

node1 测试:

[root@node1~]#nslookup172.16.0.203

Server: 172.16.0.176

Address: 172.16.0.176#53

203.0.16.172.in-addr.arpa name=scan-cluster.localdomain.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

[root@node1~]#nslookupscan-cluster.localdomain

Server: 172.16.0.176

Address: 172.16.0.176#53

Name: scan-cluster.localdomain

Address:172.16.0.203

[root@node1~]#nslookupscan-cluster

Server: 172.16.0.176

Address: 172.16.0.176#53

Name: scan-cluster.localdomain

Address:172.16.0.203

[root@node1~]#

node2 测试:

[root@node2~]#nslookup172.16.0.203

Server: 172.16.0.176

Address: 172.16.0.176#53

203.0.16.172.in-addr.arpa name=scan-cluster.localdomain.

[root@node2~]#nslookupscan-cluster.localdomain

Server: 172.16.0.176

Address: 172.16.0.176#53

Name: scan-cluster.localdomain

Address:172.16.0.203

[root@node2~]#nslookupscan-cluster

Server: 172.16.0.176

Address: 172.16.0.176#53

Name: scan-cluster.localdomain

Address:172.16.0.203

[root@node2~]#

至此,准备工作中的配置 SCAN IP 通过配置 DNS 服务器来解析已经成功!

4 2.4  建用户、改口令、修改用户配置文件

配置 11gR2RAC 需要安装 Oracle Grid Infrastructure 软件、Oracle 数据库软件,其中 Grid

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

软件等同于 Oracle 10g 的 Clusterware 集群件。Oracle 建议以不同的用户分别安装 Grid

Infrastructure 软件、Oracle 数据库软件,我们这里以 grid 用户安装 Grid Infrastructure,oracle

用户安装 Oracle 数据库软件。并且 grid、oracle 用户需要属于不同的用户组。在配置 RAC

时,还要求这两个用户在 RAC 的不同节点上 uid、gid 要一致。用户、组的对应信息见下表:

p Group  Name p Group  ID p Group  Info e Oracle  User(1100) d Grid  User(1101)

oinstall 1000 InventoryGroup Y Y

dba 1300 OSDBAGroup Y

oper 1301 OSOPER Group Y

asmadmin 1200 OSASM Y

asmdba 1201 OSDBAforASM Y Y

asmoper 1202 OSOPER forASM Y

(Figure 2.4 用户、组配置信息表)

我们可以通过执行下述 shell 脚本的 1preusers.sh 来完成用户、组的创建, 脚本的具

体内容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#ll

total24

-rwxr--r--1rootroot3544Apr2409:401preusers.sh

-rwxr--r--1rootroot 678Apr2409:402predir.sh

-rwxr--r--1rootroot 858Apr2409:403prelimits.sh

-rwxr--r--1rootroot 465Apr2409:404prelogin.sh

-rwxr--r--1rootroot 651Apr2409:405preprofile.sh

-rwxr--r--1rootroot1132Apr2409:406presysctl.sh

[root@node1shell]#  ./1preusers.sh

Nowcreate6groupsnamed

'oinstall','dba','asmadmin','asmdba','asmoper','oper'

Plus2usersnamed'oracle','grid',AlsosettingtheEnvironment

Changingpasswordforusergrid.

passwd:allauthenticationtokensupdatedsuccessfully.

Changingpasswordforuseroracle.

passwd:allauthenticationtokensupdatedsuccessfully.

TheGroupsandusershasbeencreated

TheEnvironmentforgrid,oraclealsohasbeensetsuccessfully

[root@node1shell]# d id  grid

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[root@node1shell]# d id  oracle

uid=1101(oracle)gid=1000(oinstall)

groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

[root@node1shell]#

说明 :在节点 node2 上执行该脚本时,需要将 grid 用户环境变量 ORACLE_SID 修改为

+ASM2,oracle 用户环境变量 ORACLE_SID 修改为 devdb2,ORACLE_HOSTNAME 环境变

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

量修改为 node2.localdomain

5 2.5  建路径、改权限

关于 grid、oracle 用户的环境变量配置信息,见下述表格。

t Environment  Variable d Grid  User e Oracle  User

ORACLE_BASE /u01/app/grid /u01/app/oracle

ORACLE_HOME /u01/app/11.2.0/grid /u01/app/oracle/product/11.2.0/db_1

ORACLE_SID [node1] +ASM1 devdb1

ORACLE_SID [node2] +ASM2 devdb2

(Figure 2.5 环境变量配置信息表)

通过执行上述 2.4 节中脚本 2predir.sh 来完成相关路径、权限的配置。脚本的具体内

容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#./2predir.sh

Now create the necessary directory for oracle,grid users and change the

authentiontooracle,gridusers...

The necessary directory for oracle,gridusers and change the authention

tooracle,gridusershasbeenfinished

[root@node1shell]#cd/u01/app/

[root@node1app]#ll

total12

drwxrwxr-x3grid oinstall4096Apr2410:0611.2.0

drwxrwxr-x2grid oinstall4096Apr2410:06grid

drwxrwxr-x2oracleoinstall4096Apr2410:06oracle

[root@node1app]#

6 2.6  修改 /etc/security/limits.conf ,配置  oracle 、 d grid  用户 的

l shell  限制

通过执行上述 2.4 节中脚本 3prelimits.sh 完成。脚本的具体内容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#./3prelimits.sh

Nowmodifythe/etc/security/limits.conf,butbackupitnamed

/etc/security/limits.conf.bakbefore

Modifingthe/etc/security/limits.confhasbeensucceed.

[root@node1shell]#

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

7 2.7  修改 n /etc/pam.d/login  配置文件

通过执行上述 2.4 节中脚本 4prelogin.sh 完成。脚本的具体内容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#./4prelogin.sh

Nowmodifythe/etc/pam.d/login,butwithabackupnamed

/etc/pam.d/login.bak

Modifingthe/etc/pam.d/loginhasbeensucceed.

[root@node1shell]#

8 2.8  修改 e /etc/profile  文件

通过执行上述 2.4 节中脚本 5preprofile.sh 完成。脚本的具体内容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#./5preprofile.sh

Now modify the /etc/profile,but with a backup named /etc/profile.bak

Modifingthe/etc/profilehasbeensucceed.

[root@node1shell]#

9 2.9  修改内核配置文件

通过执行上述 2.4 节中脚本 6presysctl.sh 完成。脚本的具体内容可见本文档附录。

[root@node1shell]#pwd

/root/shell

[root@node1shell]#./6presysctl.sh

Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak

Modifingthe/etc/sysctl.confhasbeensucceed.

Nowmakethechangestakeeffect.....

net.ipv4.ip_forward=0

net.ipv4.conf.default.rp_filter=1

net.ipv4.conf.default.accept_source_route=0

kernel.sysrq=0

kernel.core_uses_pid=1

net.ipv4.tcp_syncookies=1

kernel.msgmnb=65536

kernel.msgmax=65536

kernel.shmmax=68719476736

kernel.shmall=4294967296

fs.aio-max-nr=1048576

fs.file-max=6815744

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

kernel.shmall=2097152

kernel.shmmax=536870912

kernel.shmmni=4096

kernel.sem=25032000100128

net.ipv4.ip_local_port_range=900065500

net.core.rmem_default=262144

net.core.rmem_max=4194304

net.core.wmem_default=262144

net.core.wmem_max=1048586

net.ipv4.tcp_wmem=262144262144262144

net.ipv4.tcp_rmem=419430441943044194304

[root@node1shell]#

0 2.10  停止  p ntp  服务, 2 11gR2  新增的检查项

[root@node1~]#servicentpdstatus

ntpdisstopped

[root@node1~]#chkconfigntpdoff

[root@node1~]#cat/etc/ntp

ntp/ ntp.conf

[root@node1~]#cp/etc/ntp.conf/etc/ntp.conf.bak

[root@node1~]#rm-rf/etc/ntp.conf

[root@node1~]#

1 2.11  节点 2 2 2 2  准备工作

我们已经在 node1 完成基本准备配置工作,在 node2上重复上述 2.2 到2.10节中准备工

作,以完成节点 2的准备工作。

说明:2.3 节配置 SCAN IP 已在节点 2 上完成,可忽略。2.4 节中需要修改对应的环境

变量。

2 2.12  配置  oracle , d grid  用户  SSH  对等性

虽然在安装软件的过程中,oracle 会自动配置 SSH 对等性,建议在安装软件之前手工配

置。

配置 oracle 用户对等性:

node1:

[root@node1~]#su-oracle

node1->env|grepORA

ORACLE_UNQNAME=devdb

ORACLE_SID=devdb1

ORACLE_BASE=/u01/app/oracle

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ORACLE_HOSTNAME=node1.localdomain

ORACLE_TERM=xterm

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

node1->pwd

/home/oracle

node1->mkdir~/.ssh

node1->chmod700~/.ssh

node1->ls-al

total44

drwx------4oracleoinstall4096Apr2410:47.

drwxr-xr-x4root root 4096Apr2409:41..

-rw-------1oracleoinstall 5Apr2410:43.bash_history

-rw-r--r--1oracleoinstall 33Apr2409:41.bash_logout

-rw-r--r--1oracleoinstall 823Apr2409:41.bash_profile

-rw-r--r--1oracleoinstall 124Apr2409:41.bashrc

-rw-r--r--1oracleoinstall 515Apr2409:41.emacs

drwxr-xr-x4oracleoinstall4096Apr2409:41.mozilla

drwx------2oracleoinstall4096Apr2410:47.ssh

-rw-r--r--1oracleoinstall 658Apr2409:41.zshrc

node1->ssh-keygen-trsa

Generatingpublic/privatersakeypair.

Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_rsa):

Enterpassphrase(emptyfornopassphrase):

Entersamepassphraseagain:

Youridentificationhasbeensavedin/home/oracle/.ssh/id_rsa.

Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_rsa.pub.

Thekeyfingerprintis:

4a:bd:22:4c:cc:6a:33:ae:5a:de:7d:7c:8b:77:9e:81

oracle@node1.localdomain

node1->ssh-keygen-tdsa

Generatingpublic/privatedsakeypair.

Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_dsa):

Enterpassphrase(emptyfornopassphrase):

Entersamepassphraseagain:

Youridentificationhasbeensavedin/home/oracle/.ssh/id_dsa.

Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_dsa.pub.

Thekeyfingerprintis:

8b:50:73:41:03:ad:1c:59:25:aa:40:1c:c9:5e:03:99

oracle@node1.localdomain

node1->

node2:

[root@node2~]#su-oracle

node2->env|grepORA

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ORACLE_UNQNAME=devdb

ORACLE_SID=devdb2

ORACLE_BASE=/u01/app/oracle

ORACLE_HOSTNAME=node2.localdomain

ORACLE_TERM=xterm

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

node2->pwd

/home/oracle

node2->ls-al

total40

drwx------3oracleoinstall4096Apr2410:45.

drwxr-xr-x4root root 4096Apr2410:44..

-rw-------1oracleoinstall 10Apr2410:49.bash_history

-rw-r--r--1oracleoinstall 33Apr2410:44.bash_logout

-rw-r--r--1oracleoinstall 823Apr2410:44.bash_profile

-rw-r--r--1oracleoinstall 124Apr2410:44.bashrc

-rw-r--r--1oracleoinstall 515Apr2410:44.emacs

drwxr-xr-x4oracleoinstall4096Apr2410:44.mozilla

-rw-r--r--1oracleoinstall 658Apr2410:44.zshrc

node2->mkdir~/.ssh

node2->chmod770~/.ssh/

node2->ls-al

total44

drwx------4oracleoinstall4096Apr2410:49.

drwxr-xr-x4root root 4096Apr2410:44..

-rw-------1oracleoinstall 10Apr2410:49.bash_history

-rw-r--r--1oracleoinstall 33Apr2410:44.bash_logout

-rw-r--r--1oracleoinstall 823Apr2410:44.bash_profile

-rw-r--r--1oracleoinstall 124Apr2410:44.bashrc

-rw-r--r--1oracleoinstall 515Apr2410:44.emacs

drwxr-xr-x4oracleoinstall4096Apr2410:44.mozilla

drwxrwx---2oracleoinstall4096Apr2410:49.ssh

-rw-r--r--1oracleoinstall 658Apr2410:44.zshrc

node2->ssh-keygen-trsa

Generatingpublic/privatersakeypair.

Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_rsa):

Enterpassphrase(emptyfornopassphrase):

Entersamepassphraseagain:

Youridentificationhasbeensavedin/home/oracle/.ssh/id_rsa.

Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_rsa.pub.

Thekeyfingerprintis:

a0:64:81:a6:12:b2:18:4e:01:c3:bd:9d:f6:bb:55:b0

oracle@node2.localdomain

node2->ssh-keygen-tdsa

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Generatingpublic/privatedsakeypair.

Enterfileinwhichtosavethekey(/home/oracle/.ssh/id_dsa):

Enterpassphrase(emptyfornopassphrase):

Entersamepassphraseagain:

Youridentificationhasbeensavedin/home/oracle/.ssh/id_dsa.

Yourpublickeyhasbeensavedin/home/oracle/.ssh/id_dsa.pub.

Thekeyfingerprintis:

85:56:69:73:74:a3:ef:5b:88:d7:6d:ef:90:03:b6:72

oracle@node2.localdomain

node2->

返回节点 1:

node1->id

uid=1101(oracle)gid=1000(oinstall)

groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

node1->pwd

/home/oracle

node1->cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys

node1->cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys

node1->sshnode2cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys

Theauthenticityofhost'node2(172.16.0.192)'can'tbeestablished.

RSA key fingerprint is a7:6b:2c:2d:fb:c3:ff:33:af:92:cd:7b:99:3b:cf:3a.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning:Permanentlyadded'node2,172.16.0.192'(RSA)tothelistof

knownhosts.

oracle@node2'spassword:

node1->sshnode2cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys

oracle@node2'spassword:

node1->scp~/.ssh/authorized_keysnode2:~/.ssh/authorized_keys

oracle@node2'spassword:

authorized_keys

100%2040 2.0KB/s 00:00

node1->

验证 oracle SSH 对等性:

在 node1,node2 两个节点上分别执行下述命令,第一次执行时需要口令验证:

node1->id

uid=1101(oracle)gid=1000(oinstall)

groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

node1->sshnode1date

Theauthenticityofhost'node1(172.16.0.191)'can'tbeestablished.

RSA key fingerprint is 16:c2:67:cd:73:dd:b7:8b:f4:07:ef:e0:fb:36:34:3e.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning:Permanentlyadded'node1,172.16.0.191'(RSA)tothelistof

knownhosts.

TueApr2411:28:15CST2012

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node1->sshnode2date

TueApr2411:28:18CST2012

node1->sshnode1-privdate

Theauthenticityofhost'node1-priv(192.168.94.11)'can'tbe

established.

RSA key fingerprint is 16:c2:67:cd:73:dd:b7:8b:f4:07:ef:e0:fb:36:34:3e.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node1-priv,192.168.94.11' (RSA) to the list

ofknownhosts.

TueApr2411:28:25CST2012

node1->sshnode2-privdate

Theauthenticityofhost'node2-priv(192.168.94.12)'can'tbe

established.

RSA key fingerprint is a7:6b:2c:2d:fb:c3:ff:33:af:92:cd:7b:99:3b:cf:3a.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node2-priv,192.168.94.12' (RSA) to the list

ofknownhosts.

TueApr2411:28:30CST2012

node1->sshnode1.localdomaindate

Theauthenticityofhost'node1.localdomain(172.16.0.191)'can'tbe

established.

RSA key fingerprint is 16:c2:67:cd:73:dd:b7:8b:f4:07:ef:e0:fb:36:34:3e.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node1.localdomain' (RSA) to the list of known

hosts.

TueApr2411:28:39CST2012

node1->sshnode2.localdomaindate

Theauthenticityofhost'node2.localdomain(172.16.0.192)'can'tbe

established.

RSA key fingerprint is a7:6b:2c:2d:fb:c3:ff:33:af:92:cd:7b:99:3b:cf:3a.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node2.localdomain' (RSA) to the list of known

hosts.

TueApr2411:28:46CST2012

node1->sshnode2-priv.localdomaindate

The authenticity of host 'node2-priv.localdomain(192.168.94.12)' can't

beestablished.

RSA key fingerprint is a7:6b:2c:2d:fb:c3:ff:33:af:92:cd:7b:99:3b:cf:3a.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node2-priv.localdomain' (RSA) to the list of

knownhosts.

TueApr2411:28:52CST2012

node1->sshnode1-priv.localdomaindate

The authenticity of host 'node1-priv.localdomain(192.168.94.11)' can't

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

beestablished.

RSA key fingerprint is 16:c2:67:cd:73:dd:b7:8b:f4:07:ef:e0:fb:36:34:3e.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning: Permanently added 'node1-priv.localdomain' (RSA) to the list of

knownhosts.

TueApr2411:28:59CST2012

第二次执行时不再提示输入口令,并且可以成功执行命令,则表示 oracle 用户 SSH 对等性

配置成功

node1:

node1->sshnode1date

TueApr2411:29:02CST2012

node1->sshnode2date

TueApr2411:29:07CST2012

node1->sshnode1-privdate

TueApr2411:29:13CST2012

node1->sshnode2-privdate

TueApr2411:29:18CST2012

node1->sshnode2-priv.localdomaindate

TueApr2411:29:27CST2012

node1->sshnode1-priv.localdomaindate

TueApr2411:29:33CST2012

node1->

node2:

node2->id

uid=1101(oracle)gid=1000(oinstall)

groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

node2->pwd

/home/oracle

node2->sshnode1date

TueApr2411:32:06CST2012

node2->sshnode2date

TueApr2411:32:09CST2012

node2->sshnode1-privdate

TueApr2411:32:14CST2012

node2->sshnode2-privdate

TueApr2411:32:17CST2012

node2->sshnode1.localdomaindate

TueApr2411:32:26CST2012

node2->sshnode2.localdomaindate

TueApr2411:32:29CST2012

node2->sshnode1-priv.localdomaindate

TueApr2411:32:39CST2012

node2->sshnode2-priv.localdomaindate

TueApr2411:32:43CST2012

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node2->

至此,Oracle 用户 SSH 对等性配置完成!重复上述步骤,以 grid 用户配置对等性。

3 2.13  配置共享磁盘

在任意节点上先创建共享磁盘,然后在另外的节点上选择添加已有磁盘。这里选择先在

node2 节点机器上创建共享磁盘,然后在 node1 上添加。共创建 4块硬盘,其中 2 块 500M

的硬盘,将来用于配置 GRIDDG 磁盘组,专门存放 OCR 和 Voting Disk;1块 3G 的磁盘,

用于配置DATA磁盘组,存放数据库;1 块 3G 的磁盘,用于配置 FLASH 磁盘组,用于闪

回区;

在 node2 上创建共享硬盘详细步骤:

① 先关闭节点 2 11gnode2,然后选择 11gnode2,右键选择编辑设置,Edit settings:

② 在编辑虚拟机对话框下,选择添加,Add,选择硬盘,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

③ 选择创建新硬盘,Next:

④ 磁盘大小选择 500M,选中支持集群属性,指定磁盘的存放位置,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑤ 驱动器设备选择 SCSI 1:0,模式选择独立,Next:

⑥ 弹出对话框中,Finish:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑦ 虚拟机属性中,选择刚才新添加的 SCSI controller1 驱动器,配置其为 Physical 模式 ,

用于支持共享,因为这块新添加的硬盘将来要被 node1、node2 两个节点访问:

⑧ 重复执行上述③--⑥步骤,添加第二块 500M 硬盘,将其驱动器设备选择 SCSI 1:1;

⑨ 如法炮制,添加另外两块 3G 硬盘,驱动器设备分别选择 SCSI 2:0,SCSI 2:1,同样

需要配置新添加的 SCSI controller 2 驱动器模式为 Physical 模式,用于支持共享。最后,添

加完 4 块共享硬盘的 node2 配置信息如下:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

在 node1 上添加已有共享硬盘详细步骤:

① 先关闭节点 1 11gnode1,然后选择 11gnode1,右键选择编辑设置,Edit settings,操

作界面同 node2 上创建共享硬盘步骤①:

② 在编辑虚拟机对话框下,选择添加,Add,选择硬盘,Next,操作界面同node2 上创

建共享硬盘步骤②:

③ 选择已有虚拟硬盘,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ 选择指定的存储设备,注意要选择在 node2 节点中创建的第 1 块硬盘:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑤ 驱动器设备选择 SCSI 1:0,模式选择独立,Next,操作界面同 node2 上创建共享硬

盘步骤⑤:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑥ 同样选择新添加的 SCSI controller 1 驱动器,配置其为 Physical 模式,用于支持共享 ,

操作界面同 node2 上创建共享硬盘步骤 7:

⑦ 如法炮制,添加剩余的 3 块硬盘,注意,驱动器编号要依次选择 SCSI1:1、SCSI 2:0 、

SCSI 2:1。同时要将新添加的 SCSI controller 2 驱动器模式为 Physical 模式,用于支持共享 。

最后,添加完 4 块共享硬盘的 node1 配置信息如下:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

至此,完成在两个节点上对共享硬盘的添加配置。

2.14 4 4 4  配置  ASM  磁盘

在上一步 2.13 节中,我们已经对 RAC 双节点已经配置好了共享磁盘,接下来需要将这

些共享磁盘格式化、然后用 asmlib 将其配置为 ASM 磁盘,用于将来存放 OCR、VotingDisk

和数据库用。

注意:只需在其中 1 个节点上格式化就可以,接下来我们选择在 node1 节点上格式化。

这里我们以 asmlib 软件来创建 ASM 磁盘,而不使用 raw disk,而且从 11gR2 开始,OUI

的图形界面已经不再支持 raw disk。

1 2.14.1  格式化共享磁盘

① 以 root 用户分别在两个节点上执行fdisk 命令,查看现有硬盘分区信息:

node1:

[root@node1~]#fdisk-l

Disk/dev/sda:21.4GB,21474836480bytes

255heads,63sectors/track,2610cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 2163 17374266 83 Linux

/dev/sda2 2164 2609 3582495 82 Linuxswap/

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Solaris

Disk/dev/sdb:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

Disk/dev/sdbdoesn'tcontainavalidpartitiontable

Disk/dev/sdc:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

Disk/dev/sdcdoesn'tcontainavalidpartitiontable

Disk/dev/sdd:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

Disk/dev/sdddoesn'tcontainavalidpartitiontable

Disk/dev/sde:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

Disk/dev/sdedoesn'tcontainavalidpartitiontable

[root@node1~]#

node2:

[root@node2~]#fdisk-l

Disk/dev/sda:21.4GB,21474836480bytes

255heads,63sectors/track,2610cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 2163 17374266 83 Linux

/dev/sda2 2164 2609 3582495 82 Linuxswap/

Solaris

Disk/dev/sdb:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

Disk/dev/sdbdoesn'tcontainavalidpartitiontable

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Disk/dev/sdc:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

Disk/dev/sdcdoesn'tcontainavalidpartitiontable

Disk/dev/sdd:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

Disk/dev/sdddoesn'tcontainavalidpartitiontable

Disk/dev/sde:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

Disk/dev/sdedoesn'tcontainavalidpartitiontable

[root@node2~]#

从上,我们可以看到目前两个节点上的分区信息一致:其中/dev/sda 是用于存放操作系

统的,/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde 这 4 块盘都没有分区信息,这是我们在上一步

2.13节中配置的 4块共享磁盘。

② root 用户在 node1 上格式化/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde这 4块盘

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

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF

disklabel

BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,

untilyoudecidetowritethem.Afterthat,ofcourse,theprevious

contentwon'tberecoverable.

Warning: invalid flag 0x0000 of partition table4 will be corrected by

w(rite)

Command(mforhelp):n

Commandaction

e extended

p primarypartition(1-4)

p

Partitionnumber(1-4):1

Firstcylinder(1-500,default1):

Usingdefaultvalue1

Lastcylinderor+sizeor+sizeMor+sizeK(1-500,default500):

Usingdefaultvalue  500

Command(mforhelp):w

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Thepartitiontablehasbeenaltered!

Callingioctl()tore-readpartitiontable.

Syncingdisks.

[root@node1~]#

说明:fdisk /dev/sdb 表示要对/dev/sdb 磁盘进行格式化,其中,输入的命令分别表示:

n 表示新建 1 个分区;

p 表示分区类型选择为primary partition 主分区;

1 表示分区编号从1 开始;

起始、终止柱面选择默认值,即 1 和 500;

w 表示将新建的分区信息写入硬盘分区表。

③ 重复上述步骤②,以 root 用户在 node1 上分别格式化其余 3 块磁盘:

④ 格式化完毕之后,在 node1,node2 节点上分别看到下述信息:

node1:

[root@node1~]#fdisk-l

Disk/dev/sda:21.4GB,21474836480bytes

255heads,63sectors/track,2610cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 2163 17374266 83 Linux

/dev/sda2 2164 2609 3582495 82 Linuxswap/

Solaris

Disk/dev/sdb:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

DeviceBoot Start End Blocks Id System

/dev/sdb1 1 500 511984 83 Linux

Disk/dev/sdc:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

DeviceBoot Start End Blocks Id System

/dev/sdc1 1 500 511984 83 Linux

Disk/dev/sdd:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

/dev/sdd1 1 391 3140676 83 Linux

Disk/dev/sde:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sde1 1 391 3140676 83 Linux

[root@node1~]#

node2:

[root@node2~]#fdisk-l

Disk/dev/sda:21.4GB,21474836480bytes

255heads,63sectors/track,2610cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 2163 17374266 83 Linux

/dev/sda2 2164 2609 3582495 82 Linuxswap/

Solaris

Disk/dev/sdb:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

DeviceBoot Start End Blocks Id System

/dev/sdb1 1 500 511984 83 Linux

Disk/dev/sdc:524MB,524288000bytes

64heads,32sectors/track,500cylinders

Units=cylindersof2048*512=1048576bytes

DeviceBoot Start End Blocks Id System

/dev/sdc1 1 500 511984 83 Linux

Disk/dev/sdd:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sdd1 1 391 3140676 83 Linux

Disk/dev/sde:3221MB,3221225472bytes

255heads,63sectors/track,391cylinders

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Units=cylindersof16065*512=8225280bytes

DeviceBoot Start End Blocks Id System

/dev/sde1 1 391 3140676 83 Linux

[root@node2~]#

至此,格式化共享磁盘完毕。

2 2.14.2  在两个节点上安装  ASM  RPM  软件包

在安装 ASM 软件包时,要注意选择的软件包要与操作系统平台、内核版本选择一致 。

ASM 软件包可以到 Oracle 官网下载。

node1 安装:

[root@node1~]#rpm-qa|grepasm

用上述命令,并未发现节点 1 上安装任何 asm 软件包。

[root@node1~]#cdasm_rpm/

[root@node1asm_rpm]#ll

total136

-rw-r--r--1rootroot25977Apr2611:19

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm

-rw-r--r--1rootroot14176Apr2611:19

oracleasmlib-2.0.4-1.el5.x86_64.rpm

-rw-r--r--1rootroot89027Apr2611:19

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

[root@node1 asm_rpm]# rpm -ivh oracleasm-support-2.1.3-1.el5.x86_64.rpm

warning:oracleasm-support-2.1.3-1.el5.x86_64.rpm:HeaderV3DSA

signature:NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:oracleasm-support

###########################################[100%]

[root@node1asm_rpm]#rpm-ivh

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm

warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA

signature:NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:oracleasm-2.6.18-194.el###########################################

[100%]

[root@node1asm_rpm]#rpm-ivhoracleasmlib-2.0.4-1.el5.x86_64.rpm

warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature:

NOKEY,keyID1e5e0159

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Preparing...

###########################################[100%]

1:oracleasmlib

###########################################[100%]

[root@node1asm_rpm]#rpm-qa|grepasm

oracleasm-2.6.18-194.el5-2.0.5-1.el5

oracleasm-support-2.1.3-1.el5

oracleasmlib-2.0.4-1.el5

[root@node1asm_rpm]#

node2 安装:

[root@node2asm_rpm]#ll

total136

-rw-r--r--1rootroot25977Apr2611:20

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm

-rw-r--r--1rootroot14176Apr2611:20

oracleasmlib-2.0.4-1.el5.x86_64.rpm

-rw-r--r--1rootroot89027Apr2611:20

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

[root@node2asm_rpm]#rpm-qa|grepasm

[root@node2 asm_rpm]# rpm -ivh oracleasm-support-2.1.3-1.el5.x86_64.rpm

warning:oracleasm-support-2.1.3-1.el5.x86_64.rpm:HeaderV3DSA

signature:NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:oracleasm-support

###########################################[100%]

[root@node2asm_rpm]#rpm-ivh

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm

warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA

signature:NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:oracleasm-2.6.18-194.el###########################################

[100%]

[root@node2asm_rpm]#rpm-ivhoracleasmlib-2.0.4-1.el5.x86_64.rpm

warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature:

NOKEY,keyID1e5e0159

Preparing...

###########################################[100%]

1:oracleasmlib

###########################################[100%]

[root@node2asm_rpm]#rpm-qa|grepasm

oracleasmlib-2.0.4-1.el5

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

oracleasm-support-2.1.3-1.el5

oracleasm-2.6.18-194.el5-2.0.5-1.el5

[root@node2asm_rpm]#

说明:安装上述 3 个 ASM RPM 软件包时要先安装 oracleasm-support-2.1.3-1.el5 软件包 ,

其次安装 oracleasm-2.6.18-194.el5-2.0.5-1.el5 软件包,最后安装 oracleasmlib-2.0.4-1.el5 软件

包。

安装完毕后,执行 rpm -qa|grep asm 确认是否安装成功。

3 2.14.3  配置  ASM  r driver  服务

在 node1 上以 root 用户进行配置。在安装完上述步骤 2.14.2 节中的 3 个 ASM RPM 软

件 包 之 后 , 可 以 通 过 执 行 /usr/sbin/oracleasm 命 令 来 进 行 配 置 , 也 可 以 通 过 执 行

/etc/init.d/oracleasm 命令来进行配置,后者命令是Oracle 10g 中进行 ASM 配置的命令,Oracle

推荐执行前者命令,不过后者命令保留使用。

① 查看 ASM 服务状态:

[root@node1~]#/usr/sbin/oracleasmstatus

CheckingifASMisloaded:no

Checkingif/dev/oracleasmismounted:no

[root@node1~]#

看到,默认情况下 ASM 服务并未开启。具体命令和相关参数可以直接执行下述命令来

获取:

[root@node1~]#/usr/sbin/oracleasm-h

Usage:oracleasm[--exec-path=<exec_path>]<command>[<args>]

oracleasm--exec-path

oracleasm-h

oracleasm-V

Thebasicoracleasmcommandsare:

configure ConfiguretheOracleLinuxASMLibdriver

init LoadandinitializetheASMLibdriver

exit StoptheASMLibdriver

scandisks ScanthesystemforOracleASMLibdisks

status DisplaythestatusoftheOracleASMLibdriver

listdisks ListknownOracleASMLibdisks

querydisk DetermineifadiskbelongstoOracleASMlib

createdisk AllocateadeviceforOracleASMLibuse

deletedisk Returnadevicetotheoperatingsystem

renamedisk ChangethelabelofanOracleASMlibdisk

update-driver DownloadthelatestASMLibdriver

[root@node1~]#

② 配置 ASM 服务:

[root@node1~]#/usr/sbin/oracleasmconfigure-i

ConfiguringtheOracleASMlibrarydriver.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary

driver. Thefollowingquestionswilldeterminewhetherthedriveris

loadedonbootandwhatpermissionsitwillhave. Thecurrentvalues

willbeshowninbrackets('[]'). Hitting<ENTER>withouttypingan

answerwillkeepthatcurrentvalue. Ctrl-Cwillabort.

Defaultusertoownthedriverinterface[]:grid

Defaultgrouptoownthedriverinterface[]:asmadmin

StartOracleASMlibrarydriveronboot(y/n)[n]:y

ScanforOracleASMdisksonboot(y/n)[y]:y

WritingOracleASMlibrarydriverconfiguration:done

[root@node1~]#/usr/sbin/oracleasmstatus

CheckingifASMisloaded:no

Checkingif/dev/oracleasmismounted:no

[root@node1~]#/usr/sbin/oracleasminit

Loadingmodule"oracleasm":oracleasm

MountingASMlibdriverfilesystem:/dev/oracleasm

[root@node1~]#/usr/sbin/oracleasmconfigure

ORACLEASM_ENABLED=true

ORACLEASM_UID=grid

ORACLEASM_GID=asmadmin

ORACLEASM_SCANBOOT=true

ORACLEASM_SCANORDER=""

ORACLEASM_SCANEXCLUDE=""

[root@node1~]#

说明:/usr/sbin/oracleasm configure -i 命令进行配置时,用户配置为 grid,组为 asmadmin ,

启动 ASM library driver 驱动服务,并且将其配置为随着操作系统的启动而自动启动。

配置完成后,记得执行 /usr/sbin/oracleasm init 命令来加载 oracleasm 内核模块。

③ 在 node2 上执行上述步骤②,完成 ASM 服务配置。

2.14.4 4 4 4  配置  ASM  磁盘

我们安装 ASM RPM 软件包,配置 ASM 驱动服务的最终目的是要创建 ASM 磁盘,为

将来安装 grid 软件、创建 Oracle 数据库提供存储。

说明:只需在一个节点上创建 ASM 磁盘即可!创建完之后,在其它节点上执行

/usr/sbin/oracleasm scandisks 之后,就可看到 ASM 磁盘。

接下来,开始创建 ASM 磁盘:

① 执行/usr/sbin/oracleasm createdisk 来创建 ASM 磁盘

[root@node1~]#/usr/sbin/oracleasmlistdisks

[root@node1~]#/usr/sbin/oracleasmcreatedisk-h

Usage:oracleasm-createdisk[-l<manager>][-v]<label><device>

[root@node1~]#/usr/sbin/oracleasmcreatediskVOL1/dev/sdb1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Writingdiskheader:done

Instantiatingdisk:done

[root@node1~]#/usr/sbin/oracleasmcreatediskVOL2/dev/sdc1

Writingdiskheader:done

Instantiatingdisk:done

[root@node1~]#/usr/sbin/oracleasmcreatediskVOL3/dev/sdd1

Writingdiskheader:done

Instantiatingdisk:done

[root@node1~]#/usr/sbin/oracleasmcreatediskVOL4/dev/sde1

Writingdiskheader:done

Instantiatingdisk:done

[root@node1~]#/usr/sbin/oracleasmlistdisks

VOL1

VOL2

VOL3

VOL4

[root@node1~]#

从上看到,创建出来 4块 ASM 磁盘。此时,node2 上还看不到刚创建的 ASM 磁盘。

② node2 执行/usr/sbin/oracleasm scandisks 扫描磁盘

[root@node2~]#/usr/sbin/oracleasmlistdisks

[root@node2~]#/usr/sbin/oracleasmscandisks

Reloadingdiskpartitions:done

CleaninganystaleASMdisks...

ScanningsystemforASMdisks...

Instantiatingdisk"VOL1"

Instantiatingdisk"VOL2"

Instantiatingdisk"VOL3"

Instantiatingdisk"VOL4"

[root@node2~]#/usr/sbin/oracleasmlistdisks

VOL1

VOL2

VOL3

VOL4

[root@node2~]#

③ 如何确定 ASM 磁盘同物理磁盘之间的对应关系?

[root@node1~]#/usr/sbin/oracleasmquerydisk/dev/sd*

Device"/dev/sda"isnotmarkedasanASMdisk

Device"/dev/sda1"isnotmarkedasanASMdisk

Device"/dev/sda2"isnotmarkedasanASMdisk

Device"/dev/sdb"isnotmarkedasanASMdisk

Device"/dev/sdb1"ismarkedanASMdiskwiththelabel"VOL1"

Device"/dev/sdc"isnotmarkedasanASMdisk

Device"/dev/sdc1"ismarkedanASMdiskwiththelabel"VOL2"

Device"/dev/sdd"isnotmarkedasanASMdisk

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Device"/dev/sdd1"ismarkedanASMdiskwiththelabel"VOL3"

Device"/dev/sde"isnotmarkedasanASMdisk

Device"/dev/sde1"ismarkedanASMdiskwiththelabel"VOL4"

[root@node1~]#

至此,ASM 磁盘准备工作已经完成!

5 2.15  解压安装介质

在获取开篇 1.2 节中提到的安装介质如下:

[root@node1~]#ls-l

total3401724

-rw-------1rootroot 1376Apr2014:05anaconda-ks.cfg

drwxr-xr-x2rootroot 4096Apr2611:19asm_rpm

-rw-r--r--1rootroot 51217Apr2014:05install.log

-rw-r--r--1rootroot 4077Apr2014:05install.log.syslog

-rw-r--r--1rootroot1358454646Apr2016:22

p10404530_112030_Linux-x86-64_1of7.zip

-rw-r--r--1rootroot1142195302Apr2016:29

p10404530_112030_Linux-x86-64_2of7.zip

-rw-r--r--1rootroot 979195792Apr2017:07

p10404530_112030_Linux-x86-64_3of7.zip

drwxr-xr-x2rootroot 4096Apr2410:17shell

[root@node1~]#

其中:

p10404530_112030_Linux-x86-64_1of7.zip 和

p10404530_112030_Linux-x86-64_2of7.zip

是 Oracle 软件的安装介质。

p10404530_112030_Linux-x86-64_3of7.zip 是 GRID 软件的安装介质。

注意:这里的 3 个软件包均是来源于 MetaLink 网站,其版本均是目前 Oracle 11g 的最

新版本,11.2.0.3.0。如果没有 MetaLink 账号的话,也可以从从 oracle 官方网站免费获取

11.2.0.1.0 的版本软件。

我们通过下述命令来解压上述 3个压缩软件包:

[root@node1~]#unzipp10404530_112030_Linux-x86-64_1of7.zip

[root@node1~]#unzipp10404530_112030_Linux-x86-64_2of7.zip

[root@node1~]#unzipp10404530_112030_Linux-x86-64_3of7.zip

解压之后,信息如下:

[root@node1~]#ls-l

total3401724

-rw-------1rootroot 1376Apr2014:05anaconda-ks.cfg

drwxr-xr-x2rootroot 4096Apr2611:19asm_rpm

drwxr-xr-x8rootroot 4096Sep22 2011database

drwxr-xr-x8rootroot 4096Sep22 2011grid

-rw-r--r--1rootroot 51217Apr2014:05install.log

-rw-r--r--1rootroot 4077Apr2014:05install.log.syslog

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

-rw-r--r--1rootroot1358454646Apr2016:22

p10404530_112030_Linux-x86-64_1of7.zip

-rw-r--r--1rootroot1142195302Apr2016:29

p10404530_112030_Linux-x86-64_2of7.zip

-rw-r--r--1rootroot 979195792Apr2017:07

p10404530_112030_Linux-x86-64_3of7.zip

drwxr-xr-x2rootroot 4096Apr2410:17shell

[root@node1~]#du-shdatabase/

2.5G database/

[root@node1~]#du-shgrid/

1.1G grid/

[root@node1~]#

可以看到,数据库的安装文件 2.5G 大小,GRID 软件的安装 1.1GB。

为便于将来安装软件,分别将其 move 到 oracle 用户和 grid 用户的家目录:

[root@node1~]#mvdatabase//home/oracle/

[root@node1~]#mvgrid//home/grid/

[root@node1~]#

6 2.16  安装前预检查配置信息

在安装 GRID 之前,建议先利用 CVU(Cluster Verification Utility)检查 CRS 的安装前环

境。

① 使用CVU 检查CRS 的安装前环境:

[root@node1~]#su-grid

node1->pwd

/home/grid

node1->ls

Desktop grid

node1->cdgrid/

node1->ll

total72

drwxr-xr-x 9rootroot 4096Sep22 2011doc

drwxr-xr-x 4rootroot 4096Sep22 2011install

-rwxr-xr-x 1rootroot28122Sep22 2011readme.html

drwxr-xr-x 2rootroot 4096Sep22 2011response

drwxr-xr-x 2rootroot 4096Sep22 2011rpm

-rwxr-xr-x 1rootroot 4878Sep22 2011runcluvfy.sh

-rwxr-xr-x 1rootroot 3227Sep22 2011runInstaller

drwxr-xr-x 2rootroot 4096Sep22 2011sshsetup

drwxr-xr-x14rootroot 4096Sep22 2011stage

-rwxr-xr-x 1rootroot 4326Sep 2 2011welcome.html

node1-> ./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -verbose

Performingpre-checksforclusterservicessetup

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Checkingnodereachability...

Check:Nodereachabilityfromnode"node1"

DestinationNode Reachable?

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

node1 yes

node2 yes

Result:Nodereachabilitycheckpassedfromnode"node1"

Checkinguserequivalence...

Check:Userequivalenceforuser"grid"

NodeName Status

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

node2 passed

node1 passed

Result:Userequivalencecheckpassedforuser"grid"

Checkingnodeconnectivity...

Checkinghostsconfigfile...

NodeName Status

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

node2 passed

node1 passed

Verificationofthehostsconfigfilesuccessful

Interfaceinformationfornode"node2"

Name IPAddress Subnet Gateway Def.Gateway

HWAddress MTU

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

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

eth0 172.16.0.192 172.16.0.0 0.0.0.0 172.16.15.254

00:0C:29:00:42:891500

eth1 192.168.94.12 192.168.94.0 0.0.0.0 172.16.15.254

00:0C:29:00:42:931500

Interfaceinformationfornode"node1"

Name IPAddress Subnet Gateway Def.Gateway

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

HWAddress MTU

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

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

eth0 172.16.0.191 172.16.0.0 0.0.0.0 172.16.15.254

00:0C:29:A2:AE:1F1500

eth1 192.168.94.11 192.168.94.0 0.0.0.0 172.16.15.254

00:0C:29:A2:AE:291500

Check:Nodeconnectivityofsubnet"172.16.0.0"

Source Destination

Connected?

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

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

node2[172.16.0.192] node1[172.16.0.191] yes

Result:Nodeconnectivitypassedforsubnet"172.16.0.0"withnode(s)

node2,node1

Check:TCPconnectivityofsubnet"172.16.0.0"

Source Destination

Connected?

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

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

node1:172.16.0.191 node2:172.16.0.192

passed

Result:TCPconnectivitycheckpassedforsubnet"172.16.0.0"

Check:Nodeconnectivityofsubnet"192.168.94.0"

Source Destination

Connected?

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

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

node2[192.168.94.12] node1[192.168.94.11] yes

Result: Node connectivity passed for subnet "192.168.94.0" with node(s)

node2,node1

Check:TCPconnectivityofsubnet"192.168.94.0"

Source Destination

Connected?

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

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node1:192.168.94.11 node2:192.168.94.12

passed

Result:TCPconnectivitycheckpassedforsubnet"192.168.94.0"

Interfaces found on subnet "172.16.0.0" that are likely candidates for

VIPare:

node2eth0:172.16.0.192

node1eth0:172.16.0.191

Interfaces found on subnet "192.168.94.0" that are likely candidates for

aprivateinterconnectare:

node2eth1:192.168.94.12

node1eth1:192.168.94.11

Checkingsubnetmaskconsistency...

Subnetmaskconsistencycheckpassedforsubnet"172.16.0.0".

Subnetmaskconsistencycheckpassedforsubnet"192.168.94.0".

Subnetmaskconsistencycheckpassed.

Result:Nodeconnectivitycheckpassed

Checkingmulticastcommunication...

Checking subnet "172.16.0.0" for multicast communication with multicast

group"230.0.1.0"...

Check of subnet "172.16.0.0" for multicast communication with multicast

group"230.0.1.0"passed.

Checkingsubnet"192.168.94.0"formulticastcommunicationwith

multicastgroup"230.0.1.0"...

Check of subnet "192.168.94.0" for multicast communication with multicast

group"230.0.1.0"passed.

Checkofmulticastcommunicationpassed.

CheckingASMLibconfiguration.

NodeName Status

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

node2 passed

node1 passed

Result:CheckforASMLibconfigurationpassed.

Check:Totalmemory

NodeName Available Required

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Status

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

----------

node2 1.9641GB(2059516.0KB) 1.5GB(1572864.0KB)

passed

node1 1.9641GB(2059516.0KB) 1.5GB(1572864.0KB)

passed

Result:Totalmemorycheckpassed

Check:Availablememory

NodeName Available Required

Status

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

----------

node2 1.8744GB(1965456.0KB) 50MB(51200.0KB)

passed

node1 1.7501GB(1835088.0KB) 50MB(51200.0KB)

passed

Result:Availablememorycheckpassed

Check:Swapspace

NodeName Available Required

Status

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

----------

node2 3.4165GB(3582484.0KB) 2.9462GB(3089274.0KB)

passed

node1 3.4165GB(3582484.0KB) 2.9462GB(3089274.0KB)

passed

Result:Swapspacecheckpassed

Check:Freediskspacefor"node2:/tmp"

Path Node Name Mount point Available Required

Status

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

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

/tmp node2 / 13.0361GB 1GB

passed

Result:Freediskspacecheckpassedfor"node2:/tmp"

Check:Freediskspacefor"node1:/tmp"

Path Node Name Mount point Available Required

Status

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

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

/tmp node1 / 5.874GB 1GB

passed

Result:Freediskspacecheckpassedfor"node1:/tmp"

Check:Userexistencefor"grid"

NodeName Status Comment

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

node2 passed exists(1100)

node1 passed exists(1100)

CheckingformultipleuserswithUIDvalue1100

Result:CheckformultipleuserswithUIDvalue1100passed

Result:Userexistencecheckpassedfor"grid"

Check:Groupexistencefor"oinstall"

NodeName Status Comment

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

node2 passed exists

node1 passed exists

Result:Groupexistencecheckpassedfor"oinstall"

Check:Groupexistencefor"dba"

NodeName Status Comment

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

node2 passed exists

node1 passed exists

Result:Groupexistencecheckpassedfor"dba"

Check:Membershipofuser"grid"ingroup"oinstall"[asPrimary]

Node Name User Exists Group Exists User in Group Primary

Status

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

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

node2 yes yes yes yes

passed

node1 yes yes yes yes

passed

Result: Membership check for user "grid" in group "oinstall" [as Primary]

passed

Check:Membershipofuser"grid"ingroup"dba"

NodeName UserExists GroupExists UserinGroup Status

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

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

node2 yes yes no failed

node1 yes yes no failed

Result:Membershipcheckforuser"grid"ingroup"dba"failed

Check:Runlevel

NodeName runlevel Required

Status

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

----------

node2 5 3,5

passed

node1 5 3,5

passed

Result:Runlevelcheckpassed

Check:Hardlimitsfor"maximumopenfiledescriptors"

NodeName Type Available Required Status

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

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

node2 hard 65536 65536 passed

node1 hard 65536 65536 passed

Result:Hardlimitscheckpassedfor"maximumopenfiledescriptors"

Check:Softlimitsfor"maximumopenfiledescriptors"

NodeName Type Available Required Status

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

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

node2 soft 1024 1024 passed

node1 soft 1024 1024 passed

Result:Softlimitscheckpassedfor"maximumopenfiledescriptors"

Check:Hardlimitsfor"maximumuserprocesses"

NodeName Type Available Required Status

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

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

node2 hard 16384 16384 passed

node1 hard 16384 16384 passed

Result:Hardlimitscheckpassedfor"maximumuserprocesses"

Check:Softlimitsfor"maximumuserprocesses"

NodeName Type Available Required Status

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

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node2 soft 2047 2047 passed

node1 soft 2047 2047 passed

Result:Softlimitscheckpassedfor"maximumuserprocesses"

Check:Systemarchitecture

NodeName Available Required

Status

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

----------

node2 x86_64 x86_64

passed

node1 x86_64 x86_64

passed

Result:Systemarchitecturecheckpassed

Check:Kernelversion

NodeName Available Required

Status

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

----------

node2 2.6.18-194.el5 2.6.18

passed

node1 2.6.18-194.el5 2.6.18

passed

Result:Kernelversioncheckpassed

Check:Kernelparameterfor"semmsl"

NodeName Current Configured Required Status

Comment

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

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

node2 250 250 250 passed

node1 250 250 250 passed

Result:Kernelparametercheckpassedfor"semmsl"

Check:Kernelparameterfor"semmns"

NodeName Current Configured Required Status

Comment

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

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

node2 32000 32000 32000 passed

node1 32000 32000 32000 passed

Result:Kernelparametercheckpassedfor"semmns"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Kernelparameterfor"semopm"

NodeName Current Configured Required Status

Comment

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

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

node2 100 100 100 passed

node1 100 100 100 passed

Result:Kernelparametercheckpassedfor"semopm"

Check:Kernelparameterfor"semmni"

NodeName Current Configured Required Status

Comment

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

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

node2 128 128 128 passed

node1 128 128 128 passed

Result:Kernelparametercheckpassedfor"semmni"

Check:Kernelparameterfor"shmmax"

NodeName Current Configured Required Status

Comment

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

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

node2 1054472192 1054472192 1054472192 passed

node1 1054472192 1054472192 1054472192 passed

Result:Kernelparametercheckpassedfor"shmmax"

Check:Kernelparameterfor"shmmni"

NodeName Current Configured Required Status

Comment

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

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

node2 4096 4096 4096 passed

node1 4096 4096 4096 passed

Result:Kernelparametercheckpassedfor"shmmni"

Check:Kernelparameterfor"shmall"

NodeName Current Configured Required Status

Comment

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

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

node2 2097152 2097152 2097152 passed

node1 2097152 2097152 2097152 passed

Result:Kernelparametercheckpassedfor"shmall"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Kernelparameterfor"file-max"

NodeName Current Configured Required Status

Comment

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

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

node2 6815744 6815744 6815744 passed

node1 6815744 6815744 6815744 passed

Result:Kernelparametercheckpassedfor"file-max"

Check:Kernelparameterfor"ip_local_port_range"

NodeName Current Configured Required Status

Comment

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

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

node2 between 9000.0 & 65500.0 between 9000.0 & 65500.0

between9000.0&65500.0 passed

node1 between 9000.0 & 65500.0 between 9000.0 & 65500.0

between9000.0&65500.0 passed

Result:Kernelparametercheckpassedfor"ip_local_port_range"

Check:Kernelparameterfor"rmem_default"

NodeName Current Configured Required Status

Comment

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

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

node2 262144 262144 262144 passed

node1 262144 262144 262144 passed

Result:Kernelparametercheckpassedfor"rmem_default"

Check:Kernelparameterfor"rmem_max"

NodeName Current Configured Required Status

Comment

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

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

node2 4194304 4194304 4194304 passed

node1 4194304 4194304 4194304 passed

Result:Kernelparametercheckpassedfor"rmem_max"

Check:Kernelparameterfor"wmem_default"

NodeName Current Configured Required Status

Comment

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

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node2 262144 262144 262144 passed

node1 262144 262144 262144 passed

Result:Kernelparametercheckpassedfor"wmem_default"

Check:Kernelparameterfor"wmem_max"

NodeName Current Configured Required Status

Comment

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

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

node2 1048586 1048586 1048576 passed

node1 1048586 1048586 1048576 passed

Result:Kernelparametercheckpassedfor"wmem_max"

Check:Kernelparameterfor"aio-max-nr"

NodeName Current Configured Required Status

Comment

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

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

node2 1048576 1048576 1048576 passed

node1 1048576 1048576 1048576 passed

Result:Kernelparametercheckpassedfor"aio-max-nr"

Check:Packageexistencefor"make"

NodeName Available Required

Status

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

----------

node2 make-3.81-3.el5 make-3.81

passed

node1 make-3.81-3.el5 make-3.81

passed

Result:Packageexistencecheckpassedfor"make"

Check:Packageexistencefor"binutils"

NodeName Available Required

Status

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

----------

node2 binutils-2.17.50.0.6-14.el5 binutils-2.17.50.0.6

passed

node1 binutils-2.17.50.0.6-14.el5 binutils-2.17.50.0.6

passed

Result:Packageexistencecheckpassedfor"binutils"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Packageexistencefor"gcc(x86_64)"

NodeName Available Required

Status

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

----------

node2 gcc(x86_64)-4.1.2-48.el5 gcc(x86_64)-4.1.2

passed

node1 gcc(x86_64)-4.1.2-48.el5 gcc(x86_64)-4.1.2

passed

Result:Packageexistencecheckpassedfor"gcc(x86_64)"

Check:Packageexistencefor"libaio(x86_64)"

NodeName Available Required

Status

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

----------

node2 libaio(x86_64)-0.3.106-5 libaio(x86_64)-0.3.106

passed

node1 libaio(x86_64)-0.3.106-5 libaio(x86_64)-0.3.106

passed

Result:Packageexistencecheckpassedfor"libaio(x86_64)"

Check:Packageexistencefor"glibc(x86_64)"

NodeName Available Required

Status

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

----------

node2 glibc(x86_64)-2.5-49 glibc(x86_64)-2.5-24

passed

node1 glibc(x86_64)-2.5-49 glibc(x86_64)-2.5-24

passed

Result:Packageexistencecheckpassedfor"glibc(x86_64)"

Check:Packageexistencefor"compat-libstdc++-33(x86_64)"

NodeName Available Required

Status

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

----------

node2 compat-libstdc++-33(x86_64)-3.2.3-61

compat-libstdc++-33(x86_64)-3.2.3 passed

node1 compat-libstdc++-33(x86_64)-3.2.3-61

compat-libstdc++-33(x86_64)-3.2.3 passed

Result: Package existence check passed for "compat-libstdc++-33(x86_64)"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Packageexistencefor"elfutils-libelf(x86_64)"

NodeName Available Required

Status

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

----------

node2 elfutils-libelf(x86_64)-0.137-3.el5

elfutils-libelf(x86_64)-0.125 passed

node1 elfutils-libelf(x86_64)-0.137-3.el5

elfutils-libelf(x86_64)-0.125 passed

Result:Packageexistencecheckpassedfor"elfutils-libelf(x86_64)"

Check:Packageexistencefor"elfutils-libelf-devel"

NodeName Available Required

Status

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

----------

node2 elfutils-libelf-devel-0.137-3.el5

elfutils-libelf-devel-0.125 passed

node1 elfutils-libelf-devel-0.137-3.el5

elfutils-libelf-devel-0.125 passed

Result:Packageexistencecheckpassedfor"elfutils-libelf-devel"

Check:Packageexistencefor"glibc-common"

NodeName Available Required

Status

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

----------

node2 glibc-common-2.5-49 glibc-common-2.5

passed

node1 glibc-common-2.5-49 glibc-common-2.5

passed

Result:Packageexistencecheckpassedfor"glibc-common"

Check:Packageexistencefor"glibc-devel(x86_64)"

NodeName Available Required

Status

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

----------

node2 glibc-devel(x86_64)-2.5-49 glibc-devel(x86_64)-2.5

passed

node1 glibc-devel(x86_64)-2.5-49 glibc-devel(x86_64)-2.5

passed

Result:Packageexistencecheckpassedfor"glibc-devel(x86_64)"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Packageexistencefor"glibc-headers"

NodeName Available Required

Status

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

----------

node2 glibc-headers-2.5-49 glibc-headers-2.5

passed

node1 glibc-headers-2.5-49 glibc-headers-2.5

passed

Result:Packageexistencecheckpassedfor"glibc-headers"

Check:Packageexistencefor"gcc-c++(x86_64)"

NodeName Available Required

Status

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

----------

node2 gcc-c++(x86_64)-4.1.2-48.el5 gcc-c++(x86_64)-4.1.2

passed

node1 gcc-c++(x86_64)-4.1.2-48.el5 gcc-c++(x86_64)-4.1.2

passed

Result:Packageexistencecheckpassedfor"gcc-c++(x86_64)"

Check:Packageexistencefor"libaio-devel(x86_64)"

NodeName Available Required

Status

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

----------

node2 libaio-devel(x86_64)-0.3.106-5

libaio-devel(x86_64)-0.3.106 passed

node1 libaio-devel(x86_64)-0.3.106-5

libaio-devel(x86_64)-0.3.106 passed

Result:Packageexistencecheckpassedfor"libaio-devel(x86_64)"

Check:Packageexistencefor"libgcc(x86_64)"

NodeName Available Required

Status

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

----------

node2 libgcc(x86_64)-4.1.2-48.el5 libgcc(x86_64)-4.1.2

passed

node1 libgcc(x86_64)-4.1.2-48.el5 libgcc(x86_64)-4.1.2

passed

Result:Packageexistencecheckpassedfor"libgcc(x86_64)"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Check:Packageexistencefor"libstdc++(x86_64)"

NodeName Available Required

Status

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

----------

node2 libstdc++(x86_64)-4.1.2-48.el5

libstdc++(x86_64)-4.1.2 passed

node1 libstdc++(x86_64)-4.1.2-48.el5

libstdc++(x86_64)-4.1.2 passed

Result:Packageexistencecheckpassedfor"libstdc++(x86_64)"

Check:Packageexistencefor"libstdc++-devel(x86_64)"

NodeName Available Required

Status

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

----------

node2 libstdc++-devel(x86_64)-4.1.2-48.el5

libstdc++-devel(x86_64)-4.1.2 passed

node1 libstdc++-devel(x86_64)-4.1.2-48.el5

libstdc++-devel(x86_64)-4.1.2 passed

Result:Packageexistencecheckpassedfor"libstdc++-devel(x86_64)"

Check:Packageexistencefor"sysstat"

NodeName Available Required

Status

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

----------

node2 sysstat-7.0.2-3.el5 sysstat-7.0.2

passed

node1 sysstat-7.0.2-3.el5 sysstat-7.0.2

passed

Result:Packageexistencecheckpassedfor"sysstat"

Check:Packageexistencefor"ksh"

NodeName Available Required

Status

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

----------

node2 ksh-20100202-1.el5 ksh-20060214

passed

node1 ksh-20100202-1.el5 ksh-20060214

passed

Result:Packageexistencecheckpassedfor"ksh"

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CheckingformultipleuserswithUIDvalue0

Result:CheckformultipleuserswithUIDvalue0passed

Check:CurrentgroupID

Result:CurrentgroupIDcheckpassed

Startingcheckforconsistencyofprimarygroupofrootuser

NodeName Status

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

node2 passed

node1 passed

Checkforconsistencyofrootuser'sprimarygrouppassed

StartingClocksynchronizationchecksusingNetworkTime

Protocol(NTP)...

NTPConfigurationfilecheckstarted...

NetworkTimeProtocol(NTP)configurationfilenotfoundonanyofthe

nodes.OracleClusterTimeSynchronizationService(CTSS)canbeused

insteadofNTPfortimesynchronizationontheclusternodes

NoNTPDaemonsorServiceswerefoundtoberunning

Result:ClocksynchronizationcheckusingNetworkTimeProtocol(NTP)

passed

CheckingCorefilenamepatternconsistency...

Corefilenamepatternconsistencycheckpassed.

Checkingtomakesureuser"grid"isnotin"root"group

NodeName Status Comment

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

node2 passed doesnotexist

node1 passed doesnotexist

Result:User"grid"isnotpartof"root"group.Checkpassed

Checkdefaultuserfilecreationmask

NodeName Available Required

Comment

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

----------

node2 0022 0022

passed

node1 0022 0022

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

passed

Result:Defaultuserfilecreationmaskcheckpassed

Checkingconsistencyoffile"/etc/resolv.conf"acrossnodes

Checking thefile "/etc/resolv.conf" to make sure only one of domain and

searchentriesisdefined

File"/etc/resolv.conf"doesnothavebothdomainandsearchentries

defined

Checking if domain entry in file "/etc/resolv.conf" is consistent across

thenodes...

domainentryinfile"/etc/resolv.conf"isconsistentacrossnodes

Checking if search entry in file "/etc/resolv.conf" is consistent across

thenodes...

searchentryinfile"/etc/resolv.conf"isconsistentacrossnodes

Checking file "/etc/resolv.conf" to make sure that only onesearch entry

isdefined

Allnodeshaveonesearchentrydefinedinfile"/etc/resolv.conf"

Checking all nodes to make sure that search entry is "localdomain" as found

onnode"node2"

Allnodesoftheclusterhavesamevaluefor'search'

CheckingDNSresponsetimeforanunreachablenode

NodeName Status

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

node2 passed

node1 passed

The DNSresponse time for an unreachable node is within acceptable limit

onallnodes

File"/etc/resolv.conf"isconsistentacrossnodes

Check:Timezoneconsistency

Result:Timezoneconsistencycheckpassed

Fixupinformationhasbeengeneratedforfollowingnode(s):

node2,node1

Please run the following script on each node as "root" user to execute

thefixups:

'/tmp/CVU_11.2.0.3.0_grid/runfixup.sh'

k Pre-check r for r cluster s services p setup s was l unsuccessful n on l all e the  nodes.

node1->

从上面的预检查结果中,可以看到不成功,其实错误的原因是 grid 用户不属于 dba 组 !

不过,Oracle 自动给我们提供的修复的脚本,根据上述提示,分别以root 用户在两个节点上

执行/tmp/CVU_11.2.0.3.0_grid/runfixup.sh 脚本来修复。

node1:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

[root@node1~]#idgrid

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[root@node1~]#

看到,grid的确不属于 dba 组。执行脚本,进行修复:

[root@node1~]#sh/tmp/CVU_11.2.0.3.0_grid/runfixup.sh

Responsefilebeingusedis:/tmp/CVU_11.2.0.3.0_grid/fixup.response

Enablefilebeingusedis:/tmp/CVU_11.2.0.3.0_grid/fixup.enable

Logfilelocation:/tmp/CVU_11.2.0.3.0_grid/orarun.log

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[root@node1~]#idgrid

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper),1300(

dba)

[root@node1~]#

同样,在 node2 上执行上述脚本:

[root@node2~]#sh/tmp/CVU_11.2.0.3.0_grid/runfixup.sh

Responsefilebeingusedis:/tmp/CVU_11.2.0.3.0_grid/fixup.response

Enablefilebeingusedis:/tmp/CVU_11.2.0.3.0_grid/fixup.enable

Logfilelocation:/tmp/CVU_11.2.0.3.0_grid/orarun.log

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[root@node2~]#idgrid

uid=1100(grid)gid=1000(oinstall)

groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper),1300(

dba)

[root@node2~]#

执行完修复脚本后,重新执行预检查:

node1-> ./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -verbose

...

...

...

Checking thefile "/etc/resolv.conf" to make sure only one of domain and

searchentriesisdefined

File"/etc/resolv.conf"doesnothavebothdomainandsearchentries

defined

Checking if domain entry in file "/etc/resolv.conf" is consistent across

thenodes...

domainentryinfile"/etc/resolv.conf"isconsistentacrossnodes

Checking if search entry in file "/etc/resolv.conf" is consistent across

thenodes...

searchentryinfile"/etc/resolv.conf"isconsistentacrossnodes

Checking file "/etc/resolv.conf" to make sure that only onesearch entry

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

isdefined

Allnodeshaveonesearchentrydefinedinfile"/etc/resolv.conf"

Checking all nodes to make sure that search entry is "localdomain" as found

onnode"node2"

Allnodesoftheclusterhavesamevaluefor'search'

CheckingDNSresponsetimeforanunreachablenode

NodeName Status

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

node2 passed

node1 passed

The DNSresponse time for an unreachable node is within acceptable limit

onallnodes

File"/etc/resolv.conf"isconsistentacrossnodes

Check:Timezoneconsistency

Result:Timezoneconsistencycheckpassed

Pre-checkforclusterservicessetupwas  successful.

node1->

直到此步骤,我们的安装环境已经完全准备 OK!!!

3 3 3  安装  d Grid  Infrastructure

从此步骤开始,我们正式安装 Grid 软件:

① 以 grid 用户登录图形界面,执行/home/grid/grid/runInstaller,进入 OUI 的图形安装界

面:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

② 进入 OUI 安装界面后,选择第 3 项,跳过软件更新,Next:

③ 选择集群的 Grid Infrastructure,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ 选择advanced Installation,Next:

⑤ 语言选择默认,English,Next:

⑥ 去 掉 Configure GNS 选 项 , 按 照 之 前 2.1 节 中 的 表 格 输 入 Cluster

Name:scan-cluster,SCANName:scan-cluster.localdomain。Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑦ 单击 Add,添加第2 个节点,Next:

⑧ 确认网络接口,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑨ 选择 ASM,作为存储,Next:

⑩ 输入 ASM 磁盘组名,这里命名为 GRIDDG,冗余策略选择 External 外部,AU 大小

选择默认 1M,ASM 磁盘选择 VOL1,VOL2。Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑪ 选择给 ASM 的 SYS、ASMSNMP 用户配置为相同的口令,并输入口令,Next:

⑫ 选择不使用 IPMI,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑬ 给 ASM 指定不同的组,Next:

⑭ 选择 GRID 软件的安装路径,其中 ORACLE_BASE,ORACLE_HOME 均选择之前已

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

经配置好的,可参照 2.5 节中的配置信息。这里需要注意 GRID 软件的 ORACLE_HOME 不

能是 ORACLE_BASE 的子目录。

⑮ 选择默认的 Inventory,Next:

⑯ 检查出现告警,提示在所有节点上缺失 cvuqdisk-1.0.9-1 软件包。

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

可以选择忽略,直接进入下一步安装。也可以从 grid 安装文件的 rpm 目录下获取该 RPM

包,然后进行安装。

node1:

[root@node1rpm]#pwd

/home/grid/grid/rpm

[root@node1rpm]#ll

total12

-rwxr-xr-x1rootroot8551Sep22 2011cvuqdisk-1.0.9-1.rpm

[root@node1rpm]#rpm-ivhcvuqdisk-1.0.9-1.rpm

Preparing...

###########################################[100%]

Usingdefaultgroupoinstalltoinstallpackage

1:cvuqdisk

###########################################[100%]

[root@node1rpm]#

node2:

[root@node2~]#ll

total96

-rw-------1rootroot 1371Apr2014:48anaconda-ks.cfg

drwxr-xr-x2rootroot 4096Apr2611:20asm_rpm

-rwxr-xr-x1rootroot 8551Apr2709:27cvuqdisk-1.0.9-1.rpm

-rw-r--r--1rootroot51256Apr2014:48install.log

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

-rw-r--r--1rootroot 4077Apr2014:48install.log.syslog

drwxr-xr-x2rootroot 4096Apr2410:45shell

[root@node2~]#exportCVUQDISK_GRP=oinstall

[root@node2~]#rpm-ivhcvuqdisk-1.0.9-1.rpm

Preparing...

###########################################[100%]

1:cvuqdisk

###########################################[100%]

[root@node2~]#

在所有节点上安装完 cvuqdisk-1.0.9-1 软件后,重新执行预检查,不再有警告信息。

⑰ 进入安装 GRID 安装之前的概要信息,Install 进行安装:

⑱ 根据提示以 root 用户分别在两个节点上执行脚本:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

执行/u01/app/oraInventory/orainstRoot.sh 脚本:

node1:

[root@node1~]#/u01/app/oraInventory/orainstRoot.sh

Changingpermissionsof/u01/app/oraInventory.

Addingread,writepermissionsforgroup.

Removingread,write,executepermissionsforworld.

Changinggroupnameof/u01/app/oraInventorytooinstall.

Theexecutionofthescriptiscomplete.

[root@node1~]#

node2:

[root@node2~]#/u01/app/oraInventory/orainstRoot.sh

Changingpermissionsof/u01/app/oraInventory.

Addingread,writepermissionsforgroup.

Removingread,write,executepermissionsforworld.

Changinggroupnameof/u01/app/oraInventorytooinstall.

Theexecutionofthescriptiscomplete.

[root@node2~]#

执行/u01/app/11.2.0/grid/root.sh 脚本:

node1:

[root@node1~]#/u01/app/11.2.0/grid/root

root.sh rootupgrade.sh

[root@node1~]#/u01/app/11.2.0/grid/root.sh

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

PerformingrootuseroperationforOracle11g

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=grid

ORACLE_HOME= /u01/app/11.2.0/grid

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Copyingdbhometo/usr/local/bin...

Copyingoraenvto/usr/local/bin...

Copyingcoraenvto/usr/local/bin...

Creating/etc/oratabfile...

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Usingconfigurationparameterfile:

/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creatingtracedirectory

OLRinitialization-successful

rootwallet

rootwalletcert

rootcertexport

peerwallet

profilereaderwallet

pawallet

peerwalletkeys

pawalletkeys

peercertrequest

pacertrequest

peercert

pacert

peerrootcertTP

profilereaderrootcertTP

parootcertTP

peerpacertTP

papeercertTP

profilereaderpacertTP

profilereaderpeercertTP

peerusercert

pausercert

AddingClusterwareentriestoinittab

CRS-2672:Attemptingtostart'ora.mdnsd'on'node1'

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CRS-2676:Startof'ora.mdnsd'on'node1'succeeded

CRS-2672:Attemptingtostart'ora.gpnpd'on'node1'

CRS-2676:Startof'ora.gpnpd'on'node1'succeeded

CRS-2672:Attemptingtostart'ora.cssdmonitor'on'node1'

CRS-2672:Attemptingtostart'ora.gipcd'on'node1'

CRS-2676:Startof'ora.gipcd'on'node1'succeeded

CRS-2676:Startof'ora.cssdmonitor'on'node1'succeeded

CRS-2672:Attemptingtostart'ora.cssd'on'node1'

CRS-2672:Attemptingtostart'ora.diskmon'on'node1'

CRS-2676:Startof'ora.diskmon'on'node1'succeeded

CRS-2676:Startof'ora.cssd'on'node1'succeeded

ASMcreatedandstartedsuccessfully.

DiskGroupGRIDDGcreatedsuccessfully.

clscfg:-installmodespecified

SuccessfullyaccumulatednecessaryOCRkeys.

CreatingOCRkeysforuser'root',privgrp'root'..

Operationsuccessful.

CRS-4256:Updatingtheprofile

Successfuladditionofvotingdisk9516d145c0254f9ebf50064a6a916182.

Successfullyreplacedvotingdiskgroupwith+GRIDDG.

CRS-4256:Updatingtheprofile

CRS-4266:Votingfile(s)successfullyreplaced

## STATE FileUniversalId FileNameDiskgroup

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

1.ONLINE 9516d145c0254f9ebf50064a6a916182(ORCL:VOL1)[GRIDDG]

Located1votingdisk(s).

CRS-2672:Attemptingtostart'ora.asm'on'node1'

CRS-2676:Startof'ora.asm'on'node1'succeeded

CRS-2672:Attemptingtostart'ora.GRIDDG.dg'on'node1'

CRS-2676:Startof'ora.GRIDDG.dg'on'node1'succeeded

CRS-2672:Attemptingtostart'ora.registry.acfs'on'node1'

CRS-2676:Startof'ora.registry.acfs'on'node1'succeeded

ConfigureOracleGridInfrastructureforaCluster...succeeded

[root@node1~]#

node2:

[root@node2~]#/u01/app/11.2.0/grid/root.sh

PerformingrootuseroperationforOracle11g

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=grid

ORACLE_HOME= /u01/app/11.2.0/grid

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Copyingdbhometo/usr/local/bin...

Copyingoraenvto/usr/local/bin...

Copyingcoraenvto/usr/local/bin...

Creating/etc/oratabfile...

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Usingconfigurationparameterfile:

/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creatingtracedirectory

OLRinitialization-successful

AddingClusterwareentriestoinittab

CRS-4402: The CSS daemon wasstarted in exclusive mode butfound an active

CSSdaemononnodenode1,number1,andisterminating

An active cluster was found during exclusive startup, restartingto join

thecluster

ConfigureOracleGridInfrastructureforaCluster...succeeded

[root@node2~]#

此时,集群件相关的服务已经启动。当然,ASM 实例也将在两个节点上启动。

[root@node1~]#su-grid

node1->crs_stat-t

Name Type Target State Host

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

ora.GRIDDG.dg ora....up.typeONLINE ONLINE node1

ora....N1.lsnrora....er.typeONLINE ONLINE node1

ora.asm ora.asm.type ONLINE ONLINE node1

ora.cvu ora.cvu.type ONLINE ONLINE node1

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....networkora....rk.typeONLINE ONLINE node1

ora....SM1.asmapplication ONLINE ONLINE node1

ora.node1.gsd application OFFLINE OFFLINE

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip ora....t1.typeONLINE ONLINE node1

ora....SM2.asmapplication ONLINE ONLINE node2

ora.node2.gsd application OFFLINE OFFLINE

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip ora....t1.typeONLINE ONLINE node2

ora.oc4j ora.oc4j.type ONLINE ONLINE node1

ora.ons ora.ons.type ONLINE ONLINE node1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ora....ry.acfsora....fs.typeONLINE ONLINE node1

ora.scan1.vip ora....ip.typeONLINE ONLINE node1

node1->

⑲ 执行完上述脚本之后,单击 OK,Next,进入下一步。

⑳ 最后,单击 close,完成 GRID 软件在双节点上的安装。

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

至此,GRID 集群件安装成功!!!

4 4 4  安装  e Oracle  软件

从此步骤开始,我们正式安装 oracle 软件:

① 以 oracle 用户登录图形界面,执行/home/oracle/database/runInstaller,进入 OUI 的图形

安装界面:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

② 进入 OUI 安装界面后,选择第 3 项,跳过软件更新,Next:

③ 选择第 2 项,只安装 oracle 软件,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ 选择第 2 项,安装 oracle RAC,选择所有节点,Next:

⑤ 语言选择默认,English,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑥ 选择第 1 项,安装企业版软件,Next:

⑦ 选择 oracle 软件的安装路径,其中 ORACLE_BASE,ORACLE_HOME 均选择之前已

经配置好的,可参照 2.5 节中的配置信息。Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑧ 选择 oracle 用户组,Next:

⑨ 执行安装前的预检查,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑩ 安装概要信息,Install:

⑪ 根据提示以 root 用户分别在两个节点上执行脚本,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

执行/u01/app/oracle/product/11.2.0/db_1/root.sh 脚本:

node1:

[root@node1~]#/u01/app/oracle/product/11.2.0/db_1/root.sh

PerformingrootuseroperationforOracle11g

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=oracle

ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Thecontentsof"dbhome"havenotchanged.Noneedtooverwrite.

Thecontentsof"oraenv"havenotchanged.Noneedtooverwrite.

Thecontentsof"coraenv"havenotchanged.Noneedtooverwrite.

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Finishedproduct-specificrootactions.

[root@node1~]#

node2:

[root@node2~]#/u01/app/oracle/product/11.2.0/db_1/root.sh

PerformingrootuseroperationforOracle11g

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=oracle

ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Thecontentsof"dbhome"havenotchanged.Noneedtooverwrite.

Thecontentsof"oraenv"havenotchanged.Noneedtooverwrite.

Thecontentsof"coraenv"havenotchanged.Noneedtooverwrite.

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Finishedproduct-specificrootactions.

[root@node2~]#

⑫ 最后,单击 close,完成 oracle 软件在双节点上的安装。

至此,我们在 RAC 双节点上完成 oracle 软件的安装!!!

5 5 5  创建  ASM  磁盘组

以 grid 用户创建ASM 磁盘组,创建的 ASM 磁盘组为下一步创建数据库提供存储。

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

① grid 用户登录图形界面,执行 asmca 命令来创建磁盘组:

② 进入 ASMCA 配置界面后,单击 Create,创建新的磁盘组:

③ 输入磁盘组名 DATA ,冗余策略选择 External,磁盘选择 ORCL:VOL3,单击 OK:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ DATA 磁盘组创建完成,单击 OK:

⑤ 继续创建磁盘组,磁盘组名 FLASH,冗余策略选择 External,磁盘选择 ORCL:VOL4:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑥ 最后,完成 DATA、FLASH 磁盘组的创建,Exit 推出 ASMCA 图形配置界面:

至此,利用 ASMCA 创建好 DATA 、FLASH 磁盘组。且,可以看到连同之前创建的

GRIDDG 3 个磁盘组均已经被RAC 双节点 MOUNT。

6 6 6  创建  RAC  数据库

接下来,使用 DBCA 来创建 RAC 数据库。

① 以 oracle 用户登录图形界面,执行 dbca,进入 DBCA 的图形界面,选择第 1 项,创

建 RAC 数据库:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

② 选择创建数据库选项,Next:

③ 选择创建通用数据库,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ 配置类型选择 Admin-Managed,输入数据库名 devdb,选择双节点,Next:

⑤ 选择默认,配置 OEM、启用数据库自动维护任务,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑥ 选择数据库用户使用同一口令,Next:

⑦ 数据库存储选择 ASM,使用 OMF,数据区选择之前创建的 DATA 磁盘组,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑧ 指定数据库闪回区,选择之前创建好的 FLASH 磁盘组,Next:

⑨ 选择创建数据库自带 SampleSchema,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑩ 选择数据库字符集,AL32UTF8,Next:

⑪ 选择默认数据库存储信息,直接 Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑫ 单击,Finish,开始创建数据库,Next:

创建数据库可能持续时间稍长:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑬ 完成创建数据库。

至此,我们完成创建 RAC 数据库!!!

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

7 7 7  脚本附录

1 7.1  h preusers.sh  脚本

#!/bin/bash

#Purpose:Create6groupsnamed

'oinstall','dba','asmadmin','asmdba','asmoper','oper',plus2users

named'oracle','grid'.

#AlsosettingtheEnvironment

#variablefororacleuser.

#variableforgriduser.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./1preusers.sh

#Author:AsherHuang

echo"Nowcreate6groupsnamed

'oinstall','dba','asmadmin','asmdba','asmoper','oper'"

echo "Plus 2 users named'oracle','grid',Also setting the Environment"

groupadd-g1000oinstall

groupadd-g1200asmadmin

groupadd-g1201asmdba

groupadd-g1202asmoper

useradd -u 1100 -g oinstall-G asmadmin,asmdba,asmoper -d /home/grid -s

/bin/bash-c"gridInfrastructureOwner"grid

echo"grid"|passwd--stdingrid

echo'exportPS1="`/bin/hostname-s`->"'>>/home/grid/.bash_profile

echo"exportTMP=/tmp">>/home/grid/.bash_profile

echo'exportTMPDIR=$TMP'>>/home/grid/.bash_profile

echo"exportORACLE_SID=+ASM1">>/home/grid/.bash_profile

echo"exportORACLE_BASE=/u01/app/grid">>/home/grid/.bash_profile

echo"exportORACLE_HOME=/u01/app/11.2.0/grid">>

/home/grid/.bash_profile

echo"exportORACLE_TERM=xterm">>/home/grid/.bash_profile

echo"exportNLS_DATE_FORMAT='yyyy/mm/ddhh24:mi:ss'">>

/home/grid/.bash_profile

echo'exportTNS_ADMIN=$ORACLE_HOME/network/admin' >>

/home/grid/.bash_profile

echo'exportPATH=/usr/sbin:$PATH'>>/home/grid/.bash_profile

echo'exportPATH=$ORACLE_HOME/bin:$PATH'>>/home/grid/.bash_profile

echo'exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>>

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

/home/grid/.bash_profile

echo'export

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'

>>/home/grid/.bash_profile

echo"exportEDITOR=vi">>/home/grid/.bash_profile

echo"exportLANG=en_US">>/home/grid/.bash_profile

echo"exportNLS_LANG=american_america.AL32UTF8">>

/home/grid/.bash_profile

echo"umask022">>/home/grid/.bash_profile

groupadd-g1300dba

groupadd-g1301oper

useradd-u1101-goinstall-Gdba,oper,asmdba-d/home/oracle-s

/bin/bash-c"OracleSoftwareOwner"oracle

echo"oracle"|passwd--stdinoracle

echo 'export PS1="`/bin/hostname -s`-> "'>> /home/oracle/.bash_profile

echo"exportTMP=/tmp">>/home/oracle/.bash_profile

echo'exportTMPDIR=$TMP'>>/home/oracle/.bash_profile

echo"exportORACLE_HOSTNAME=node1.localdomain">>

/home/oracle/.bash_profile

echo"exportORACLE_SID=devdb1">>/home/oracle/.bash_profile

echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile

echo'exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>>

/home/oracle/.bash_profile

echo"exportORACLE_UNQNAME=devdb">>/home/oracle/.bash_profile

echo'exportTNS_ADMIN=$ORACLE_HOME/network/admin' >>

/home/oracle/.bash_profile

echo"exportORACLE_TERM=xterm">>/home/oracle/.bash_profile

echo'exportPATH=/usr/sbin:$PATH'>>/home/oracle/.bash_profile

echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile

echo'exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>>

/home/oracle/.bash_profile

echo'export

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'

>>/home/oracle/.bash_profile

echo"exportEDITOR=vi">>/home/oracle/.bash_profile

echo"exportLANG=en_US">>/home/oracle/.bash_profile

echo"exportNLS_LANG=american_america.AL32UTF8">>

/home/oracle/.bash_profile

echo"exportNLS_DATE_FORMAT='yyyy/mm/ddhh24:mi:ss'">>

/home/oracle/.bash_profile

echo"umask022">>/home/oracle/.bash_profile

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

echo"TheGroupsandusershasbeencreated"

echo"TheEnvironmentforgrid,oraclealsohasbeensetsuccessfully"

2 7.2  h predir.sh  脚本

#!/bin/bash

#Purpose:Create the necessary directory for oracle,grid users and change

theauthentiontooracle,gridusers.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./2predir.sh

#Author:AsherHuang

echo "Now create the necessary directory for oracle,grid users and change

theauthentiontooracle,gridusers..."

mkdir-p/u01/app/grid

mkdir-p/u01/app/11.2.0/grid

mkdir-p/u01/app/oracle

chown-Roracle:oinstall/u01

chown-Rgrid:oinstall/u01/app/grid

chown-Rgrid:oinstall/u01/app/11.2.0

chmod-R775/u01

echo"Thenecessarydirectoryfororacle,gridusersandchangethe

authentiontooracle,gridusershasbeenfinished"

3 7.3  h prelimits.sh  脚本

#!/bin/bash

#Purpose:Changethe/etc/security/limits.conf.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./3prelimits.sh

#Author:AsherHuang

echo"Nowmodifythe/etc/security/limits.conf,butbackupitnamed

/etc/security/limits.conf.bakbefore"

cp/etc/security/limits.conf/etc/security/limits.conf.bak

echo"oraclesoftnproc2047">>/etc/security/limits.conf

echo"oraclehardnproc16384">>/etc/security/limits.conf

echo"oraclesoftnofile1024">>/etc/security/limits.conf

echo"oraclehardnofile65536">>/etc/security/limits.conf

echo"gridsoftnproc2047">>/etc/security/limits.conf

echo"gridhardnproc16384">>/etc/security/limits.conf

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

echo"gridsoftnofile1024">>/etc/security/limits.conf

echo"gridhardnofile65536">>/etc/security/limits.conf

echo"Modifingthe/etc/security/limits.confhasbeensucceed."

4 7.4  h prelogin.sh  脚本

#!/bin/bash

#Purpose:Modifythe/etc/pam.d/login.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./4prelimits.sh

#Author:AsherHuang

echo"Nowmodifythe/etc/pam.d/login,butwithabackupnamed

/etc/pam.d/login.bak"

cp/etc/pam.d/login/etc/pam.d/login.bak

echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login

echo"sessionrequiredpam_limits.so">>/etc/pam.d/login

echo"Modifingthe/etc/pam.d/loginhasbeensucceed."

5 7.5  h preprofile.sh  脚本

#!/bin/bash

#Purpose:Modifythe/etc/profile.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./5preprofile.sh

#Author:AsherHuang

echo"Nowmodifythe /etc/profile,butwithabackupnamed

/etc/profile.bak"

cp/etc/profile/etc/profile.bak

echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profile

echo'if[$SHELL="/bin/ksh"];then'>>/etc/profile

echo'ulimit-p16384'>>/etc/profile

echo'ulimit-n65536'>>/etc/profile

echo'else'>>/etc/profile

echo'ulimit-u16384-n65536'>>/etc/profile

echo'fi'>>/etc/profile

echo'fi'>>/etc/profile

echo"Modifingthe/etc/profilehasbeensucceed."

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

6 7.6  h presysctl.sh  脚本

#!/bin/bash

#Purpose:Modifythe/etc/sysctl.conf.

#Usage:Logonasthesuperuser('root'),andthenexecutethe

command:#./6presysctl.sh

#Author:AsherHuang

echo"Nowmodifythe/etc/sysctl.conf,butwithabackupnamed

/etc/sysctl.bak"

cp/etc/sysctl.conf/etc/sysctl.conf.bak

echo"fs.aio-max-nr=1048576">>/etc/sysctl.conf

echo"fs.file-max=6815744">>/etc/sysctl.conf

echo"kernel.shmall=2097152">>/etc/sysctl.conf

echo"kernel.shmmax=1054472192">>/etc/sysctl.conf

echo"kernel.shmmni=4096">>/etc/sysctl.conf

echo"kernel.sem=25032000100128">>/etc/sysctl.conf

echo"net.ipv4.ip_local_port_range=900065500">>/etc/sysctl.conf

echo"net.core.rmem_default=262144">>/etc/sysctl.conf

echo"net.core.rmem_max=4194304">>/etc/sysctl.conf

echo"net.core.wmem_default=262144">>/etc/sysctl.conf

echo"net.core.wmem_max=1048586">>/etc/sysctl.conf

echo"net.ipv4.tcp_wmem=262144262144262144">>/etc/sysctl.conf

echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf

echo"Modifingthe/etc/sysctl.confhasbeensucceed."

echo"Nowmakethechangestakeeffect....."

sysctl-p

8 8 8  C RAC  维护

1 8.1  查看服务状态

[root@node1~]#su - grid

node1->crs_stat-t

Name Type Target State Host

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ora.DATA.dg ora....up.typeONLINE ONLINE node1

ora.FLASH.dg ora....up.typeONLINE ONLINE node1

ora.GRIDDG.dg ora....up.typeONLINE ONLINE node1

ora....ER.lsnrora....er.typeONLINE ONLINE node1

ora....N1.lsnrora....er.typeONLINE ONLINE node1

ora.asm ora.asm.type ONLINE ONLINE node1

ora.cvu ora.cvu.type ONLINE ONLINE node1

ora.devdb.db ora....se.typeONLINE ONLINE node1

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....networkora....rk.typeONLINE ONLINE node1

ora....SM1.asmapplication ONLINE ONLINE node1

ora....E1.lsnrapplication ONLINE ONLINE node1

ora.node1.gsd application OFFLINE OFFLINE

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip ora....t1.typeONLINE ONLINE node1

ora....SM2.asmapplication ONLINE ONLINE node2

ora....E2.lsnrapplication ONLINE ONLINE node2

ora.node2.gsd application OFFLINE OFFLINE

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip ora....t1.typeONLINE ONLINE node2

ora.oc4j ora.oc4j.type ONLINE ONLINE node1

ora.ons ora.ons.type ONLINE ONLINE node1

ora....ry.acfsora....fs.typeONLINE ONLINE node1

ora.scan1.vip ora....ip.typeONLINE ONLINE node1

node1->

2 8.2  检查  S CRS  状态

8.2.1  检查本地节点的  CRS  状态:

node1->crsctlcheckcrs

CRS-4638:OracleHighAvailabilityServicesisonline

CRS-4537:ClusterReadyServicesisonline

CRS-4529:ClusterSynchronizationServicesisonline

CRS-4533:EventManagerisonline

2 8.2.2  检查集群的  CRS  状态:

node1->crsctlcheckcluster

CRS-4537:ClusterReadyServicesisonline

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CRS-4529:ClusterSynchronizationServicesisonline

CRS-4533:EventManagerisonline

node1->

3 8.3  查看集群中节点的配置信息:

node1->olsnodes

node1

node2

node1->olsnodes-n

node1 1

node2 2

node1->olsnodes-n-i

node1 1 node1-vip

node2 2 node2-vip

node1->olsnodes-n-i-s

node1 1 node1-vip Active

node2 2 node2-vip Active

node1->

4 8.4  查看集群软件各种版本信息:

1 8.4.1  查看集群软件使用版本信息:

node1->crsctlquerycrsactiveversion

OracleClusterwareactiveversionontheclusteris[11.2.0.3.0]

node1->

2 8.4.2  查看集群软件发行版本信息:

node1->crsctlquerycrsreleaseversion

Oracle High Availability Services release version on the local node is

[11.2.0.3.0]

node1->

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

3 8.4.3  查看集群软件安装版本信息:

node1->crsctlquerycrssoftwareversion

OracleClusterwareversiononnode[node1]is[11.2.0.3.0]

node1->

5 8.5  查看集群件的表决磁盘信息:

node1->crsctlquerycssvotedisk

## STATE FileUniversalId FileNameDiskgroup

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

1.ONLINE 1c10de5a40f84f9ebf7ade34b691a00f(ORCL:VOL1)[GRIDDG]

Located1votingdisk(s).

node1->

6 8.6  查看系统  S DNS  配置相关信息:

node1->crsctlquerydns-servers

CRS-10018:thefollowingconfigurationwasfoundonthesystem:

CRS-10019:Thereare1domainsinsearchorder.Theyare:

localdomain

CRS-10022:Thereare1nameservers.Theyare:

172.16.0.176

CRS-10020:numberofretryattemptsfornamelookupis:4

CRS-10021:timeoutforeachnamelookupis:5

node1->cat/etc/resolv.conf

searchlocaldomain

nameserver172.16.0.176

node1->

7 8.7  查看集群  SCAN  VIP  信息:

node1->srvctlconfigscan

SCANname:scan-cluster.localdomain,Network:

1/172.16.0.0/255.255.240.0/eth0

SCANVIPname:scan1,IP:/scan-cluster.localdomain/172.16.0.203

node1->

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

8 8.8  查看集群  SCAN  r Listener  信息:

node1->srvctlconfigscan_listener

SCANListenerLISTENER_SCAN1exists.Port:TCP:1521

node1->

9 8.9  查看集群件  OCR  文件信息:

node1->ocrcheck

StatusofOracleClusterRegistryisasfollows:

Version : 3

Totalspace(kbytes) : 262120

Usedspace(kbytes) : 3024

Availablespace(kbytes): 259096

ID :1482685515

Device/FileName : +GRIDDG

Device/Fileintegritycheck

succeeded

Device/Filenotconfigured

Device/Filenotconfigured

Device/Filenotconfigured

Device/Filenotconfigured

Clusterregistryintegritychecksucceeded

Logicalcorruptioncheckbypassedduetonon-privilegeduser

node1->

提示权限不足,以 root 执行如下:

[root@node2bin]#./ocrcheck-local

StatusofOracleLocalRegistryisasfollows:

Version : 3

Totalspace(kbytes) : 262120

Usedspace(kbytes) : 2668

Availablespace(kbytes): 259452

ID : 660096641

Device/FileName :

/u01/app/11.2.0/grid/cdata/node2.olr

Device/Fileintegritycheck

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

succeeded

Localregistryintegritychecksucceeded

Logicalcorruptionchecksucceeded

[root@node2bin]#

0 8.10  查看集群件  OCR  备份信息:

node1->ocrconfig-showbackup

node1 2012/07/1613:50:27

/u01/app/11.2.0/grid/cdata/scan-cluster/backup00.ocr

node1 2012/07/1609:50:21

/u01/app/11.2.0/grid/cdata/scan-cluster/backup01.ocr

node1 2012/07/1605:50:16

/u01/app/11.2.0/grid/cdata/scan-cluster/backup02.ocr

node1 2012/07/1505:49:38

/u01/app/11.2.0/grid/cdata/scan-cluster/day.ocr

node1 2012/07/0814:53:48

/u01/app/11.2.0/grid/cdata/scan-cluster/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

node1->

1 8.11  启、停集群数据库:

node1->crs_stat-t

Name Type Target State Host

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

ora.DATA.dg ora....up.typeONLINE ONLINE node1

ora.FLASH.dg ora....up.typeONLINE ONLINE node1

ora.GRIDDG.dg ora....up.typeONLINE ONLINE node1

ora....ER.lsnrora....er.typeONLINE ONLINE node1

ora....N1.lsnrora....er.typeONLINE ONLINE node1

ora.asm ora.asm.type ONLINE ONLINE node1

ora.cvu ora.cvu.type ONLINE ONLINE node1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ora.devdb.db ora....se.typeONLINE ONLINE node1

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....networkora....rk.typeONLINE ONLINE node1

ora....SM1.asmapplication ONLINE ONLINE node1

ora....E1.lsnrapplication ONLINE ONLINE node1

ora.node1.gsd application OFFLINE OFFLINE

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip ora....t1.typeONLINE ONLINE node1

ora....SM2.asmapplication ONLINE ONLINE node2

ora....E2.lsnrapplication ONLINE ONLINE node2

ora.node2.gsd application OFFLINE OFFLINE

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip ora....t1.typeONLINE ONLINE node2

ora.oc4j ora.oc4j.type ONLINE ONLINE node1

ora.ons ora.ons.type ONLINE ONLINE node1

ora....ry.acfsora....fs.typeONLINE ONLINE node1

ora.scan1.vip ora....ip.typeONLINE ONLINE node1

node1-> srvctl stop database -d devdb

node1->crs_stat-t

Name Type Target State Host

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

ora.DATA.dg ora....up.typeONLINE ONLINE node1

ora.FLASH.dg ora....up.typeONLINE ONLINE node1

ora.GRIDDG.dg ora....up.typeONLINE ONLINE node1

ora....ER.lsnrora....er.typeONLINE ONLINE node1

ora....N1.lsnrora....er.typeONLINE ONLINE node1

ora.asm ora.asm.type ONLINE ONLINE node1

ora.cvu ora.cvu.type ONLINE ONLINE node1

ora.devdb.db ora....se.typeOFFLINE OFFLINE

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....networkora....rk.typeONLINE ONLINE node1

ora....SM1.asmapplication ONLINE ONLINE node1

ora....E1.lsnrapplication ONLINE ONLINE node1

ora.node1.gsd application OFFLINE OFFLINE

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip ora....t1.typeONLINE ONLINE node1

ora....SM2.asmapplication ONLINE ONLINE node2

ora....E2.lsnrapplication ONLINE ONLINE node2

ora.node2.gsd application OFFLINE OFFLINE

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip ora....t1.typeONLINE ONLINE node2

ora.oc4j ora.oc4j.type ONLINE ONLINE node1

ora.ons ora.ons.type ONLINE ONLINE node1

ora....ry.acfsora....fs.typeONLINE ONLINE node1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ora.scan1.vip ora....ip.typeONLINE ONLINE node1

node1->

2 8.12  启、停集群件服务:

node1->crsctlstopcluster-all

CRS-4563:Insufficientuserprivileges.

CRS-4000:CommandStopfailed,orcompletedwitherrors.

node1->

Grid 用户权限不足,root 执行:

[root@node1~]#pwd

/root

[root@node1~]#cd/u01/app/11.2.0/grid/bin/

[root@node1bin]#./crsctlstopcluster-all

CRS-2673:Attemptingtostop'ora.crsd'on'node1'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources

on'node1'

CRS-2673:Attemptingtostop'ora.oc4j'on'node1'

CRS-2673:Attemptingtostop'ora.LISTENER.lsnr'on'node1'

CRS-2673:Attemptingtostop'ora.GRIDDG.dg'on'node1'

CRS-2673:Attemptingtostop'ora.registry.acfs'on'node1'

CRS-2673:Attemptingtostop'ora.DATA.dg'on'node1'

CRS-2673:Attemptingtostop'ora.FLASH.dg'on'node1'

CRS-2673:Attemptingtostop'ora.cvu'on'node1'

CRS-2673:Attemptingtostop'ora.LISTENER_SCAN1.lsnr'on'node1'

CRS-2677:Stopof'ora.LISTENER_SCAN1.lsnr'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.scan1.vip'on'node1'

CRS-2677:Stopof'ora.LISTENER.lsnr'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.node1.vip'on'node1'

CRS-2677:Stopof'ora.scan1.vip'on'node1'succeeded

CRS-2677:Stopof'ora.node1.vip'on'node1'succeeded

CRS-2677:Stopof'ora.registry.acfs'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.crsd'on'node2'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources

on'node2'

CRS-2673:Attemptingtostop'ora.GRIDDG.dg'on'node2'

CRS-2673:Attemptingtostop'ora.registry.acfs'on'node2'

CRS-2673:Attemptingtostop'ora.DATA.dg'on'node2'

CRS-2673:Attemptingtostop'ora.FLASH.dg'on'node2'

CRS-2673:Attemptingtostop'ora.LISTENER.lsnr'on'node2'

CRS-2677:Stopof'ora.LISTENER.lsnr'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.node2.vip'on'node2'

CRS-2677:Stopof'ora.node2.vip'on'node2'succeeded

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CRS-2677:Stopof'ora.registry.acfs'on'node2'succeeded

CRS-2677:Stopof'ora.DATA.dg'on'node2'succeeded

CRS-2677:Stopof'ora.FLASH.dg'on'node2'succeeded

CRS-2677:Stopof'ora.DATA.dg'on'node1'succeeded

CRS-2677:Stopof'ora.FLASH.dg'on'node1'succeeded

CRS-2677:Stopof'ora.oc4j'on'node1'succeeded

CRS-2677:Stopof'ora.cvu'on'node1'succeeded

CRS-2677:Stopof'ora.GRIDDG.dg'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.asm'on'node1'

CRS-2677:Stopof'ora.GRIDDG.dg'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.asm'on'node2'

CRS-2677:Stopof'ora.asm'on'node1'succeeded

CRS-2677:Stopof'ora.asm'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.ons'on'node2'

CRS-2677:Stopof'ora.ons'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.net1.network'on'node2'

CRS-2677:Stopof'ora.net1.network'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.ons'on'node1'

CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node2'

hascompleted

CRS-2677:Stopof'ora.ons'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.net1.network'on'node1'

CRS-2677:Stopof'ora.net1.network'on'node1'succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node1'

hascompleted

CRS-2677:Stopof'ora.crsd'on'node2'succeeded

CRS-2673:Attemptingtostop'ora.ctssd'on'node2'

CRS-2673:Attemptingtostop'ora.evmd'on'node2'

CRS-2673:Attemptingtostop'ora.asm'on'node2'

CRS-2677:Stopof'ora.crsd'on'node1'succeeded

CRS-2673:Attemptingtostop'ora.ctssd'on'node1'

CRS-2673:Attemptingtostop'ora.evmd'on'node1'

CRS-2673:Attemptingtostop'ora.asm'on'node1'

CRS-2677:Stopof'ora.evmd'on'node2'succeeded

CRS-2677:Stopof'ora.evmd'on'node1'succeeded

CRS-2677:Stopof'ora.asm'on'node2'succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'on 'node2'

CRS-2677:Stopof'ora.ctssd'on'node2'succeeded

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node2' succeeded

CRS-2673:Attemptingtostop'ora.cssd'on'node2'

CRS-2677:Stopof'ora.ctssd'on'node1'succeeded

CRS-2677:Stopof'ora.cssd'on'node2'succeeded

CRS-2677:Stopof'ora.asm'on'node1'succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'on 'node1'

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node1' succeeded

CRS-2673:Attemptingtostop'ora.cssd'on'node1'

CRS-2677:Stopof'ora.cssd'on'node1'succeeded

[root@node1bin]#

9 9 9  Dataguard  机器配置

1 9.1  备库安装  GRID  软件:

安装 Grid Infrastructure:

① 进入 OUI 界面:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

② 选择跳过软件更新:

③ 这里选择第 2 项:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

④ 选择语言:

⑤ 配置 GRIDDG 磁盘组:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑥ 配置 ASM 的口令:

⑦ 检查对应的用户组:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑧ 配置 ORACLE_BASE:

⑨ 检查 Inventory:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑩ 安装前预检查:

⑪ 开始安装:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑫ 按提示执行脚本/u01/app/oraInventory/orainstRoot.sh :

[root@dg~]#/u01/app/oraInventory/orainstRoot.sh

Changingpermissionsof/u01/app/oraInventory.

Addingread,writepermissionsforgroup.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Removingread,write,executepermissionsforworld.

Changinggroupnameof/u01/app/oraInventorytooinstall.

Theexecutionofthescriptiscomplete.

[root@dg~]#

按提示执行脚本/u01/app/11.2.0/grid/root.sh :

[root@dg~]#/u01/app/11.2.0/grid/root.sh

PerformingrootuseroperationforOracle11g

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=grid

ORACLE_HOME= /u01/app/11.2.0/grid

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Copyingdbhometo/usr/local/bin...

Copyingoraenvto/usr/local/bin...

Copyingcoraenvto/usr/local/bin...

Creating/etc/oratabfile...

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Usingconfigurationparameterfile:

/u01/app/11.2.0/grid/crs/install/crsconfig_params

Creatingtracedirectory

LOCALADDMODE

CreatingOCRkeysforuser'grid',privgrp'oinstall'..

Operationsuccessful.

LOCALONLYMODE

SuccessfullyaccumulatednecessaryOCRkeys.

CreatingOCRkeysforuser'root',privgrp'root'..

Operationsuccessful.

CRS-4664:Nodedgsuccessfullypinned.

AddingClusterwareentriestoinittab

dg 2012/07/1815:51:44

/u01/app/11.2.0/grid/cdata/dg/backup_20120718_155144.olr

SuccessfullyconfiguredOracleGridInfrastructureforaStandalone

Server

[root@dg~]#

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑬ 最后,完成 GRID 的安装。

2 9.2  安装  e Oracle  软件:

① 以 oracle 用户登录图形界面,执行/home/oracle/database/runInstaller,进入 OUI 的图形

安装界面:

② 进入 OUI 安装界面后,选择跳过软件更新,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

③ 选择第 2 项,只安装 oracle 软件,Next:

④ 选择第 1 项,安装单实例,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑤ 语言选择默认,English,Next:

⑥ 选择第 1 项,安装企业版软件,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑦ 选择 oracle 软件的安装路径:

⑧ 选择 oracle 用户组,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑨ 执行安装前的预检查:

这里,指出 oracle 用户要属于 dba 组,按照提示解决,Next

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑩ 安装概要信息,Install:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

⑪ 根据提示以 root 用户执行脚本,Next:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

[root@dg~]#/u01/app/oracle/product/11.2.0/db_1/root.sh

PerformingrootuseroperationforOracle11g

Thefollowingenvironmentvariablesaresetas:

ORACLE_OWNER=oracle

ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1

Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:

Thecontentsof"dbhome"havenotchanged.Noneedtooverwrite.

Thecontentsof"oraenv"havenotchanged.Noneedtooverwrite.

Thecontentsof"coraenv"havenotchanged.Noneedtooverwrite.

Entrieswillbeaddedtothe/etc/oratabfileasneededby

DatabaseConfigurationAssistantwhenadatabaseiscreated

Finishedrunninggenericpartofrootscript.

Nowproduct-specificrootactionswillbeperformed.

Finishedproduct-specificrootactions.

[root@dg~]#

最后,完成 oracle 软件的安装。

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

0 10  RAC  主库配置单实例  e Active  Dataguard

1 10.1  RAC  主库准备工作

① RAC 主库必须置为归档模式:

SQL>selectopen_modefromv$database;

OPEN_MODE

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

MOUNTED

SQL>selectopen_mode,log_modefromv$database;

OPEN_MODE LOG_MODE

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

MOUNTED NOARCHIVELOG

SQL>alterdatabasearchivelog;

Databasealtered.

SQL>selectopen_mode,log_modefromv$database;

OPEN_MODE LOG_MODE

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

MOUNTED ARCHIVELOG

SQL>shutdownimmediate;

ORA-01109:databasenotopen

Databasedismounted.

ORACLEinstanceshutdown.

SQL>

② RAC 主库必须置为 Force Logging 模式:

SQL>selectname,log_mode,force_loggingfromgv$database;

NAME LOG_MODE FOR

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

DEVDB NOARCHIVELOGNO

DEVDB NOARCHIVELOGNO

SQL>alterdatabaseforcelogging;

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Databasealtered.

SQL>selectname,log_mode,force_loggingfromgv$database;

NAME LOG_MODE FOR

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

DEVDB NOARCHIVELOGYES

DEVDB NOARCHIVELOGYES

SQL>

③ RAC 主库执行 RMAN 全备:

RMAN>run{

2>allocatechannelc1typedisk;

3>allocatechannelc2typedisk;

4>allocatechannelc3typedisk;

5>allocatechannelc4typedisk;

6>backupdatabaseformat'/rman_backup/Full_%U.bak';

7>releasechannelc1;

8>releasechannelc2;

9>releasechannelc3;

10>releasechannelc4;

11>}

releasedchannel:ORA_DISK_1

allocatedchannel:c1

channelc1:SID=30instance=devdb1devicetype=DISK

allocatedchannel:c2

channelc2:SID=157instance=devdb1devicetype=DISK

allocatedchannel:c3

channelc3:SID=31instance=devdb1devicetype=DISK

allocatedchannel:c4

channelc4:SID=158instance=devdb1devicetype=DISK

Startingbackupat2012/11/1015:08:53

channelc1:startingfulldatafilebackupset

channelc1:specifyingdatafile(s)inbackupset

inputdatafilefilenumber=00002

name=+DATA/devdb/datafile/sysaux.257.788218297

inputdatafilefilenumber=00004

name=+DATA/devdb/datafile/users.259.788218299

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

channelc1:startingpiece1at2012/11/1015:08:55

channelc2:startingfulldatafilebackupset

channelc2:specifyingdatafile(s)inbackupset

inputdatafilefilenumber=00001

name=+DATA/devdb/datafile/system.256.788218297

inputdatafilefilenumber=00003

name=+DATA/devdb/datafile/undotbs1.258.788218299

channelc2:startingpiece1at2012/11/1015:08:55

channelc3:startingfulldatafilebackupset

channelc3:specifyingdatafile(s)inbackupset

inputdatafilefilenumber=00005

name=+DATA/devdb/datafile/example.264.788218431

inputdatafilefilenumber=00006

name=+DATA/devdb/datafile/undotbs2.265.788218695

channelc3:startingpiece1at2012/11/1015:08:57

channelc4:startingfulldatafilebackupset

channelc4:specifyingdatafile(s)inbackupset

channelc1:finishedpiece1at2012/11/1015:09:24

piece handle=/rman_backup/Full_0anpvcs7_1_1.bak tag=TAG20121110T150854

comment=NONE

channelc1:backupsetcomplete,elapsedtime:00:00:29

channelc1:startingfulldatafilebackupset

channelc1:specifyingdatafile(s)inbackupset

includingcurrentSPFILEinbackupset

channelc1:startingpiece1at2012/11/1015:09:24

channelc2:finishedpiece1at2012/11/1015:09:24

piece handle=/rman_backup/Full_0bnpvcs7_1_1.bak tag=TAG20121110T150854

comment=NONE

channelc2:backupsetcomplete,elapsedtime:00:00:29

channelc3:finishedpiece1at2012/11/1015:09:24

piece handle=/rman_backup/Full_0cnpvcs7_1_1.bak tag=TAG20121110T150854

comment=NONE

channelc3:backupsetcomplete,elapsedtime:00:00:27

includingcurrentcontrolfileinbackupset

channelc4:startingpiece1at2012/11/1015:09:25

channelc1:finishedpiece1at2012/11/1015:09:26

piece handle=/rman_backup/Full_0enpvct4_1_1.bak tag=TAG20121110T150854

comment=NONE

channelc1:backupsetcomplete,elapsedtime:00:00:02

channelc4:finishedpiece1at2012/11/1015:09:26

piece handle=/rman_backup/Full_0dnpvcsb_1_1.bak tag=TAG20121110T150854

comment=NONE

channelc4:backupsetcomplete,elapsedtime:00:00:01

Finishedbackupat2012/11/1015:09:26

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

releasedchannel:c1

releasedchannel:c2

releasedchannel:c3

releasedchannel:c4

RMAN>

RMAN>backuparchivelogallformat'/rman_backup/ARC_%U.bak';

Startingbackupat2012/11/1015:11:00

currentlogarchived

allocatedchannel:ORA_DISK_1

channelORA_DISK_1:SID=30instance=devdb1devicetype=DISK

channelORA_DISK_1:startingarchivedlogbackupset

channelORA_DISK_1:specifyingarchivedlog(s)inbackupset

inputarchivedlogthread=2sequence=64RECID=8STAMP=798995461

inputarchivedlogthread=1sequence=86RECID=7STAMP=798995460

channelORA_DISK_1:startingpiece1at2012/11/1015:11:02

channelORA_DISK_1:finishedpiece1at2012/11/1015:11:03

piecehandle=/rman_backup/ARC_0fnpvd06_1_1.baktag=TAG20121110T151102

comment=NONE

channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01

Finishedbackupat2012/11/1015:11:03

RMAN>

④ RAC 主库执行创建物理备库控制文件:

RMAN>backupdevicetypediskformat'/rman_backup/standby_%U.ctl'

currentcontrolfileforstandby;

Startingbackupat2012/11/1015:14:12

usingchannelORA_DISK_1

channelORA_DISK_1:startingfulldatafilebackupset

channelORA_DISK_1:specifyingdatafile(s)inbackupset

includingstandbycontrolfileinbackupset

channelORA_DISK_1:startingpiece1at2012/11/1015:14:14

channelORA_DISK_1:finishedpiece1at2012/11/1015:14:15

piecehandle=/rman_backup/standby_0gnpvd65_1_1.ctl

tag=TAG20121110T151412comment=NONE

channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01

Finishedbackupat2012/11/1015:14:15

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

RMAN>

⑤ RAC 主库创建物理备库初始化参数文件:

node1->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSatNov1015:16:302012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>showparameterspfile;

NAME TYPE VALUE

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

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

spfile string

+DATA/devdb/spfiledevdb.ora

SQL>createpfile='/rman_backup/initphydb.ora'fromspfile;

Filecreated.

SQL>

⑥ RAC 主库修改口令文件,使双节点 SYS用户口令一致:

2 10.2  物理备库准备工作

① FTP 主库备份文件+备库控制文件+备库参数文件至物理备库服务器:

node1->cd/rman_backup/

node1->ll

total1552496

-rw-r----- 1 oracle asmadmin 3350016 Nov10 15:11 ARC_0fnpvd06_1_1.bak

-rw-r----- 1 oracle asmadmin 812523520 Nov 10 15:09 Full_0anpvcs7_1_1.bak

-rw-r----- 1 oracle asmadmin 658538496 Nov 10 15:09 Full_0bnpvcs7_1_1.bak

-rw-r-----1oracleasmadmin 76546048Nov1015:09

Full_0cnpvcs7_1_1.bak

-rw-r-----1oracleasmadmin 18546688Nov1015:09

Full_0dnpvcsb_1_1.bak

-rw-r-----1oracleasmadmin 98304Nov1015:09

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Full_0enpvct4_1_1.bak

-rw-r--r--1oracleasmadmin 1380Nov1015:17initphydb.ora

drwx------2oracleoinstall 16384Nov1014:19lost+found

-rw-r-----1oracleasmadmin 18546688Nov1015:14

standby_0gnpvd65_1_1.ctl

node1->scp/rman_backup/Full_0*.bak172.16.0.212:/rman_backup/

Theauthenticityofhost'172.16.0.212(172.16.0.212)'can'tbe

established.

RSA key fingerprint is 60:4b:e6:e1:29:4c:7b:7c:17:30:c3:3c:57:99:a5:d3.

Areyousureyouwanttocontinueconnecting(yes/no)?yes

Warning:Permanentlyadded'172.16.0.212'(RSA)tothelistofknown

hosts.

oracle@172.16.0.212'spassword:

Full_0anpvcs7_1_1.bak 100% 775MB

20.9MB/s 00:37

Full_0bnpvcs7_1_1.bak 100% 628MB

19.0MB/s 00:33

Full_0cnpvcs7_1_1.bak 100% 73MB

18.3MB/s 00:04

Full_0dnpvcsb_1_1.bak 100% 18MB

17.7MB/s 00:01

Full_0enpvct4_1_1.bak 100% 96KB

96.0KB/s 00:00

node1->scp/rman_backup/ARC_0fnpvd06_1_1.bak

172.16.0.212:/rman_backup/

oracle@172.16.0.212'spassword:

ARC_0fnpvd06_1_1.bak 100%3272KB

3.2MB/s 00:00

node1->scp/rman_backup/initphydb.ora172.16.0.212:/rman_backup/

oracle@172.16.0.212'spassword:

initphydb.ora 100%1380

1.4KB/s 00:00

node1->scp/rman_backup/standby_0gnpvd65_1_1.ctl

172.16.0.212:/rman_backup/

oracle@172.16.0.212'spassword:

standby_0gnpvd65_1_1.ctl 100% 18MB

17.7MB/s 00:01

node1->

② 物理备库创建口令文件:

③ 物理备库初始化参数文件修改:

dg->cat/u01/app/oracle/product/11.2.0/db_1/dbs/initphydb.ora

phydb.__db_cache_size=255852544

phydb.__java_pool_size=4194304

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

phydb.__large_pool_size=4194304

phydb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

phydb.__pga_aggregate_target=419430400

phydb.__sga_target=423624704

phydb.__shared_io_pool_size=0

phydb.__shared_pool_size=146800640

phydb.__streams_pool_size=0

*.audit_file_dest='/u01/app/oracle/admin/phydb/adump'

*.audit_trail='db'

*.cluster_database=false

*.compatible='11.2.0.0.0'

*.control_files='+DATA/phydb/controlfile/cont.ctl'

*.core_dump_dest='/u01/app/oracle/diag/rdbms/phydb/cdump'

*.db_block_size=8192

*.db_create_file_dest='+DATA'

*.db_domain=''

*.db_file_name_convert='+DATA/devdb/','+DATA/phydb/'

*.db_name='devdb'

*.db_recovery_file_dest='+FLASH'

*.db_recovery_file_dest_size=4070572032

*.db_unique_name='phydb'

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP)(SERVICE=phydbXDB)'

*.fal_client='phydb'

*.fal_server='devdb1','devdb2'

*.log_archive_config='dg_config=(devdb,phydb)'

*.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST

valid_for=(all_logfiles,all_roles)db_unique_name=phydb'

*.log_archive_dest_2='service=devdb1

valid_for=(online_logfiles,primary_role)db_unique_name=devdb'

*.log_archive_format='ARC_%t_%S_%r.arc'

*.log_file_name_convert='+DATA/devdb/','+DATA/phydb/'

*.memory_target=842006528

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='exclusive'

*.service_names='phydb'

*.standby_file_management='auto'

*.thread=1

*.undo_management='auto'

*.undo_tablespace='UNDOTBS1'

dg->

④ 配置 RAC 主库,物理备库的 tnsnames.ora 文件:

DEVDB=

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

(DESCRIPTION=

(ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster.localdomain)(PORT =

1521))

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=devdb)

)

)

devdb1=

(DESCRIPTION=

(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.193)(PORT=1521))

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=devdb)

(INSTANCE_NAME=devdb1)

)

)

devdb2=

(DESCRIPTION=

(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.194)(PORT=1521))

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=devdb)

(INSTANCE_NAME=devdb2)

)

)

phydb=

(DESCRIPTION=

(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.212)(PORT=1521))

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=phydb)

)

)

3 10.3  创建物理备库

① 物理备库启动 NOMOUNT 状态:

dg->env|grepORA

ORACLE_UNQNAME=phydb

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

ORACLE_SID=phydb

ORACLE_BASE=/u01/app/oracle

ORACLE_HOSTNAME=dg.localdomain

ORACLE_TERM=xterm

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

dg->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononThuNov1519:03:322012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedtoanidleinstance.

SQL>startupnomount;

ORACLEinstancestarted.

TotalSystemGlobalArea 839282688bytes

FixedSize 2233000bytes

VariableSize 574623064bytes

DatabaseBuffers 255852544bytes

RedoBuffers 6574080bytes

SQL>!

dg->ps-ef|grepora_

oracle 4158 1 019:03? 00:00:00ora_pmon_phydb

oracle 4160 1 019:03? 00:00:00ora_psp0_phydb

oracle 4163 1 019:03? 00:00:00ora_vktm_phydb

oracle 4167 1 019:03? 00:00:00ora_gen0_phydb

oracle 4169 1 019:03? 00:00:00ora_diag_phydb

oracle 4171 1 019:03? 00:00:00ora_dbrm_phydb

oracle 4173 1 019:03? 00:00:00ora_dia0_phydb

oracle 4175 11419:03? 00:00:01ora_mman_phydb

oracle 4177 1 019:03? 00:00:00ora_dbw0_phydb

oracle 4179 1 019:03? 00:00:00ora_lgwr_phydb

oracle 4181 1 019:03? 00:00:00ora_ckpt_phydb

oracle 4183 1 019:03? 00:00:00ora_smon_phydb

oracle 4185 1 019:03? 00:00:00ora_reco_phydb

oracle 4187 1 019:03? 00:00:00ora_rbal_phydb

oracle 4189 1 019:03? 00:00:00ora_asmb_phydb

oracle 4191 1 019:03? 00:00:00ora_mmon_phydb

oracle 4193 1 019:03? 00:00:00ora_mmnl_phydb

oracle 4195 1 019:03? 00:00:00ora_d000_phydb

oracle 4197 1 019:03? 00:00:00ora_s000_phydb

oracle 4226 1 119:03? 00:00:00ora_mark_phydb

oracle 4233 1 019:03? 00:00:00ora_ocf0_phydb

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

oracle 4295 4268 019:03pts/2 00:00:00grepora_

dg->exit

exit

SQL>exit

② RMAN 恢复备库控制文件:

dg->rman

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov15 19:04:10

2012

Copyright(c)1982,2011,Oracleand/oritsaffiliates. Allrights

reserved.

connectedtotargetdatabase:DEVDB(notmounted)

RMAN>restorestandbycontrolfilefrom

'/rman_backup/standby_0gnpvd65_1_1.ctl';

Startingrestoreat2012/11/1519:04:43

usingtargetdatabasecontrolfileinsteadofrecoverycatalog

allocatedchannel:ORA_DISK_1

channelORA_DISK_1:SID=136devicetype=DISK

channelORA_DISK_1:restoringcontrolfile

channelORA_DISK_1:restorecomplete,elapsedtime:00:00:08

outputfilename=+DATA/phydb/controlfile/cont.ctl

Finishedrestoreat2012/11/1519:04:53

RMAN>

③ MOUNT 物理备库:

dg->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononThuNov1519:08:232012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,OLAP,DataMiningandRealApplicationTesting

options

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>selectopen_modefromv$database;

selectopen_modefromv$database

*

ERRORatline1:

ORA-01507:databasenotmounted

SQL>alterdatabasemount;

Databasealtered.

SQL>

④ RMAN restore物理备库:

RMAN>run

2>{allocatechannelc2typedisk;

3>allocatechannelc1typedisk;

4>allocatechannelc3typedisk;

5>allocatechannelc4typedisk;

6>restoredatabase;

7>releasechannelc1;

8>releasechannelc2;

9>releasechannelc3;

10>releasechannelc4;

11>}

usingtargetdatabasecontrolfileinsteadofrecoverycatalog

allocatedchannel:c2

channelc2:SID=125devicetype=DISK

allocatedchannel:c1

channelc1:SID=16devicetype=DISK

allocatedchannel:c3

channelc3:SID=142devicetype=DISK

allocatedchannel:c4

channelc4:SID=17devicetype=DISK

Startingrestoreat2012/11/1519:10:59

Startingimplicitcrosscheckbackupat2012/11/1519:10:59

Crosschecked6objects

Finishedimplicitcrosscheckbackupat2012/11/1519:11:02

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Startingimplicitcrosscheckcopyat2012/11/1519:11:02

Finishedimplicitcrosscheckcopyat2012/11/1519:11:02

searchingforallfilesintherecoveryarea

catalogingfiles...

nofilescataloged

channelc2:startingdatafilebackupsetrestore

channelc2:specifyingdatafile(s)torestorefrombackupset

channelc2:restoringdatafile00001to

+DATA/phydb/datafile/system.256.788218297

channelc2:restoringdatafile00003to

+DATA/phydb/datafile/undotbs1.258.788218299

channel c2: reading from backup piece /rman_backup/Full_0bnpvcs7_1_1.bak

channelc1:startingdatafilebackupsetrestore

channelc1:specifyingdatafile(s)torestorefrombackupset

channelc1:restoringdatafile00002to

+DATA/phydb/datafile/sysaux.257.788218297

channelc1:restoringdatafile00004to

+DATA/phydb/datafile/users.259.788218299

channel c1: reading from backup piece /rman_backup/Full_0anpvcs7_1_1.bak

channelc3:startingdatafilebackupsetrestore

channelc3:specifyingdatafile(s)torestorefrombackupset

channelc3:restoringdatafile00005to

+DATA/phydb/datafile/example.264.788218431

channelc3:restoringdatafile00006to

+DATA/phydb/datafile/undotbs2.265.788218695

channel c3: reading from backup piece /rman_backup/Full_0cnpvcs7_1_1.bak

channelc3:piecehandle=/rman_backup/Full_0cnpvcs7_1_1.bak

tag=TAG20121110T150854

channelc3:restoredbackuppiece1

channelc3:restorecomplete,elapsedtime:00:07:26

channelc2:piecehandle=/rman_backup/Full_0bnpvcs7_1_1.bak

tag=TAG20121110T150854

channelc2:restoredbackuppiece1

channelc2:restorecomplete,elapsedtime:00:08:46

channelc1:piecehandle=/rman_backup/Full_0anpvcs7_1_1.bak

tag=TAG20121110T150854

channelc1:restoredbackuppiece1

channelc1:restorecomplete,elapsedtime:00:09:36

Finishedrestoreat2012/11/1519:20:42

releasedchannel:c1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

releasedchannel:c2

releasedchannel:c3

releasedchannel:c4

RMAN>

⑤备库上创建 standby logfile:

SQL>select*fromv$standby_log;

norowsselected

SQL> alter databaseadd standby logfile thread 1 group 5 size 50m,group

6size50m,group7size50m;

Databasealtered.

SQL>

SQL> alter databaseadd standby logfile thread 2 group 8 size 50m,group

9size50m,group10size50m;

Databasealtered.

SQL>

SQL>

SQL>select*fromv$standby_log;

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

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

5UNASSIGNED 1

0

52428800 512 0YESUNASSIGNED

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

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

6UNASSIGNED 1

0

52428800 512 0YESUNASSIGNED

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

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

7UNASSIGNED 1

0

52428800 512 0YESUNASSIGNED

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

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

8UNASSIGNED 2

0

52428800 512 0YESUNASSIGNED

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

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

9UNASSIGNED 2

0

52428800 512 0YESUNASSIGNED

GROUP#DBID THREAD#

SEQUENCE#

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

----------

BYTES BLOCKSIZE USEDARCSTATUS FIRST_CHANGE#

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

FIRST_TIME NEXT_CHANGE#NEXT_TIME LAST_CHANGE#

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

LAST_TIME

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

10UNASSIGNED 2

0

52428800 512 0YESUNASSIGNED

6rowsselected.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>select*fromv$logfile;

GROUP#STATUS TYPE MEMBER

IS_

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

2 ONLINE +DATA/phydb/onlinelog/group_2.262.788218

NO

415

2 ONLINE +FLASH/devdb/onlinelog/group_2.258.78821

NO

8415

1 ONLINE +DATA/phydb/onlinelog/group_1.261.788218

NO

413

1 ONLINE +FLASH/devdb/onlinelog/group_1.257.78821

NO

8413

GROUP#STATUS TYPE MEMBER

IS_

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

3 ONLINE +DATA/phydb/onlinelog/group_3.266.788218

NO

805

3 ONLINE +FLASH/devdb/onlinelog/group_3.259.78821

NO

8805

4 ONLINE +DATA/phydb/onlinelog/group_4.267.788218

NO

805

4 ONLINE +FLASH/devdb/onlinelog/group_4.260.78821

NO

GROUP#STATUS TYPE MEMBER

IS_

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

8807

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

5 STANDBY +DATA/phydb/onlinelog/group_5.263.799443 NO

149

5 STANDBY+FLASH/phydb/onlinelog/group_5.256.79944

YES

3163

6 STANDBY +DATA/phydb/onlinelog/group_6.264.799443 NO

165

GROUP#STATUS TYPE MEMBER

IS_

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

6 STANDBY+FLASH/phydb/onlinelog/group_6.257.79944

YES

3181

7 STANDBY +DATA/phydb/onlinelog/group_7.265.799443 NO

183

7 STANDBY+FLASH/phydb/onlinelog/group_7.258.79944

YES

3199

8 STANDBY +DATA/phydb/onlinelog/group_8.266.799443 NO

297

GROUP#STATUS TYPE MEMBER

IS_

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

8 STANDBY+FLASH/phydb/onlinelog/group_8.259.79944

YES

3309

9 STANDBY +DATA/phydb/onlinelog/group_9.267.799443 NO

311

9 STANDBY+FLASH/phydb/onlinelog/group_9.260.79944

YES

3327

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

10 STANDBY +DATA/phydb/onlinelog/group_10.268.79944 NO

GROUP#STATUS TYPE MEMBER

IS_

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

3329

10 STANDBY+FLASH/phydb/onlinelog/group_10.261.7994

YES

43345

20rowsselected.

SQL>

⑥ 主库参数调整:

SQL>showparameterspfile;

NAME TYPE VALUE

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

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

spfile string

+DATA/devdb/spfiledevdb.ora

SQL>showparameterlog_arch

NAME TYPE VALUE

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

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

log_archive_config string

log_archive_dest string

log_archive_dest_1 string

log_archive_dest_10 string

log_archive_dest_11 string

log_archive_dest_12 string

log_archive_dest_13 string

log_archive_dest_14 string

log_archive_dest_15 string

log_archive_dest_16 string

log_archive_dest_17 string

NAME TYPE VALUE

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

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_dest_18 string

log_archive_dest_19 string

log_archive_dest_2 string

log_archive_dest_20 string

log_archive_dest_21 string

log_archive_dest_22 string

log_archive_dest_23 string

log_archive_dest_24 string

log_archive_dest_25 string

log_archive_dest_26 string

log_archive_dest_27 string

NAME TYPE VALUE

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

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

log_archive_dest_28 string

log_archive_dest_29 string

log_archive_dest_3 string

log_archive_dest_30 string

log_archive_dest_31 string

log_archive_dest_4 string

log_archive_dest_5 string

log_archive_dest_6 string

log_archive_dest_7 string

log_archive_dest_8 string

log_archive_dest_9 string

NAME TYPE VALUE

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

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

log_archive_dest_state_1 string enable

log_archive_dest_state_10 string enable

log_archive_dest_state_11 string enable

log_archive_dest_state_12 string enable

log_archive_dest_state_13 string enable

log_archive_dest_state_14 string enable

log_archive_dest_state_15 string enable

log_archive_dest_state_16 string enable

log_archive_dest_state_17 string enable

log_archive_dest_state_18 string enable

log_archive_dest_state_19 string enable

NAME TYPE VALUE

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

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

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

log_archive_dest_state_2 string enable

log_archive_dest_state_20 string enable

log_archive_dest_state_21 string enable

log_archive_dest_state_22 string enable

log_archive_dest_state_23 string enable

log_archive_dest_state_24 string enable

log_archive_dest_state_25 string enable

log_archive_dest_state_26 string enable

log_archive_dest_state_27 string enable

log_archive_dest_state_28 string enable

log_archive_dest_state_29 string enable

NAME TYPE VALUE

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

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

log_archive_dest_state_3 string enable

log_archive_dest_state_30 string enable

log_archive_dest_state_31 string enable

log_archive_dest_state_4 string enable

log_archive_dest_state_5 string enable

log_archive_dest_state_6 string enable

log_archive_dest_state_7 string enable

log_archive_dest_state_8 string enable

log_archive_dest_state_9 string enable

log_archive_duplex_dest string

log_archive_format string %t_%s_%r.dbf

NAME TYPE VALUE

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

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

log_archive_local_first boolean TRUE

log_archive_max_processes integer 4

log_archive_min_succeed_dest integer 1

log_archive_start boolean FALSE

log_archive_trace integer 0

SQL>

SQL>

SQL>

SQL>

SQL>

SQL>altersystemsetlog_archive_dest_2='service=phydblgwrsync

valid_for=(online_logfiles,primary_role)db_unique_name=phydb'

sid='*';

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Systemaltered.

SQL>showparameterlog_arch

NAME TYPE VALUE

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

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

log_archive_config string

log_archive_dest string

log_archive_dest_1 string

log_archive_dest_10 string

log_archive_dest_11 string

log_archive_dest_12 string

log_archive_dest_13 string

log_archive_dest_14 string

log_archive_dest_15 string

log_archive_dest_16 string

log_archive_dest_17 string

NAME TYPE VALUE

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

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

log_archive_dest_18 string

log_archive_dest_19 string

log_archive_dest_2 string service=phydblgwr

syncvalid_

for=(online_logfiles,primary_r

ole)

db_unique_name=phydb

log_archive_dest_20 string

log_archive_dest_21 string

log_archive_dest_22 string

log_archive_dest_23 string

log_archive_dest_24 string

log_archive_dest_25 string

NAME TYPE VALUE

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

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

log_archive_dest_26 string

log_archive_dest_27 string

log_archive_dest_28 string

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_dest_29 string

log_archive_dest_3 string

log_archive_dest_30 string

log_archive_dest_31 string

log_archive_dest_4 string

log_archive_dest_5 string

log_archive_dest_6 string

log_archive_dest_7 string

NAME TYPE VALUE

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

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

log_archive_dest_8 string

log_archive_dest_9 string

log_archive_dest_state_1 string enable

log_archive_dest_state_10 string enable

log_archive_dest_state_11 string enable

log_archive_dest_state_12 string enable

log_archive_dest_state_13 string enable

log_archive_dest_state_14 string enable

log_archive_dest_state_15 string enable

log_archive_dest_state_16 string enable

log_archive_dest_state_17 string enable

NAME TYPE VALUE

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

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

log_archive_dest_state_18 string enable

log_archive_dest_state_19 string enable

log_archive_dest_state_2 string enable

log_archive_dest_state_20 string enable

log_archive_dest_state_21 string enable

log_archive_dest_state_22 string enable

log_archive_dest_state_23 string enable

log_archive_dest_state_24 string enable

log_archive_dest_state_25 string enable

log_archive_dest_state_26 string enable

log_archive_dest_state_27 string enable

NAME TYPE VALUE

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

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

log_archive_dest_state_28 string enable

log_archive_dest_state_29 string enable

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_dest_state_3 string enable

log_archive_dest_state_30 string enable

log_archive_dest_state_31 string enable

log_archive_dest_state_4 string enable

log_archive_dest_state_5 string enable

log_archive_dest_state_6 string enable

log_archive_dest_state_7 string enable

log_archive_dest_state_8 string enable

log_archive_dest_state_9 string enable

NAME TYPE VALUE

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

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

log_archive_duplex_dest string

log_archive_format string %t_%s_%r.dbf

log_archive_local_first boolean TRUE

log_archive_max_processes integer 4

log_archive_min_succeed_dest integer 1

log_archive_start boolean FALSE

log_archive_trace integer 0

SQL>

SQL>

SQL>

SQL>altersystemsetlog_archive_config='dg_config=(devdb,phydb)'

sid='*';

Systemaltered.

SQL>showparameterlog_arch

NAME TYPE VALUE

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

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

log_archive_config string

dg_config=(devdb,phydb)

log_archive_dest string

log_archive_dest_1 string

log_archive_dest_10 string

log_archive_dest_11 string

log_archive_dest_12 string

log_archive_dest_13 string

log_archive_dest_14 string

log_archive_dest_15 string

log_archive_dest_16 string

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_dest_17 string

NAME TYPE VALUE

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

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

log_archive_dest_18 string

log_archive_dest_19 string

log_archive_dest_2 string service=phydblgwr

syncvalid_

for=(online_logfiles,primary_r

ole)

db_unique_name=phydb

log_archive_dest_20 string

log_archive_dest_21 string

log_archive_dest_22 string

log_archive_dest_23 string

log_archive_dest_24 string

log_archive_dest_25 string

NAME TYPE VALUE

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

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

log_archive_dest_26 string

log_archive_dest_27 string

log_archive_dest_28 string

log_archive_dest_29 string

log_archive_dest_3 string

log_archive_dest_30 string

log_archive_dest_31 string

log_archive_dest_4 string

log_archive_dest_5 string

log_archive_dest_6 string

log_archive_dest_7 string

NAME TYPE VALUE

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

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

log_archive_dest_8 string

log_archive_dest_9 string

log_archive_dest_state_1 string enable

log_archive_dest_state_10 string enable

log_archive_dest_state_11 string enable

log_archive_dest_state_12 string enable

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_dest_state_13 string enable

log_archive_dest_state_14 string enable

log_archive_dest_state_15 string enable

log_archive_dest_state_16 string enable

log_archive_dest_state_17 string enable

NAME TYPE VALUE

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

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

log_archive_dest_state_18 string enable

log_archive_dest_state_19 string enable

log_archive_dest_state_2 string enable

log_archive_dest_state_20 string enable

log_archive_dest_state_21 string enable

log_archive_dest_state_22 string enable

log_archive_dest_state_23 string enable

log_archive_dest_state_24 string enable

log_archive_dest_state_25 string enable

log_archive_dest_state_26 string enable

log_archive_dest_state_27 string enable

NAME TYPE VALUE

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

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

log_archive_dest_state_28 string enable

log_archive_dest_state_29 string enable

log_archive_dest_state_3 string enable

log_archive_dest_state_30 string enable

log_archive_dest_state_31 string enable

log_archive_dest_state_4 string enable

log_archive_dest_state_5 string enable

log_archive_dest_state_6 string enable

log_archive_dest_state_7 string enable

log_archive_dest_state_8 string enable

log_archive_dest_state_9 string enable

NAME TYPE VALUE

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

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

log_archive_duplex_dest string

log_archive_format string %t_%s_%r.dbf

log_archive_local_first boolean TRUE

log_archive_max_processes integer 4

log_archive_min_succeed_dest integer 1

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

log_archive_start boolean FALSE

log_archive_trace integer 0

SQL>

⑦ 备库接收主库日志:

SQL>selectsequence#,name,appliedfromv$archived_log;

SEQUENCE#NAME

APPLIED

----------

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

----------

88

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_88.264.799449185

NO

89

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_89.263.799449185

NO

87

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_87.262.799449185

NO

67

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_67.267.799449909

NO

65

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_65.265.799449909

NO

66

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_66.266.799449909

NO

68

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_68.268.799449911

NO

69

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_69.269.799450129

NO

90

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_90.270.799450333

NO

9rowsselected.

SQL>

在这里有可能遇到备库无法顺利接收主库日志,例如,从 RAC 主库第 2 个节点的 alert

日志文件中:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

node2->tail-falert_devdb2.log

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

Checkthattheprimaryandstandbyareusingapasswordfile

andremote_login_passwordfileissettoSHAREDorEXCLUSIVE,

andthattheSYSpasswordissameinthepasswordfiles.

returningerrorORA-16191

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

PING[ARC2]:Heartbeatfailedtoconnecttostandby'phydb'.Erroris

16191.

ThuNov1521:24:062012

Error1031receivedloggingontothestandby

PING[ARC2]: Heartbeat failed to connect to standby 'phydb'. Error is 1031.

ThuNov1521:28:442012

******************************************************************

LGWR:Setting'active'archivalfordestinationLOG_ARCHIVE_DEST_2

说明,节点 2无法将归档日志传递到备库。

原因:节点 2的 SYS 用户口令同备库的 SYS 口令不一致。

解决:调整节点 2的 SYS 用户口令,或者重新配置口令文件。

⑧备库开始应用日志:

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>

过几分钟后:

SQL>selectsequence#,name,appliedfromv$archived_log;

SEQUENCE#NAME

APPLIED

----------

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

----------

88

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_88.264.799449185

YES

89

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_89.263.799449185

YES

87

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_87.262.799449185

YES

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

67

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_67.267.799449909

YES

65

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_65.265.799449909

YES

66

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_66.266.799449909

YES

68

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_68.268.799449911

YES

69

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_69.269.799450129

NO

90

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_90.270.799450333

YES

86

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_86.275.799450669

YES

64

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_64.276.799450671

YES

11rowsselected.

SQL>

⑨ 备库以 READONLY 方式打开:

SQL>select

dbid,name,switchover_status,db_unique_name,database_role,open_mode,cu

rrent_scnfromv$database;

DBIDNAME

SWITCHOVER_STATUS DB_UNIQUE_NAME DATABASE_ROLE

OPEN_MODE CURRENT_SCN

----------

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

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

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

692948393DEVDB

NOTALLOWED phydb PHYSICALSTANDBY

MOUNTED6515016

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>alterdatabaseopen;

alterdatabaseopen

*

ERRORatline1:

ORA-10456: cannot open standby database; media recovery session may be

inprogress

SQL>alterdatabaserecovermanagedstandbydatabasecancel;

Databasealtered.

SQL>alterdatabaseopen;

Databasealtered.

SQL>select

dbid,name,switchover_status,db_unique_name,database_role,open_mode,cu

rrent_scnfromv$database;

DBIDNAME

SWITCHOVER_STATUS DB_UNIQUE_NAME DATABASE_ROLE

OPEN_MODE CURRENT_SCN

----------

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

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

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

692948393DEVDB

NOTALLOWED phydb PHYSICALSTANDBY

READONLY6515016

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>select

dbid,name,switchover_status,db_unique_name,database_role,open_mode,cu

rrent_scnfromv$database;

DBIDNAME

SWITCHOVER_STATUS DB_UNIQUE_NAME DATABASE_ROLE

OPEN_MODE CURRENT_SCN

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

----------

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

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

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

692948393DEVDB

NOTALLOWED phydb PHYSICALSTANDBY

READONLYWITHAPPLY6515016

SQL>selectsequence#,name,appliedfromv$archived_log;

SEQUENCE#NAME

APPLIED

----------

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

----------

88

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_88.264.799449185

YES

89

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_89.263.799449185

YES

87

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_87.262.799449185

YES

67

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_67.267.799449909

YES

65

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_65.265.799449909

YES

66

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_66.266.799449909

YES

68

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_68.268.799449911

YES

69

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_69.269.799450129

NO

90

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_90.270.799450333

YES

86

+FLASH/phydb/archivelog/2012_11_15/thread_1_seq_86.275.799450669

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

YES

64

+FLASH/phydb/archivelog/2012_11_15/thread_2_seq_64.276.799450671

YES

11rowsselected.

SQL>

至此,我们已经顺利的给 RAC 主库配置 Active Physical Dataguard 成功!

1 11  测试物理备库功能

1 11.1  测试文件同步

① 主库查看表空间信息:

[root@node1~]#su-oracle

node1->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1810:32:062012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>setline200

SQL>colfile_namefora60

SQL>selectfile_name,tablespace_namefromdba_data_files;

FILE_NAME

TABLESPACE_NAME

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

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

+DATA/devdb/datafile/users.259.788218299 USERS

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

+DATA/devdb/datafile/undotbs1.258.788218299 UNDOTBS1

+DATA/devdb/datafile/sysaux.257.788218297 SYSAUX

+DATA/devdb/datafile/system.256.788218297 SYSTEM

+DATA/devdb/datafile/example.264.788218431 EXAMPLE

+DATA/devdb/datafile/undotbs2.265.788218695 UNDOTBS2

6rowsselected.

SQL>

② 查看物理备库表空间信息:

[root@dg~]#su-oracle

dg->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1810:36:482012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

andRealApplicationTestingoptions

SQL>colfile_namefora60

SQL>setline200

SQL>selectfile_name,tablespace_namefromdba_data_files;

FILE_NAME

TABLESPACE_NAME

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

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

+DATA/phydb/datafile/users.262.799441871 USERS

+DATA/phydb/datafile/undotbs1.261.799441871 UNDOTBS1

+DATA/phydb/datafile/sysaux.258.799441867 SYSAUX

+DATA/phydb/datafile/system.257.799441867 SYSTEM

+DATA/phydb/datafile/example.259.799441867 EXAMPLE

+DATA/phydb/datafile/undotbs2.260.799441869 UNDOTBS2

6rowsselected.

SQL>

③ 主库创建测试表空间:

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>createtablespacedg_tbsdatafilesize5m;

Tablespacecreated.

SQL>selectfile_name,tablespace_name,bytes/1024/1024Mfrom

dba_data_files;

FILE_NAME

TABLESPACE_NAME M

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

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

+DATA/devdb/datafile/users.259.788218299 USERS 5

+DATA/devdb/datafile/undotbs1.258.788218299 UNDOTBS1

24

+DATA/devdb/datafile/sysaux.257.788218297 SYSAUX

1056

+DATA/devdb/datafile/system.256.788218297 SYSTEM

740

+DATA/devdb/datafile/example.264.788218431 EXAMPLE

313

+DATA/devdb/datafile/undotbs2.265.788218695 UNDOTBS2

240

+DATA/devdb/datafile/dg_tbs.269.799670501 DG_TBS5

7rowsselected.

SQL>

④ 查看物理备库表空间信息是否同步:

SQL>selectfile_name,tablespace_namefromdba_data_files;

FILE_NAME

TABLESPACE_NAME

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

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

+DATA/phydb/datafile/users.262.799441871 USERS

+DATA/phydb/datafile/undotbs1.261.799441871 UNDOTBS1

+DATA/phydb/datafile/sysaux.258.799441867 SYSAUX

+DATA/phydb/datafile/system.257.799441867 SYSTEM

+DATA/phydb/datafile/example.259.799441867 EXAMPLE

+DATA/phydb/datafile/undotbs2.260.799441869 UNDOTBS2

+DATA/phydb/datafile/dg_tbs.274.799670501 DG_TBS5

7rowsselected.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>

⑤ 主库删除表空间:

SQL>droptablespacedg_tbsincludingcontentsanddatafiles;

Tablespacedropped.

SQL>selectfile_name,tablespace_name,bytes/1024/1024Mfrom

dba_data_files;

FILE_NAME

TABLESPACE_NAME M

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

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

+DATA/devdb/datafile/users.259.788218299 USERS 5

+DATA/devdb/datafile/undotbs1.258.788218299 UNDOTBS1

24

+DATA/devdb/datafile/sysaux.257.788218297 SYSAUX

1056

+DATA/devdb/datafile/system.256.788218297 SYSTEM

740

+DATA/devdb/datafile/example.264.788218431 EXAMPLE

313

+DATA/devdb/datafile/undotbs2.265.788218695 UNDOTBS2

240

6rowsselected.

SQL>

⑥ 再次查看物理备库表空间是否同步:

SQL>selectfile_name,tablespace_namefromdba_data_files;

FILE_NAME

TABLESPACE_NAME

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

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

+DATA/phydb/datafile/users.262.799441871 USERS

+DATA/phydb/datafile/undotbs1.261.799441871 UNDOTBS1

+DATA/phydb/datafile/sysaux.258.799441867 SYSAUX

+DATA/phydb/datafile/system.257.799441867 SYSTEM

+DATA/phydb/datafile/example.259.799441867 EXAMPLE

+DATA/phydb/datafile/undotbs2.260.799441869 UNDOTBS2

6rowsselected.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>

2 11.2  测试数据同步

① 主库创建测试表:

② 备库查看测试表同步:

2 12  测试  DATAGUARD  SWITCHOVER  功能

1 12.1  RAC  主库、 e Active  d Dataguard  角色切换

即,将 RAC 主库切换为物理备库,物理备库切换为主库。

① 主库修改相关参数 fal_client、fal_server:

修改前:

SQL>showparameterspfile;

NAME TYPE VALUE

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

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

spfile string

+DATA/devdb/spfiledevdb.ora

SQL>showparameterfal

NAME TYPE VALUE

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

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

fal_client string

fal_server string

SQL>

修改:

SQL>altersystemsetfal_client='devdb1'sid='devdb1';

Systemaltered.

SQL>altersystemsetfal_client='devdb2'sid='devdb2';

Systemaltered.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>altersystemsetfal_server='phydb'sid='*';

Systemaltered.

SQL>showparameterfal

NAME TYPE VALUE

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

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

fal_client string devdb1

fal_server string phydb

SQL>

节点 2 修改后:

SQL>showparameterspfile;

NAME TYPE VALUE

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

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

spfile string

+DATA/devdb/spfiledevdb.ora

SQL>showparameterfal

NAME TYPE VALUE

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

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

fal_client string devdb2

fal_server string phydb

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string devdb2

SQL>

② 主库创建 standby logfile:

创建前:

[root@node1~]#su-oracle

snode1->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1812:03:462012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>showparameterspfile;

NAME TYPE VALUE

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

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

spfile string

+DATA/devdb/spfiledevdb.ora

SQL>setline200

SQL>colmemberfora60

SQL>select*fromv$logfile;

GROUP#STATUS TYPE MEMBER

IS_

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

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

2 ONLINE

+DATA/devdb/onlinelog/group_2.262.788218415 NO

2 ONLINE

+FLASH/devdb/onlinelog/group_2.258.788218415 YES

1 ONLINE

+DATA/devdb/onlinelog/group_1.261.788218413 NO

1 ONLINE

+FLASH/devdb/onlinelog/group_1.257.788218413 YES

3 ONLINE

+DATA/devdb/onlinelog/group_3.266.788218805 NO

3 ONLINE

+FLASH/devdb/onlinelog/group_3.259.788218805 YES

4 ONLINE

+DATA/devdb/onlinelog/group_4.267.788218805 NO

4 ONLINE

+FLASH/devdb/onlinelog/group_4.260.788218807 YES

8rowsselected.

SQL>select*fromv$standby_log;

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

norowsselected

SQL>

创建 standby logfile:

SQL> alter databaseadd standby logfile thread 1 group 5 size 50m,group

6size50m,group7size50m;

Databasealtered.

SQL> alter databaseadd standby logfile thread 2 group 8 size 50m,group

9size50m,group10size50m;

Databasealtered.

SQL>select*fromv$logfile;

GROUP#STATUS TYPE MEMBER

IS_

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

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

2 ONLINE

+DATA/devdb/onlinelog/group_2.262.788218415 NO

2 ONLINE

+FLASH/devdb/onlinelog/group_2.258.788218415 YES

1 ONLINE

+DATA/devdb/onlinelog/group_1.261.788218413 NO

1 ONLINE

+FLASH/devdb/onlinelog/group_1.257.788218413 YES

3 ONLINE

+DATA/devdb/onlinelog/group_3.266.788218805 NO

3 ONLINE

+FLASH/devdb/onlinelog/group_3.259.788218805 YES

4 ONLINE

+DATA/devdb/onlinelog/group_4.267.788218805 NO

4 ONLINE

+FLASH/devdb/onlinelog/group_4.260.788218807 YES

5 STANDBY

+DATA/devdb/onlinelog/group_5.269.799675631 NO

5 STANDBY

+FLASH/devdb/onlinelog/group_5.311.799675631 YES

6 STANDBY

+DATA/devdb/onlinelog/group_6.270.799675631 NO

GROUP#STATUS TYPE MEMBER

IS_

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

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

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

6 STANDBY

+FLASH/devdb/onlinelog/group_6.312.799675633 YES

7 STANDBY

+DATA/devdb/onlinelog/group_7.271.799675633 NO

7 STANDBY

+FLASH/devdb/onlinelog/group_7.313.799675633 YES

8 STANDBY

+DATA/devdb/onlinelog/group_8.272.799675651 NO

8 STANDBY

+FLASH/devdb/onlinelog/group_8.314.799675651 YES

9 STANDBY

+DATA/devdb/onlinelog/group_9.273.799675651 NO

9 STANDBY

+FLASH/devdb/onlinelog/group_9.315.799675651 YES

10 STANDBY

+DATA/devdb/onlinelog/group_10.274.799675653 NO

10 STANDBY

+FLASH/devdb/onlinelog/group_10.316.799675653 YES

20rowsselected.

SQL>select*fromv$standby_log;

GROUP#DBID THREAD# SEQUENCE# BYTES BLOCKSIZE

USEDARCSTATUS FIRST_CHANGE#FIRST_TIME NEXT_CHANGE#

NEXT_TIME LAST_CHANGE#LAST_TIME

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

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

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

5UNASSIGNED 1 0 52428800 512

0YESUNASSIGNED

6UNASSIGNED 1 0 52428800 512

0YESUNASSIGNED

7UNASSIGNED 1 0 52428800 512

0YESUNASSIGNED

8UNASSIGNED 2 0 52428800 512

0YESUNASSIGNED

9UNASSIGNED 2 0 52428800 512

0YESUNASSIGNED

10UNASSIGNED 2 0 52428800 512

0YESUNASSIGNED

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

6rowsselected.

SQL>

③ 主 库 修 改 相 关 参 数 standby_file_management 、 db_file_name_convert 、

log_file_name_convert:

修改前:

SQL>showparameterstandby_file

NAME TYPE VALUE

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

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

standby_file_management string MANUAL

SQL>showparameterdb_file_na

NAME TYPE VALUE

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

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

db_file_name_convert string

SQL>showparameterlog_file

NAME TYPE VALUE

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

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

log_file_name_convert string

SQL>

修改:

SQL>altersystemset

db_file_name_convert='+DATA/phydb/','+DATA/devdb/'sid='*'

scope=spfile;

Systemaltered.

SQL>showparameterdb_file_na

NAME TYPE VALUE

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

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

db_file_name_convert string

SQL>altersystemset

log_file_name_convert='+DATA/phydb/','+DATA/devdb/'sid='*'

scope=spfile;

Systemaltered.

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>

④ 停止 RAC 节点 2:

node2->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1812:25:352012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>setline300

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7384136MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

692948393DEVDB 7384136MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

SQL>shutdownimmediate;

Databaseclosed.

Databasedismounted.

ORACLEinstanceshutdown.

SQL>

⑤ RAC 节点 1 切换原 RAC 主库到备库:

node1->id

uid=1101(oracle)gid=1000(oinstall)

groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

node1->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1812:27:212012

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string devdb1

SQL>setline300

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7384658MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

SQL>

SQL>alterdatabasecommittoswitchovertophysicalstandbywith

sessionshutdown;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7384811MAXIMUMPERFORMANCE PHYSICAL

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

STANDBYYESREADWRITE RECOVERYNEEDED

SQL>

⑥ 切换原物理备库到主库角色:

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string phydb

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7404797MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADONLYWITHAPPLYSESSIONSACTIVE

SQL>

SQL>alterdatabasecommittoswitchovertoprimary;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 0MAXIMUMPERFORMANCE PRIMARY

YESMOUNTED NOTALLOWED

SQL>alterdatabaseopen;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7405254MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE FAILEDDESTINATION

SQL>

⑦ 将原 RAC 主库 2 个实例都启动到 MOUNT 状态:

node1->srvctlstartdatabase-ddevdb-omount

node1->exit

logout

[root@node1~]#su-oracle

node1->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1812:50:082012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>setline300

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7404796MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESMOUNTED RECOVERYNEEDED

692948393DEVDB 7404796MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESMOUNTED RECOVERYNEEDED

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>

⑧ 原 RAC 主库启动 redo apply:

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>

⑨ 原 RAC 主库停止 redo apply,并将 RAC 主库所有节点以 READ ONLY 打开:

SQL>alterdatabaserecovermanagedstandbydatabasecancel;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7407174MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESMOUNTED NOTALLOWED

692948393DEVDB 7407174MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESMOUNTED NOTALLOWED

SQL>alterdatabaseopen;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7407174MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESMOUNTED NOTALLOWED

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

692948393DEVDB 7407174MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADONLY NOTALLOWED

SQL>select

inst_id,dbid,name,current_scn,protection_mode,database_role,force_log

ging,open_mode,switchover_statusfromgv$database;

INST_ID DBIDNAME CURRENT_SCNPROTECTION_MODE

DATABASE_ROLE FOROPEN_MODE SWITCHOVER_STATUS

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

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

2 692948393DEVDB 7407706MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

1 692948393DEVDB 7407706MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

SQL>

2 12.2  单实例主库, RAC  备库角色切换

即,将新 RAC 备库切换为主库,新单实例主库切换为备库:

① 新主库(单实例库)状态查看:

dg->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1813:21:532012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

andRealApplicationTestingoptions

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string phydb

SQL>setline300

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7409960MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

SQL>

② 新备库(RAC 库)状态查看:

SQL>select

inst_id,dbid,name,current_scn,protection_mode,database_role,force_log

ging,open_mode,switchover_statusfromgv$database;

INST_ID DBIDNAME CURRENT_SCNPROTECTION_MODE

DATABASE_ROLE FOROPEN_MODE SWITCHOVER_STATUS

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

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

1 692948393DEVDB 7410081MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

2 692948393DEVDB 7410081MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

SQL>

③ 新备库(RAC 库)停止节点 2:

node2->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1813:24:402012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bit

Production

WiththePartitioning,RealApplicationClusters,AutomaticStorage

Management,OLAP,

DataMiningandRealApplicationTestingoptions

SQL>showparameterinstance_name

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

NAME TYPE VALUE

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

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

instance_name string devdb2

SQL>setline300

SQL>select

inst_id,dbid,name,current_scn,protection_mode,database_role,force_log

ging,open_mode,switchover_statusfromgv$database;

INST_ID DBIDNAME CURRENT_SCNPROTECTION_MODE

DATABASE_ROLE FOROPEN_MODE SWITCHOVER_STATUS

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

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

2 692948393DEVDB 7410177MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

1 692948393DEVDB 7410177MAXIMUMPERFORMANCE

PHYSICALSTANDBYYESREADONLYWITHAPPLYNOTALLOWED

SQL>shutdownimmediate;

Databaseclosed.

Databasedismounted.

ORACLEinstanceshutdown.

SQL>

④ 新主库(单实例库)切换到备库:

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string phydb

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7410498MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

SQL> alterdatabasecommittoswitchovertophysicalstandbywith

sessionshutdown;

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7410519MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADWRITE RECOVERYNEEDED

SQL>

⑤ 新备库(RAC 库)节点 1 切换到主库:

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string devdb1

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7430520MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADONLYWITHAPPLYTOPRIMARY

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>alterdatabasecommittoswitchovertoprimary;

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 0MAXIMUMPERFORMANCE PRIMARY

YESMOUNTED NOTALLOWED

SQL>

⑥ 新备库(RAC 库)全部启动所有节点:

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromgv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7434170MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

692948393DEVDB 7434170MAXIMUMPERFORMANCE PRIMARY

YESREADWRITE TOSTANDBY

SQL>

⑦ 新备库(单实例库)重新启动并开始 redo apply:

[root@dg~]#su-oracle

dg->sqlplus

SQL*Plus:Release11.2.0.3.0ProductiononSunNov1813:43:492012

Copyright(c)1982,2011,Oracle. Allrightsreserved.

Connectedtoanidleinstance.

SQL>startup

ORACLEinstancestarted.

TotalSystemGlobalArea 839282688bytes

FixedSize 2233000bytes

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

VariableSize 574623064bytes

DatabaseBuffers 255852544bytes

RedoBuffers 6574080bytes

Databasemounted.

Databaseopened.

SQL>showparameterinstance_name

NAME TYPE VALUE

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

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

instance_name string phydb

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7430520MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADONLY RECOVERYNEEDED

SQL>alterdatabaserecovermanagedstandbydatabaseusingcurrent

logfiledisconnectfromsession;

Databasealtered.

SQL>select

dbid,name,current_scn,protection_mode,database_role,force_logging,ope

n_mode,switchover_statusfromv$database;

DBIDNAME CURRENT_SCNPROTECTION_MODE DATABASE_ROLE

FOROPEN_MODE SWITCHOVER_STATUS

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

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

692948393DEVDB 7430523MAXIMUMPERFORMANCE PHYSICAL

STANDBYYESREADONLYWITHAPPLYNOTALLOWED

SQL>

至此,完成一次角色切换,即将新的备库(RAC 库)切换成主库,新的备库(单实例

库)又重新切换为物理备库,回到最初的状态!!!

Step by step Deploy Oracle 11gR2 RAC+Active Dataguard

QQ:908601287 Http://www.cnblogs.com/flymaster500.cn

3 13  补充说明与获取帮助

1 13.1  补充说明

文档说明:本实验文档是 Oracle 11gR2RAC+DG 的实验依据,所涉及内容较有难度、

相比较该实验应属于 Oracle 数据库领域高端的技术。因此对于 Oracle 数据库初学者而言,

有一定的难度和挑战,在完成本系列视频的学习和动手实验前,请务必认真阅读该文档!

软件说明:该系列实验的软件是目前Oracle 数据库的最新版本,11gR2 的 11.2.0.3.0 版

本,该软件需要 Metalink 账号才可以下载到,对于目前无法获取该软件(11.2.0.3.0 版本)

的学员,可以直接到 oracle 官网免费获取 11.2.0.1.0 的软件来完成该实验。

错误说明:在搭建 RAC 数据库的过程中,要注意准备工作充分,尤其是配置 ASM共

享存储那一部分、以及 grid/oracle 用户的权限和对等性问题。在配置物理备库的过程中,备

库恢复控制文件时,要在物理备库上查看你的 oracle 用户是否属于 asmadmin 用户组。

实验说明:在动手完成实验时,要遵循实验步骤,一次不成功,要反复多实验几次,出

现错误的过程中,注意查看错误信息和日志,定位错误原因,解决问题。

2 13.2  获取帮助

对于在完成该系列实验过程中遇到故障的学员,可以通过 QQ: 155166225,Mail:

3dian14@gmail.com 联系我,或者直接加入 Rock Oracle 群: 6 280889316 获取帮助。

3 13.3  致谢

最后,在这里要由衷的感谢广大网友对于我的信任和厚爱,让我们一起 Rock Oracle 吧!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!