Oracle 11g RAC安装与配置for Linux

更新时间:2023-12-22 03:27:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

软件安装与配置 Orace 11g RAC安装与配置 for RedHat Linux 6.2

公司: 作者:

创建日期:2012-09-14 修改日期:2012-09-14 版本:1.0 参考文档

文档控制

修改记录

日期 2012-09-14 作者 版本 1.0 审阅

日期 姓名 职位 分发

拷贝 1 2 3

姓名 单位 智业

文档控制.......................................................................................................................................... II 前言 .................................................................................................................................................. 1 读者 .................................................................................................................................................. 1 文档结构........................................................................................................................................... 1 第一部分:Oracle Grid Infrastructure 安装 ................................................................................... 1

一、 Grid Infrastructure典型安装过程 ............................................................................ 1

1. 典型安装与高级安装 ............................................................................................... 1 2. 典型安装准备 ........................................................................................................... 1 3. 安装准备所必须的手动任务 ................................................................................... 2 4. 安装Gird infrastructure ............................................................................................ 3 二、 群集准备-Gird infrastructure高级安装 ................................................................... 4

1. Linux操作系统准备 ................................................................................................ 4 2. 安装fixup脚本(可选) ........................................................................................ 4 3. 建立组、用户和路径 ............................................................................................... 4 4. 检查硬件要求 ........................................................................................................... 5 5. 确认软件要求 ........................................................................................................... 9 6. 检查软件需求 ......................................................................................................... 12 7. 校验和设置UDP和TCP内核参数 ...................................................................... 13 8. NTP配置 ................................................................................................................ 13 9. 安装cvuqdisk包 .................................................................................................... 15 10. 使能Intelligent Platform Management Interface (IPMI) ................................... 15 11. 在安装期间自动配置SSH ................................................................................ 15 12. 配置Grid Infrastructure Software Owner用户环境 .......................................... 15 13. 建立必须的目录 ................................................................................................. 17 14. 群集名要求 ......................................................................................................... 17 三、 为Cluster and Oracle Real Application Clusters (Oracle RAC)安装Grid Infrastructure配置存储 .......................................................................................................... 17

1. Oracle Clusterware and Oracle RAC存储选项综述 ............................................. 17 2. 了解ACFS .............................................................................................................. 17 3. 支持的存储选项 ..................................................................................................... 17 4. 共享文件系统配置 ................................................................................................. 18 5. 检查软件需求 ......................................................................................................... 21 6. 建立必须的操作系统组和用户 ............................................................................. 24 7. 在所有节点配置SSH(可选)............................................................................. 25 8. 配置Configuring Shell Limits, System Configuration和 Network Tuning Parameters ....................................................................................................................... 27 9. 配置Oracle用户环境 ............................................................................................ 28 10. 检查硬件需求 ..................................................................................................... 29 11. 检查网络硬件需求 ............................................................................................. 29 12. NFS所需网络参数 ............................................................................................ 29 13. IP地址需求 ........................................................................................................ 29 14. 检查网络安装 ..................................................................................................... 30 15. 使用CVU检查操作系统安装与硬件 .............................................................. 30

16. 标识必须的软件目录 ......................................................................................... 30 17. 标识已存在的Oracle Base目录 ....................................................................... 30 四、 配置Oracle Clusterware和Oracle Database存储 ................................................ 31

1. Orale cluster,database,recovery文件存储选项 ................................................ 31 2. 存储选择指导方针 ................................................................................................. 31 3. 建立必须的目录 ..................................................................................................... 31 4. 选择磁盘文件系统后的检查 ................................................................................. 32 5. 使用共享文件系统配置Oracle Cluster存储 ........................................................ 32 6. 使用RAW设备配置Oracle Clusterware文件 ..................................................... 33 7. 使用RAW LV设备配置Oracle Clusterware文件 ............................................... 34 8. 为ASM配置磁盘 .................................................................................................. 37 9. 使用已存在的ASM磁盘组 .................................................................................. 38 10. 为ASM配置磁盘 .............................................................................................. 38 11. 为数据库文件在RAW上配置磁盘 .................................................................. 39

第三部分:安装Oracle Clusterware 和 Oracle Real Application Clusters ................................ 41

五、 安装Oracle Clusterware ......................................................................................... 41

1. 使用CVU检查Oracle Clusterware要求.............................................................. 41 2. 使用OUI安装前准备 ............................................................................................ 42 3. 使用OUI安装Oracle Clusterware ........................................................................ 43 4. 安装后格式化OCFS .............................................................................................. 43 六、 安装Oracle 10g Real Application Clusters ............................................................ 43

1. 使用CVU校验数据库安装准备状态 .................................................................. 43 2. 运行DBCA,选择数据库配置类型 ..................................................................... 44 3. 使用OUI安装Oracle database 10g步骤 ............................................................. 44 4. 在Windows 平台上的最小内存需求 ................................................................... 44 5. 卸载RAC软件 ...................................................................................................... 44 6. 从Windows环境删除Oracle Clusterware ............................................................ 45 7. 卸载Oracle Clusterware并降级到9.2 .................................................................. 45 8. 卸载ASM ............................................................................................................... 46 七、 使用DBCA建立RAC数据库.............................................................................. 46

1. 在Oracle Real Applicaton Clusters上使用DBCA ............................................... 46 2. RAC高可用性服务................................................................................................ 46 八、 安装之后操作 ......................................................................................................... 47

1. 必须的操作 ............................................................................................................. 47 2. 推荐操作 ................................................................................................................. 47

第四部分 Real Application Clusters Environment 配置 .............................................................. 48

九、 RAC 数据库参数管理 ........................................................................................... 48

1. 参数文件与RAC.................................................................................................... 48 2. 在Oracle RAC中使用SPFILE ............................................................................. 48 3. RAC中参数文件搜索顺序 .................................................................................... 48 十、 了解已安装RAC的配置 ....................................................................................... 48

1. 了解RAC配置环境............................................................................................... 48 2. 什么是OCR ........................................................................................................... 49 3. 使用DBCA建立数据库组件 ................................................................................ 49

第五部分 Oracle Clusterware与Oracle RAC安装参考信息 ..................................................... 54

附录A:安装过程中的疑难解答 ......................................................................................... 54

1. Oracle Cluster与RAC安装疑难解答 .................................................................. 54 附录B:使用脚本建立RAC数据库 ................................................................................... 54

1. 使用脚本建立RAC数据库 ................................................................................... 54 附录D:从一个单实例数据库转换到RAC群集 ............................................................... 55

1. 转换的先决条件 ..................................................................................................... 55 2. 从单实例转换到RAC ............................................................................................ 55 3. Cluser上的单实例到RAC .................................................................................... 56 附录E:RAC环境的目录结构 ............................................................................................ 57 附录F:如何处理一个已存在的RAC数据库 ................................................................... 57

1. 备份RAC数据库................................................................................................... 57 2. 关闭RAC数据库................................................................................................... 58

前言

Oracle 11g RAC 安装与配置 for Linux

读者

此配置手册供以下读者使用:

? 智业软件

文档结构

第一部分:Oracle Grid Infrastructure安装

第二部分:Oracle Clusterware与Oracle Real Application Clusters安装前准备规程 第三部分:安装Oracle Clusterware与Oracle Real Application Clusters 第四部分:Oracle Real Application Clusters环境配置

第五部分:Oracle Clusterware与Oracle Real Application Clusters参考资料

第一部分:Oracle Grid Infrastructure 安装

一、 Grid Infrastructure典型安装过程 1. 典型安装与高级安装

? 典型安装最小化安装选项,Oracle推荐大多数群集可以使用此类安装。

? 高级安装可以对存储,网络,操作系统组权限,ASM角色等进行更多更细粒度的

定制。

2. 典型安装准备

安装执行脚本:在使用11.2OUI安装时,会自动生成runfixup.sql脚本,运行此脚本完成必须的安装准备的必要任务。

runfixup.sql脚本在安装过程中生成,使用root身份运行,它执行以下任务: ? 设置内核参数;

? 为Oracle 产品目录和系统权限配置安装Owner的主要组与次要组; ? 设置shell权限

3. 安装准备所必须的手动任务

1.1 校验必须系统配置

内存空间:至少2GB

grep MemTotal /proc/meminfo

交换攻击:等于内存,或是内存的2倍

grep SwapTotal /proc/meminfo 磁盘空间:至少2G的共享磁盘空间存储群集共享文件,至少6.5GB的磁盘空间存储Grid infrastructure安装文件

df –h

临时空间:至少1GB df -h /tmp 1.2 检查网络要求

? Single Client Access Name (SCAN):为群集使用的单一的客户访问名称

? IP Address Requirements:至少配置两个接口,一个用于私有网络,一个用于公

有网络

? 每节点配置一个公有IP地址:

静态IP地址

在安装前配置完成可用

公有IP,虚拟IP,SCAN IP地址在同一个子网内

? 每节点配置一个虚拟IP

静态IP地址

在安装配置前可用

公有IP,虚拟IP,SCAN IP地址在同一个子网内

? SCAN IP

使用DNS在安装之前配置3个静态IP地址,三个IP地址关联SCAN名,并且有DNS提供随机访问 在安装前配置DNS解析

配置一个SCAN名,不能以数字开头

与公有IP,虚拟IP,SCAN IP地址在同一个子网内 符合RFC 952标准,可以使用“-”,不能使用“_”

? 每节点配置一个私有IP

静态IP地址

一个独立的私有子网,仅可被其他群集成员访问

? 冗余互联

在早期的版本,冗余互联只能使用bonding,trunking,teaming等类似的技术实现。从11.2.0.2 开始Oracle可以直接实现冗余互联,不需要其它技术。内部冗余可以使用多大4个私有网络实现 ? 网络接口规划

在安装过程中确认每个网络接口是公有,私有还是不使用。

冗余互联不能用户公有接口,如果需要高可用或负载均衡使用第三方解决方案,

如:bonding,trunking,teaming等类似的技术 冗余互联可用于私有网络

1.3 检查操作系统包 1.4 建立组和用户

groupadd -g 1000 oinstall groudadd –g 1031 dba

useradd –u 1101 –g ointall –G dba oracle mkdir –p /u01/app/11.2.0/grid mkdir –p /u01/app/oracle

chown –R oracle:oinstall /u01 chmd –R 775 /u01/

1.5 检查存储

在Oracle ASM中应该足够的空间放置Oracle Clusterware files (voting disks and Oracle Cluster Registries), and for Oracle Database files。新的Oracle Clusterware files不在支持块或raw设备。 1.6 ASM存储准备

安装ASMLIB PRMs简化存储管理,ASMLIB为Oracle ASM使用的存储设备提供固定的路径和权限,消除设备文件的影响。 ASMLIB 2.0包含以下3个LINUX包 oracleasmlib-2.0 - the Oracle ASM libraries

oracleasm-support-2.0 - utilities needed to administer ASMLib oracleasm - a kernel module for the Oracle ASM library

1.7 使用Oracle Unbreakable Linux Network (ULN)时可自动安装ASMLIB

up2date -i oracleasm-support oracleasmlib oracleasm-'uname -r'

1.8 手动安装ASMLIB

1.8.1 确认正确的ASMLIB包 uname –rm

1.8.2 下载并安装ASMLIB包

http://www.oracle.com/technetwork/server-storage/linux/downloads/index-088143.html

1.8.3 配置ASMLIB包 oracleasm configure –i #不带-i时显示当前配置 1.9 标记ASM候选盘

oracleasm createdisk ASM_DISK_NAME candidate_disk 例:oracleasm createdisk data1 /dev/sdb

4. 安装Gird infrastructure

./runInstaller

二、 群集准备-Gird infrastructure高级安装

本节描述了为使用群集安装Gird infrastructure,在开始OUI之前所必须完成的配置任

务。

1. Linux操作系统准备

1.1 最小限度安装Linux:

如果安装ULN使用up2date校验最小Linux安装包,如果安装RHN下载http://oss.oracle.com/el5/oracle-validated/工具校验最小Linux安装包。 Oracle安装必须使用SSH,检查SSH是否安装 rpm -qa |grep ssh

1.2 使用默认方式安装Linux

如果没有Oracle校验工具那么建议是用默认的Linux安装,这个安装将会安装大多数必须的包,并检查他们的相关性。

1.3 关于Oracle Validated Configuration RPM工具(可选)

? 自动安装Oracle需要的附加包 ? 建立Oracle用户和组 ? 设置并校验sysctl.conf

1.4 为ULN安装Oracle Validated Configuration RPM(可选)

up2date --nox --show-channels up2date --install oracle-validated

2. 安装fixup脚本(可选)

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

3. 建立组、用户和路径

1.5 确定Oracle inventory和Oracle Inventory 组是否存在

more /etc/oraInst.loc grep oinstall /etc/group

1.6 建立Oracle Inventory组(当不存在时)

/usr/sbin/groupadd -g 1000 oinstall

1.7 建立Oracle Inventory用户

当Oracle software Owner不存在或是Oracle software Owner但是想使用独立的用户安装Grid Infrastrusture时需要创建Oracle Inventory用户

1.8 确定Oracle Software软件安装目录是否存在

id oracle

1.9 为Grid Infrestructure建立或修改Oracle Software Owner

1.9.1 建立gird owner

/usr/sbin/useradd –u 1100 –g ointalll –G dba grid

usermod –u 1001 –g 1000 –G 1000,1001 oracle

1.9.2 设置grid密码

passwd grid

1.10 建立Oracle Base目录

# mkdir -p /u01/app/11.2.0/grid # mkdir -p /u01/app/grid # mkdir -p /u01/app/oracle

# chown grid:oinstall /u01/app/11.2.0/grid # chown grid:oinstall /u01/app/grid # chown oracle:oinstall /u01/app/oracle # chmod -R 775 /u01/

# chown -R grid:oinstall /u01

1.11 如何分配不同的权限组

dba:组成员具有sysdba权限 oper:组成员具有sysoper权限

asmadmin:组成员具有sysasm权限,用于管理asm实例 asmdba:组成员具有asm权限,用于安装与管理asm文件 asmoper:组成员具有asmoper权限

1.12 建立不同的权限组(完整的创建组、用户和安装目录)

# groupadd -g 1000 oinstall # groupadd -g 1020 asmadmin # groupadd -g 1021 asmdba # groupadd -g 1031 dba # groupadd -g 1022 asmoper

# useradd -u 1100 -g oinstall -G asmadmin,asmdba grid # useradd -u 1101 -g oinstall -G dba1,asmdba oracle # mkdir -p /u01/app/11.2.0/grid # mkdir -p /uo1/app/grid # chown -R grid:oinstall /u01 # mkdir -p /u01/app/oracle1

# chown oracle1:oinstall /u01/app/oracle1 # mkdir -p /u01/app/oracle2

# chown oracle2:oinstall /u01/app/oracle2 # chmod -R 775 /u01

4. 检查硬件要求

1.1 常规服务器要求

? 服务器必须有相同的体系结构,32-bit或64-bit ? 确保服务器运行在level 3或level 5

? 确保服务器运行在相同的operating system bianry

1.2 服务器硬件要求

为了OUI正常的显示,至少1024*768的分辨率 1GB的/tmp临时空间

6.5GB的grid Infrastructure存储空间

x86平台需要4GB的数据库存储空间,x64平台4.6GB存储空间

1.3 服务器内存要求 Available RAM Between 2 GB and 8 GB Between 8 GB and 32 GB More than 32 GB Swap Space Required 2 times the size of RAM 1.5 times the size of RAM 32 GB of RAM

1.4 检查服务器硬件和内存配置

grep MemTotal /proc/meminfo #检查内存 grep SwapTotal /proc/meminfo #检查交换空间 df -k /tmp #检查临时空间

free #检查空闲的内存交换空间 uname –m #检查操作系统体系结构

1.5 检查网络要求

1.5.1 网络硬件要求

? 每个节点至少2块网卡,一块用于公有网络,一块用于私有网络。

但使用冗余互联时,可以定义多块网卡用于私有网络,Oracle群集件建立1-4个高可用的IP地址,Oracle RAC和ASM能够使用这些地址确保节点间的高可用性和负载均衡通信。

? 默认情况下Oracle使用所有的HAIP地址用于私有网络通信, ? 如果使用第三方技术为公有网络配置多个接口,那么必须为联合接

口指定单一的接口名称。

? 安装RAC是所有节点的网络接口必须相同,如:节点一的公有网

络使用eht0,那么节点二的公有网络也必须使用eth0 ? 每个节点公有网络必须支持TCP/IP

? 对于私有网络必须支持UDP,并至少为1G ethernet。私有网络应使

用交换机连接

? 每个节点的私有接口互联必须处于同一子网 ? 所有分配的互联接口必须完全可达

1.5.2 IP地址要求

1.5.2.1 有两种方式配置IP地址:

一、 使用Grid Naming Service(GNS)动态配置IP地址,当使用这

种方式是,分配静态IP地址给主机名,分配动态IP地址给群集VIP。因此必须具备一台DHCP服务器,以及至少包含每个节点1个IP地址,3个IP地址给SCAN的地址池。

二、 使用静态分配IP地址,对于主机名和VIP都使用静态IP,并

通过DNS或HOSTS文件解析。 注:Oracle only supports DHCP-assigned networks for the default network, not for any subsequent networks

1.5.2.2 手工配置IP地址

? 每节点配置一个公有IP地址:

静态IP地址

在安装前配置完成可用

公有IP,虚拟IP,SCAN IP地址在同一个子网内

? 每节点配置一个虚拟IP

静态IP地址

在安装配置前可用

公有IP,虚拟IP,SCAN IP地址在同一个子网内

? SCAN IP

使用DNS在安装之前配置3个静态IP地址,三个IP地址关联SCAN名,并且有DNS提供随机访问 在安装前配置DNS解析

配置一个SCAN名,不能以数字开头

与公有IP,虚拟IP,SCAN IP地址在同一个子网内 符合RFC 952标准,可以使用“-”,不能使用“_”

? 每节点配置一个私有IP

静态IP地址

一个独立的私有子网,仅可被其他群集成员访问

1.5.2.3 SCAN配置

? 使用SCAN能够灵活的增加删除节点,而不需要修改客户端配置 ? SCAN支持DNS和HOSTS文件,但是推荐使用DNS,使用HOSTS

文件时,SCAN只能使用单一IP地址配置

1.5.3 Oracle Grid Infrastructure必须Broadcast communications (ARP and UDP)支

持,不论公有网络还是私有网络(11.2.0.2后)

1.5.4 Oracle Grid Infrastructure必须Multicast Requirements支持,对于私有网络

(11.2.0.2后)

1.5.5 为GNS配置DNS委托

1.5.5.1 在DNS建立GNS虚拟IP

mycluster-gns.example.com A 192.0.2.1

1.5.5.2 配置GNS子域转发

cluster01.example.com NS mycluster-gns.example.com

1.5.5.3 在群集节点上配置resolve.conf域名解析服务器

options attempts: 2 options timeout: 1

search cluster01.example.com example.com nameserver xxx.xxx.xxx.42 nameserver xxx.xxx.xxx.15

1.5.5.4 在/etc/nsswitch.conf配置名称解析的顺序,由于SCAN使用NIS可能存

在问题,因此Oracle建议NIS放置到最后

hosts: files dns nis

1.6 GNS配置例子 Identity GNS VIP Home Node None Host Node Selected by Oracle Given Name Type Address 192.0.2.1 Address Assigned By Fixed by net Resolved By DNS mycluster-gns.examplevirtual

Identity Home Node Host Node Clusterware Given Name .com node1 node1-vip node1-priv node2 node2-vip node2-priv Type Address Address Assigned By administrator Resolved By Node 1 Public Node 1 VIP Node 1 Private Node 2 Public Node 2 VIP Node 2 Private SCAN VIP 1 SCAN VIP 2 SCAN VIP 3 Node 1 node1 Node 1 Selected by Oracle Clusterware Node 1 node1 Node 2 node2 Node 2 Selected by Oracle Clusterware Node 2 node2 none none none Selected by Oracle Clusterware Selected by Oracle Clusterware Selected by Oracle Clusterware Public 192.0.2.101 Fixed GNS GNS GNS GNS GNS GNS GNS GNS GNS Virtual 192.0.2.104 DHCP Private 192.168.0.1 Fixed or DHCP Public 192.0.2.102 Fixed Virtual 192.0.2.105 DHCP Private 192.168.0.2 Fixed or DHCP 192.0.2.201 DHCP 192.0.2.202 DHCP 192.0.2.203 DHCP mycluster-scan.cluster0virtual 1.example.com mycluster-scan.cluster0virtual 1.example.com mycluster-scan.cluster0virtual 1.example.com

1.7 手工配置IP地址例子 Identity Home Node Host Node Given Name node1 node1-vip node1-priv node2 node2-vip node2-priv Type Public Address Address Assigned By Resolved By DNS DNS and hosts file DNS and hosts file, or none DNS DNS and hosts file DNS and hosts file, or none DNS DNS Node 1 Public Node 1 node1 Node 1 VIP Node 1 Selected by Oracle Clusterware 192.0.2.101 Fixed Virtual 192.0.2.104 Fixed Private 192.168.0.1 Fixed Public 192.0.2.102 Fixed Node 1 Private Node 1 node1 Node 2 Public Node 2 node2 Node 2 VIP Node 2 Selected by Oracle Clusterware Virtual 192.0.2.105 Fixed Private 192.168.0.2 Fixed 192.0.2.201 Fixed 192.0.2.202 Fixed Node 2 Private Node 2 node2 SCAN VIP 1 SCAN VIP 2 none none Selected by Oracle Clusterware Selected by Oracle mycluster-scan virtual mycluster-scan virtual

Identity Home Node Host Node Clusterware Given Name Type Address Address Assigned By Resolved By SCAN VIP 3 none Selected by Oracle Clusterware mycluster-scan virtual 192.0.2.203 Fixed DNS 1.8 配置多个私有互联接口

? 在2.6.31以上内核的LINUX使用多块NIC做内部互联是存在bug,必

须配置rp_filter参数解决这个问题。

? rp_filter 设置 Reverse Path filter为 no filtering (0), to strict filtering (1), or

to loose filtering (2)。私有内部网络必须设置成0或2 。公有网络可以设置成1。在/dev/sysctl.conf中配置 net.ipv4.conf.eth2.rp_filter = 2 net.ipv4.conf.eth1.rp_filter = 2 net.ipv4.conf.eth0.rp_filter = 1

1.9 Name Service Cache Daemon (nscd)

为了使群集更好的处理网络失败,是能nscd。

1.9.1 检查nscd启动配置,nscd应该运行在level 3和5

# chkconfig --list nscd

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

1.9.2 设置nscd启动配置

On Red Hat and Oracle Linux 4 and 5: # chkconfig --level 35 nscd on On SUSE SLES10 and11:

# chkconfig --level 35 nscd on

1.9.3 启动nscd

service nscd start|restard

5. 确认软件要求

1.10 LINUX发行版要求 Linux Distribution Asianux Distributions Oracle Linux Distributions Requirements ? Asianux Server 3, Service Pack 2 (SP2) Oracle Linux 4 Update 7, kernel 2.6.9 or later Oracle Linux 5 Update 2, kernel 2.6.18 or later (compatible with Red Hat Enterprise kernel) Oracle Linux 5 Update 5, with the Unbreakable Enterprise Kernel for Linux, kernel 2.6.32-100.0.19 or later Red Hat Enterprise Linux 4 Update 7, kernel 2.6.9 or later ? ? ? Red Hat Enterprise Linux

?

Linux Distribution Distributions Requirements ? ? Red Hat Enterprise Linux 5 Update 2, kernel 2.6.18 or later Red Hat Enterprise Linux 5, Update 5, with the Unbreakable Enterprise Kernel for Linux, 2.6.32 or later SUSE 10, kernel 2.6.16.21 or later SUSE 11, kernel 2.6.27.19 or later SUSE Enterprise Linux Distributions ? ?

1.11 Grid Infrastructure与RAC必须的安装包 Oracle Linux 5 Update 5 with Unbreakable Enterprise Kernel (2.6.32-100.0.19 or later) Subscribe to the Oracle Linux 5 channel on the Unbreakable Linux Network, and then install the Oracle Validated RPM. This installs the Oracle Unbreakable Enterprise Kernel for Linux, and all required kernel packages for Oracle Grid Infrastructure and Oracle Database installations. Asianux Server 3, Oracle The following packages (or later versions) must be installed: Linux 5, Update 2, and Red Hat Enterprise Linux Note: Starting with Oracle Grid Infrastructure 11g release 2 patchset 1 (11.2.0.2), all the 32-bit packages listed in the following table, except for 5 Update 2 gcc-32bit-4.3, are no longer required for installation. Only the 64-bit packages are required. However, for Oracle 11g release 2 (11.2.0.1), both the 32-bit and 64-bit packages listed in the following table are required. binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-2.5-24 (32 bit) glibc-common-2.5 glibc-devel-2.5 glibc-devel-2.5 (32 bit) glibc-headers-2.5 ksh-20060214 libaio-0.3.106 libaio-0.3.106 (32 bit) libaio-devel-0.3.106 libaio-devel-0.3.106 (32 bit) libgcc-4.1.2 libgcc-4.1.2 (32 bit) libstdc++-4.1.2

libstdc++-4.1.2 (32 bit) libstdc++-devel 4.1.2 make-3.81 sysstat-7.0.2 unixODBC-2.2.11 unixODBC-2.2.11 (32 bit) unixODBC-devel-2.2.11 unixODBC-devel-2.2.11 (32 bit)

1.12 Oracle数据库所需包 LDAP package If you did not perform a default Linux installation, you intend to use LDAP, and you want to use the scripts odisrvreg, oidca, or schemasync, then install the Korn shell RPM for your Linux distribution. Intel C/C++ Compiler 10.1 or later and the version of GNU C and C++ compilers listed previously for the distribution are supported for use with these products. Note: Intel C/C++ Compiler v10.1 can be used only with the standard template libraries in the supported gcc versions to build Oracle C++ Call Interface (OCCI) applications. Oracle XML Developer's Kit is supported with the same compilers as OCCI. Pluggable Authentication Modules for Linux (Linux PAM) Oracle ODBC Drivers Install the latest Linux PAM (Pluggable Authentication Modules for Linux) library for your Linux distribution. PAM provides greater flexibility for system administrators to choose how applications authenticate users. On Linux, external scheduler jobs require PAM. If you intend to use Open Database Connectivity (ODBC), then you should install the most recent ODBC Driver Manager for Linux. You should obtain the most current ODBC driver from your operating system vendor. You can read about ODBC at the following URL: http://www.unixodbc.org The ODBC RPMs are only needed if you plan on using ODBC. If you do not plan to use ODBC, then you do not need to install the ODBC RPMs for Oracle Clusterware, Oracle ASM, or Oracle RAC. To use ODBC, you must also install the following additional 32-bit ODBC RPMs, depending on your operating system: Oracle Linux 4, and Red Hat Enterprise Linux 4: unixODBC-2.2.11 (32 bit) or later

Pro*C/C++, Oracle Call Interface, Oracle C++ Call Interface, Oracle XML Developer's Kit (XDK)

unixODBC-devel-2.2.11 (32 bit) or later Asianux Server 3, Oracle Linux 5, and Red Hat Enterprise Linux 5: unixODBC-2.2.11 (32 bit) or later unixODBC-devel-2.2.11 (32 bit) or later Oracle JDBC/OCI Drivers You can use the following optional JDK version with the Oracle JDBC/OCI drivers; however, it is not required for the installation: ? ? JDK 6 Update 10 (Java SE Development Kit 1.6.0_21) JDK 1.5.0-24 (JDK 5.0) with the JNDI extension Note: By default, JDK 1.5 is installed with this release. Oracle Real Application Clusters For a cluster file system, use the following option: OCFS2 ? Version 1.2.9 or later To check your OCFS version, enter the following command: modinfo ocfs2 To check the version of OCFS2 tools and OCFS2 console, enter the following command: rpm -qa| grep ocfs2 Ensure that ocfs2console and ocfs2-tools are at least version 1.2.7 For information about OCFS2, refer to the following Web site: http://oss.oracle.com/projects/ocfs2/ For OCFS2 certification status, refer to the Certify page on My Oracle Support. http://oss.oracle.com/projects/ocfs2/ For OCFS2 certification status, refer to the Certify page on My Oracle Support.

6. 检查软件需求

1.13 确认Linux发行版

cat /proc/version

1.14 确认内核版本

uname -r

1.15 查询安装包

rpm -q binutils

rpm -q compat-libstdc++ rpm -1 elfutils rpm -q gcc rpm -q glibc rpm -q ksh rpm -q libaio rpm -q libgcc rpm -q libstdc++ rpm -q make rpm -q sysstat rpm -q unixODBC

1.16 查看OCFS是否安装

/sbin/modinfo ocfs2 如果没有则下载安装一个 http://oss.oracle.com/projects/ocfs2/

7. 校验和设置UDP和TCP内核参数

1.17 查看参数

cat /proc/sys/net/ipv4/ip_local_port_range

1.18 配置/etc/sysctl.conf

net.ipv4.ip_local_port_range = 9000 65500

1.19 重启网络

/etc/rc.d/init.d/network restart

8. NTP配置

1.20 可以使用群集同步时间服务代替NTP,当群集发NTP协议没有启用时,群集会自

动使用时间同步。停止时间同步服务步骤如下:

# /sbin/service ntpd stop # chkconfig ntpd off

# mv /etc/ntp.conf /etc/ntp.conf.org.

1.21 如果使用群集时间同步,执行如下命令检查

crsctl check ctss

1.22 如果使用NTP,那么增加-x参数,防止时间回退

? 编辑文件/etc/sysconfig/ntpd

# Drop root to id 'ntp:ntp' by default.

OPTIONS=\

# Set to 'yes' to sync hw clock after successful ntpdate

SYNC_HWCLOCK=no

# Additional options for ntpdate NTPDATE_OPTIONS=\ ? 重新启动 NTP service.

# /sbin/service ntp restart

1.23 配置NTP

1.23.1 linux硬件时间设置

? 默认情况下Linux运行使用的是CPU tick,不会获取BIOS里面存的系

统时间,在系统开机时会自动从BIOS里面获取。 ? 系统时间可以用date设置:date –set ―月/日/年时:分:秒‖ ? 硬件时间使用clock和hwclock设置:

hwclock –show 显示硬件时间

hwclock –set –date=―月/日/年时:分:秒‖ ? 将系统时间写入硬件时间

hwclock –systohc hwclock -w

? 将硬件时间写入系统时间

hwclock –hctosys hwclock –s

1.23.2 不同机器间时间同步,在配置NTP服务前首先使用ntpdate同步机器间的

时间,因为时间差异过大时NTP不会同步 ntpdate hostname

1.23.3 配置NTP

1.23.3.1 配置/etc/ntp.conf文件

配置权限

restrict default nomodify notrap noquery # 关闭所有的 NTP 要求封包 restrict 127.0.0.1 #这是允许本级查询

restrict 192.168.0.0 mask 255.255.255.0 nomodify

#在192.168.0.0/24网段内的服务器就可以通过这台NTP Server进行时间同步了

server 0.pool.ntp.org

server 1.pool.ntp.org server 2.pool.ntp.org

server 127.127.1.0 # 本地时间,在NTP服务端配置

fudge 127.127.1.0 stratum 10 # 本地时间,在NTP服务端配置 server 192.168.0.1 # 远程主机,在NTP客户端配置

fudge 192.168.0.1 stratum 10 # 远程主机,在NTP客户端配置 driftfile /var/lib/ntp/drift #用于保存漂移时间 1.23.3.2 启动NTP服务

service ntpd start 或 /etc/init.d/ntpd start

1.23.3.3 查看端口确认是否启动NTP

netstat –in | grep 123

1.23.3.4 查看NTP与上层主机同步情况:ntpstat

1.23.3.5 查看NTP与上层主机的关系:ntptrace –n 127.0.0.1

1.23.3.6 查看NTP与上层主机的状态ntpq -p

9. 安装cvuqdisk包

cvuqdisk用于CVU查找共享磁盘,在grid_home/grid目录下 1.24 查看是否安装cvuqdisk

rpm -qi cvuqdisk

1.25 如果安装,卸载cvuqdisk

rpm -e cvuqdisk

1.26 配置环境变量

CVUQDISK_GRP=oinstall; export CVUQDISK_GRP

1.27 安装包

rpm -iv package

10. 使能Intelligent Platform Management Interface (IPMI)

IPMI提供监视系统硬件和固件的接口

安装见Oracle Clusterware Administration and Deployment Guide

11. 在安装期间自动配置SSH

如果没有配置其它认证方式,在安装期间Oracle可以自动配置SSH

12. 配置Grid Infrastructure Software Owner用户环境

1.28 Grid Infrastructure Software Owner环境要求

设置software owner用户(grid,oracle)的umask为022,确保建立文件的权限是644。

设置software owner用户(grid,oracle)处理器权限为ulimit 设置DISPLAY环境变量

1.29 配置Grid Infrastructure Software Owner用户环境

1.29.1 设置主机显示权限

xhost + 主机名

1.29.2 登录安装目录确认默认shell

su – grid

eche $SHELL

1.29.3 编辑shell启动文件

Bash shell (bash): $ vi .bash_profile

Bourne shell (sh) or Korn shell (ksh): $ vi .profile

C shell (csh or tcsh): % vi .login

1.29.4 在启动文件中增加 umask 022

1.29.5 如果不是在本地安装增加DISPLAY变量

export DISPLAY=curstom_name:0.0

1.29.6 如果/tmp空间小于1GB,配置TEMP和TMPDIR环境变量替换默认临时

空间

$ TEMP=/mount_point/tmp $ TMPDIR=/mount_point/tmp $ export TEMP TMPDIR

1.30 校验环境

umask env | more

1.31 检查资源限制,确保显示值在推荐范围内

1.31.1 文件句柄限制

$ ulimit -Sn 1024

$ ulimit -Hn 65536

1.31.2 进程限制

$ ulimit -Su 2047

$ ulimit -Hu 16384

1.31.3 堆栈限制

$ ulimit -Ss 10240

$ ulimit -Hs 32768

1.32 设置X11转发

为了防止X11转发导致的安装失败,增加并配置~/.ssh/config文件 Host *

ForwardX11 no

1.33 消除终端输出命令导致的错误

Bourne, Bash, or Korn shell: if [ -t 0 ]; then stty intr ^C fi

C shell: test -t 0

if ($status == 0) then stty intr ^C

endif

13. 建立必须的目录

# mkdir -p /u01/app/11.2.0/grid

# chown grid:oinstall /u01/app/11.2.0/grid # chmod -R 775 /u01/app/11.2.0/grid # mkdir -p /u01/app/oracle

# chown -R oracle:oinstall /u01/app/oracle # chmod -R 775 /u01/app/oracle

14. 群集名要求

群集名必须少于15字符

三、 为Cluster and Oracle Real Application Clusters

(Oracle RAC)安装Grid Infrastructure配置存储

1. Oracle Clusterware and Oracle RAC存储选项综述

有两种方式支持Oracle群集文件:Oracle Clusterware files (Oracle Cluster Registry

and voting disk files)能存储在Oracle ASM上。也能存放在一个共享文件系统上,如NFS。对于IBM linux或system z,能够使用块设备,但是不能使用ACFS和OCFS

2. 了解ACFS

Oracle Automatic Storage Management Cluster File System (Oracle ACFS)用于存储Oracle执行文件,但是不能用于存储数据文件和群集文件。

3. 支持的存储选项

OCR and Oracle Oracle Voting Clusterware RAC Disk Files binaries binaries No No Oracle Database Files Yes Oracle Recovery Files Yes Storage Option Oracle Automatic Storage Management Yes

Storage Option (Oracle ASM) Note: Loopback devices are not supported for use with Oracle ASM OCR and Oracle Oracle Voting Clusterware RAC Disk Files binaries binaries Oracle Database Files Oracle Recovery Files Oracle Automatic Storage Management No Cluster File System (Oracle ACFS) Local file system No No Yes Yes Yes Yes Yes No No Yes No No Yes NFS file system on a certified NAS filer Yes Note: Direct NFS does not support Oracle Clusterware files. Shared disk partitions (block devices or No raw devices) 注一 No No No 注一. No 注一:Not supported by OUI or ASMCA, but supported by the software. They can be added or removed after installation

4. 共享文件系统配置

1.1 群集文件文件系统所需尺寸 File Types Stored Voting disks with external redundancy Number Volumes 3 of Volume Size At least 300 MB for each voting disk volume. At least 300 MB for each OCR volume At least 300 MB for each OCR volume At least 300 MB for each voting disk volume 1.2 Oracle RAC共享文件系统所需尺寸 File Types Stored Oracle Database files Number Volumes 1 of Volume Size At least 1.5 GB for each volume Oracle Cluster Registry (OCR) with external redundancy 1 Oracle Clusterware files (OCR and voting disks) with redundancy provided by Oracle software. 1

File Types Stored Recovery files Note: Recovery files must be on a different volume than database files Number Volumes 1 of Volume Size At least 2 GB for each volume 1.3 Oracle ASM存储配置

1.3.1 使用ASMLIB配置Oracle ASM

1.3.1.1 安装配置ASM Library Driver软件

? 检查Linux内核版本:uname –rm ? 下载ASMLIB软件

http://www.oracle.com/technetwork/server-storage/linux/downloads/index-088143.html

oracleasm-support-version.arch.rpm oracleasm-kernel-version.arch.rpm oracleasmlib-version.arch.rpm

1.3.1.2 安装ASMLIB包

rpm -Uvh oracleasm-support-2.0.1.x86_64.rpm \\ oracleasmlib-2.0.1.x86_64.rpm \\

oracleasm-2.6.9-11.EL-2.0.1.x86_64.rpm

1.3.1.3 执行命令初始化OracleASM配置,此脚本将创建

/etc/sysconfig/oracleasm配置文件,并创建/dev/oracleasm安装点,安装ASMLIB文件系统

# /usr/sbin/oracleasm configure -i

1.3.1.4 载入oracleasm内核模块

# /usr/sbin/oracleasm init

1.3.1.5 使用ASM library配置磁盘设备

在linux平台使用fdisk创建磁盘分区 fdisk /dev/sdb

1.3.1.6 表示磁盘作为ASM磁盘

# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1 1.3.1.7 在其它节点识别磁盘

# /usr/sbin/oracleasm scandisks 1.3.1.8 管理ASMLIB驱动和磁盘 Option configure Description Use the configure option to reconfigure the Oracle Automatic Storage Management library driver, if necessary: # /usr/sbin/oracleasm configure -i To see command options, enter oracleasm configure without the -i flag. Use the disable and enable options to change the actions of the Oracle Automatic Storage Management library driver when the system starts. The enable option causes the Oracle enable disable

Option Description Automatic Storage Management library driver to load when the system starts: # /usr/sbin/oracleasm enable start stop restart createdisk Use the start, stop, and restart options to load or unload the Oracle Automatic Storage Management library driver without restarting the system: # /usr/sbin/oracleasm restart Use the createdisk option to mark a disk device for use with the Oracle Automatic Storage Management library driver and give it a name: # /usr/sbin/oracleasm createdisk DISKNAME devicename Use the deletedisk option to unmark a named disk device: # /usr/sbin/oracleasm deletedisk DISKNAME Caution: Do not use this command to unmark disks that are being used by an Oracle Automatic Storage Management disk group. You must delete the disk from the Oracle Automatic Storage Management disk group before you unmark it. Use the querydisk option to determine if a disk device or disk name is being used by the Oracle Automatic Storage Management library driver: # /usr/sbin/oracleasm querydisk {DISKNAME | devicename} Use the listdisks option to list the disk names of marked Oracle Automatic Storage Management library driver disks: # /usr/sbin/oracleasm listdisks Use the scandisks option to enable cluster nodes to identify which shared disks have been marked as Oracle Automatic Storage Management library driver disks on another node: # /usr/sbin/oracleasm scandisks 1.3.2 手动配置Oracle ASM

1.3.2.1 查询unique device identifiers

Linux 5.x

# /sbin/scsi_id -g -s /block/sdb/sdb1 Linux 6.x

scsi_id --whitelisted --replace-whitespace --device=/dev/sdc

1.3.2.2 增加或修改/etc/scsi_id.config文件

Linux 5.x options=-g Linux 6.x

options=--whitelisted --replace-whitespace

1.3.2.3 编辑文件/etc/udev/rules.d/99-oracle-asmdevices.rules建立UDEV规则

Linux 5.x

KERNEL==”sd?1″, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -d /dev/$parent”, RESULT==”SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_”, NAME=”asm-disk3″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

Linux 6.x

KERNEL==\SUBSYSTEM==\PROGRAM==\

deletedisk querydisk listdisks scandisks

Number 1 2 * 实例数 2 1 1 分区大小 (MB) 逻辑卷名与用途 120 120 110 250 5 USERS表空间: dbname_raw_120m 每实例6个在线日志文件:dbname_redon_m_raw_120m 控制文件: dbname_control[1|2]_raw_110m TEMP表空间: dbname_temp_raw_250m 服务器参数文件(SPFILE): dbname_spfile_raw_5m

Raw Logical Volumes for Oracle Cluster Ready Services (CRS) 1 100 Oracle Cluster Registry: ora_ocr_raw_100m 注:仅需为群集建立,多个数据库可共享 1 20 Oracle CRS voting disk: ora_vote_raw_20m 导入卷组到其它节点

1. 检查物理卷的PVID

# /usr/sbin/lspv 2. vary off卷组

# /usr/sbin/varyoffvg VGname 3. 导入卷组在每个节点

# /usr/sbin/importvg -y VGname -V MajorNumber PhysicalVolume 4. 配置权限

Oracle Database files:

# chown oracle:dba /dev/rdbname* # chmod 660 /dev/rdbname* Oracle CRS files:

# chown oracle:dba /dev/rora_vote_raw_20m # chmod 660 /dev/rora_vote_raw_20m # chown root:dba /dev/rora_ocr_raw_100m # chmod 640 /dev/rora_ocr_raw_100m 5. 在所有节点上激活卷组为并发模式

# /usr/sbin/varyonvg -c VGname

? 使DBCA能识别每个数据文件对应的RAW设备 ? 设置ORACLE_BASE

Bourne, Bash or Korn shell:

$ ORACLE_BASE=/u01/app/oracle ; export ORACLE_BASE C shell:

$ setenv ORACLE_BASE /u01/app/oracle

? 配置RAW磁盘设备,不使用HP ServiceGuard Extension

? 数据库文件所需RAW设备列表

Number 1 1 Number of instances 1 1 1 Size (MB) 500 Purpose and Sample Alternative Device File Name SYSTEM tablespace: dbname_system_raw_500m 300 + (Number of SYSAUX tablespace: instances * 250) dbname_sysaux_raw_800m 500 UNDOTBSn tablespace (One tablespace for each instance, where n is the number of the instance): dbname_undotbsn_raw_500m TEMP tablespace: dbname_temp_raw_250m EXAMPLE tablespace: dbname_example_raw_160m USERS tablespace: dbname_users_raw_120m Two online redo log files for each instance (where n is the number of the instance and m is the log number, 1 or 2): dbname_redon_m_raw_120m First and second control files: dbname_control{1|2}_raw_110m Server parameter file (SPFILE): dbname_spfile_raw_5m Password file: dbname_pwdfile_raw_5m 250 160 120 2 * number of 120 instances 2 1 1 110 5 5 8. 为ASM配置磁盘

? 识别ASM存储需求

? 决定datafile和recovery file是否使用ASM;

? 选择ASM冗余级别,外部冗余、正常冗余,高度冗余; ? 决定datafile和recovery file所需的全部磁盘空间; Redundancy Level External Normal High Minimum Number of Disks 1 2 3 Datafiles 1.15 GB 2.3 GB 3.45 GB Recovery FIles 2.3 GB 4.6 GB 6.9 GB Both 3.45 GB 6.9 GB 10.35 GB ? 如果安装RAC,那么ASM需要额外的空间存储元数据 15 + (2 * number_of_disks) + (126 * number_of_Automatic_Storage_Management_instances)

? 使用上面的公式计算,单位为MB

? 如果使用新的ASM磁盘组,那么确保

? 出于性能考虑ASM磁盘组中的磁盘应该大小一致

? 出于性能考虑一个单个的物理磁盘不要指定多于一个分区 ? Oracle推荐直接使用物理磁盘

9. 使用已存在的ASM磁盘组

? 可以使用DBCA进行ASM组与磁盘管理;

? 如果使用非交互模式安装那么不能建立新的磁盘组,但是能增加磁盘到已存

在的磁盘组;

? 检查是否存在磁盘组或磁盘组是否有足够的空间

? 检查ASM实例是否在磁盘中配置:more /etc/oratab

例:+ASM1:oracle_home_path

? 连接ASM实例并启动它(如果需要)

? export ORACLE_SID=+asm1

? export ORACLE_HOME=oracle home ? sqlplus /nolog ? conn /as sysdba ? startup

? 查看ASM存在的磁盘组,冗余级别,空间

? SELECT name,type,total_mb,free_mb FROM V$ASM_DISKGROUP; ? 如果需要为磁盘组增加磁盘设备

10. 为ASM配置磁盘

?

? ? ?

确认磁盘可用:/usr/sbin/lsdev –Cc disk 如果磁盘不存在则安装:/usr/sbin/chfmgr 检查磁盘是否已经使用:/usr/sbin/lspv

如果需要的磁盘没有PVID,使用如下命令建立 # /usr/sbin/chdev -l hdiskn -a pv=yes ? 在每个节点改变磁盘权限

? chown oracle:dba /dev/rdsk/cxtydz ? chmod 660 /dev/rdsk/cxtydz 使用asmtool工具 Option -add Description Adds or changes stamps. You must specify the hard disk, partition, and new stamp name. If the disk is a raw device or has an existing Automatic Storage Management stamp, then you must specify the -force option. Example asmtool -add [-force] \\Device\\Harddisk1\\Partition1 ORCLDISKASM0 \\Device\\Harddisk2\\Partition1 ORCLDISKASM2... -addprefix Adds or changes stamps using a common prefix asmtool -addprefix ORCLDISKASM [-force] to generate stamps automatically. The stamps are \\Device\\Harddisk1\\Partition1

Option Description Example generated by concatenating a number with the \\Device\\Harddisk2\\Partition1... prefix specified. If the disk is a raw device or has an existing Automatic Storage Management stamp, then you must specify the -force option. -list List available disks. The stamp, windows device asmtool -list [-force] name, and disk size in megabytes are shown. Some disks may be file systems, and cannot be stamped. If the disk is a raw device or has an existing ASM stamp, then you must specify the -force option. Removes existing stamps from disks. asmtool -delete ORCLDISKASM0 ORCLDISKASM1... -delete 11. 为数据库文件在RAW上配置磁盘

? 标识分区并配置RAW设备,考虑到每个文件必须使用一个磁盘,oracle建议

为每个磁盘分配合适的大小;

Number 1 1 Number of instances Size (MB) 500 Purpose and Sample Alternative Device File Name SYSTEM tablespace: dbname_system_raw_500m 300 + (Number of SYSAUX tablespace: instances * 250) dbname_sysaux_raw_800m 500 UNDOTBSn tablespace (One tablespace for each instance, where n is the number of the instance): dbname_undotbsn_raw_500m TEMP tablespace: dbname_temp_raw_250m EXAMPLE tablespace: dbname_example_raw_160m USERS tablespace: dbname_users_raw_120m Two online redo log files for each instance (where n is the number of the instance and m is the log number, 1 or 2): dbname_redon_m_raw_120m First and second control files: dbname_control{1|2}_raw_110m Server parameter file (SPFILE): dbname_spfile_raw_5m Password file: dbname_pwdfile_raw_5m 1 1 1 250 160 120 2 * number of instances 120 2 1 1 110 5 5 ? 选择RAW选择一个与数据库相关的名字,不能超过4个字符

? ? ? ?

在所有节点上确认磁盘设备被识别:/usr/sbin/lspv 如果磁盘不存在则安装:/usr/sbin/cfgmgr 检查磁盘是否已经使用:/sbin/lspv 在每个节点和每个设备上配置权限 OCR:

# chown root:oinstall /dev/rdsk/cxtydz # chmod 640 /dev/rdsk/cxtydz

Oracle Clusterware voting disk or database files: # chown oracle:dba /dev/rdsk/cxtydz # chmod 660 /dev/rdsk/cxtydz

? 如果数据库文件使用RAW,那么建立RAW设备映射文件

? 设置ORACLE_BASE环境变量: Bourne, Bash, or Korn shell:

$ ORACLE_BASE=/u01/app/oracle ; export ORACLE_BASE C shell:

% setenv ORACLE_BASE /u01/app/oracle ? 在ORACLE_BASE下建立子目录: # mkdir -p $ORACLE_BASE/oradata/dbname

# chown -R oracle:oinstall $ORACLE_BASE/oradata # chmod -R 775 $ORACLE_BASE/oradata

? 使用文本编辑器建立dbname_raw.conf式与要求如下:

database_object_identifier=device_file_name

对RAC数据库至少为每个实例指定一个UNDO标空间数据文件(undotbsn),两个重做日志文件(redon_1,redon_2)

两个控制文件(control1,control2) 例:

system=/dev/rdsk/c2t1d1 sysaux=/dev/rdsk/c2t1d2 example=/dev/rdsk/c2t1d3 users=/dev/rdsk/c2t1d4 temp=/dev/rdsk/c2t1d5 undotbs1=/dev/rdsk/c2t1d6 undotbs2=/dev/rdsk/c2t1d7 redo1_1=/dev/rdsk/c2t1d8 redo1_2=/dev/rdsk/c2t1d9 redo2_1=/dev/rdsk/c2t1d10 redo2_2=/dev/rdsk/c2t1d11 control1=/dev/rdsk/c2t1d12 control2=/dev/rdsk/c2t1d13

spfile=/dev/rdsk/dbname_spfile_raw_5m pwdfile=/dev/rdsk/dbname_pwdfile_raw_5m

? 安装Oracle群集件是必须手工配置OCR和voting disk的磁盘设备 ? 建立RAW设备映射文件

? 设置ORACLE_BASE环境变量: Bourne, Bash, or Korn shell:

$ ORACLE_BASE=/u01/app/oracle ; export ORACLE_BASE C shell:

% setenv ORACLE_BASE /u01/app/oracle ? 在ORACLE_BASE下建立子目录: # mkdir -p $ORACLE_BASE/oradata/dbname

# chown -R oracle:oinstall $ORACLE_BASE/oradata # chmod -R 775 $ORACLE_BASE/oradata ? 建立RAW映射文件

# find /dev/vg_name -user oracle -name 'r*' -print > dbname_raw.conf ? 编辑RAW映射文件

system=/dev/vg_name/rdbname_system_raw_500m sysaux=/dev/vg_name/rdbname_sysaux_raw_800m example=/dev/vg_name/rdbname_example_raw_160m users=/dev/vg_name/rdbname_users_raw_120m temp=/dev/vg_name/rdbname_temp_raw_250m

undotbs1=/dev/vg_name/rdbname_undotbs1_raw_500m undotbs2=/dev/vg_name/rdbname_undotbs2_raw_500m redo1_1=/dev/vg_name/rdbname_redo1_1_raw_120m redo1_2=/dev/vg_name/rdbname_redo1_2_raw_120m redo2_1=/dev/vg_name/rdbname_redo2_1_raw_120m redo2_2=/dev/vg_name/rdbname_redo2_2_raw_120m control1=/dev/vg_name/rdbname_control1_raw_110m control2=/dev/vg_name/rdbname_control2_raw_110m spfile=/dev/vg_name/rdbname_spfile_raw_5m pwdfile=/dev/vg_name/rdbname_pwdfile_raw_5m

第三部分:安装Oracle Clusterware 和 Oracle Real Application Clusters

五、 安装Oracle Clusterware

1. 使用CVU检查Oracle Clusterware要求

? 运行 runcluvfy.sh stage -pre crsinst -n node1,node2,node3 此命令将检查一下内

容:

? 在指定所有节点上的所有用户是等价的; ? 在指定所有节点上可到达;

? 在指定所有节点上可通过共有和私有连接相连;

? 在指定所有节点上Oracle用户拥有合适的管理权限;

? 在指定所有节点上都可访问位于共享存储的OCR和voting disk;

? 检查系统需求:内核版本,内核参数,软件包,内存,交换空间,临时

空间和所需用户和组; ? 操作系统必须的软件包;

? 节点应用:VIP,ONS和GSD。 ? Clusterware安装Troubleshooting

? 用户检查失败:检查节点具有管理权限的用户与密码是否完全一致,检

查SSH配置是否正确;

su – oracle

ssh node_name date

默认的ssh位于/usr/bin,如果ssh在其它位置那么打开cvu_config文件,位于目录$CV_HOME/cm/admin下。指定系统上ssh路径位置通过添加并更新ORACLE_SRVM_REMOTESHELL键值

# Locations for ssh and scp commands

ORACLE_SRVM_REMOTESHELL=/usr/bin/ssh ORACLE_SRVM_REMOTECOPY=/usr/bin/scp

如果ssh在其它位置,那么安装时需要指定参数确定位置,详细参数说明看runinstaller –help

如果安装或使用ssh过程中遇到X11相关错误,那么检查ssh配置;遇到stty错误,检查系统隐藏文件(.bashrc货.cshrc)

? 节点可达性检查失败:使用PING检查节点

? 管理权限检查失败:使用id oracle 确认用户,组配置正确

2. 使用OUI安装前准备

? 停止运行中的Oracle进程

? 防止安装因为stty命令而失败,如果安装失败出现下列提示则处理。

? stty: standard input: Invalid argument ? stty: standard input: Invalid argument ? 确定Oracle Inventory 路径

? 如果存在已经安装了的Oracle,OUI通过/etc/oraInst.loc文件确定已经使

用的路径。

? 安装过程中需要以root的身份运行脚本 ? 确定安装语言

? 为群集确定名字:群集名,共有节点名,私有节点名,虚拟节点名。群集名

必须唯一,长度为1-14个字符。共有节点名,私有节点名,虚拟节点名中不包含域名。

? 为群集安装准备共享存储:为OCR和voting disk提供共享RAW或共享文件

系统。

? Cluster Synchronization Services (CSS) voting disk:用于校验群集节点成

员资格和状态,voting disk所有者必须是oracle:dba,必须权限为644,至少需要分配20M

? Oracle Cluster Registry (OCR):包含群集和数据库配置信息如节点列表

等,OCR的所有者必须为root:oinstall,必须权限为640,至少需要分配100M

3. 使用OUI安装Oracle Clusterware

? ? ? ? ? ?

运行OUI安装Oracle Clusterware; 从Clusterware目录下运行runInstaller;

根据提示使用root用户在所有节点上运行脚本

OUI检查安装条件:如果已经存在CSS,则停止数据库和ASM实例,并执行 ? Oracle_home\\bin\\localconfig delete 群集节点配置信息; ? 输入群集名;

? 为每个节点输入共有,虚拟,私有主机名; ? 可以使用群集配置文件代替手工输入:在安装介质Disk1/response/ crs.rsp

文件中的CLUSTER_CONFIGURATION_FILE项中指定群集配置文件 选择区分公有和私有网络接口; 在Cluster存储配置界面配置存储;

在指定磁盘界面,指定OCR和voting disk存放的分区,为软件,数据库文件选择磁盘;

OUI将检查配置信息,并判断远程节点权限; 完成安装。

? ? ? ? ?

4. 安装后格式化OCFS

? 格式化语法

? crs_home\\cfs\\ocfsformat.exe /l drive_letter /c clustersize [/v volume_label]

[/f]

六、 安装Oracle 10g Real Application Clusters 1. 使用CVU校验数据库安装准备状态

? 校验语法

? cluvfy stage -pre dbinst stage -pre dbinst -n node_list [-r { 10gR1 | 10gR2 } ]

[-verbose]

? 例:cluvfy stage -pre dbinst -n node1,node2 -verbose

2. 运行DBCA,选择数据库配置类型

Configuration Type General Purpose, Transaction Processing, and Data Warehouse Description Installs a preconfigured starter database, Oracle options (including Oracle Database 10g with RAC), networking services, Oracle Database 10g utilities, and online documentation. At the end of the installation, DBCA creates and configures your RAC database. Enables you to customize your database options and storage components. Advantages Minimal input required. You can create your database more quickly than with the Advanced type. Enables you to create arbitrary tablespaces and datafiles and customize all aspects of your database. Advanced Do not create a starter database Installs only the software. Does not configure the listeners or network infrastructure and does not create a database. ? OUI,DBCA以及其它助手在安装过程中的行为; ? 安装后OUI将运行NETCA和DBCA; ? DBCA处理内容;

? 如果使用RAW设备,校验每个表空间是否正确配置了共享存储 ? 建立数据库

? 配置Oracle网络服务 ? 开始监听和数据库实例

3. 使用OUI安装Oracle database 10g步骤

? 运行setup.exe

? 如果在安装中遇到问题检查

? C:\\Program Files\\Oracle\\Inventory\\logs\\installActionsdate_time.log

? 在磁盘选择是OUI仅显示逻辑分区不显示主分区和asmtool标记过的分区 ? 在所有节点上添加Oracle_home\\bin路径的PATH环境变量 注:如果需要修改VIP使用srvctl modify nodeapps -A new_address

4. 在Windows 平台上的最小内存需求

? 安装RAC的节点仅有512M RAM 500M Virtual Memory时有如下限制:

? 在运行OUI安装会话的过程中不能运行DBUA,DBCA,NETCA

5. 卸载RAC软件

? 如果需要卸载RAC软件,那么必须在运行安装程序的那个节点进行卸载,并

且必须在卸载Oracle Clusterware之前先卸载Oracle RAC。存在多个Oracle home的情况下查看oratab文件检查相关性 ? 卸载Oracle database 10g RAC软件

? 使用DBCA删除相关的数据库

? 如果使用ASM,确保没有其它数据库和ASM实例相关,移除ASM ? 连接ASM实例确定使用ASM实例的数据库,以下命令仅显示运行中的

数据库实例

select INSTANCE_NAME from GV$ASM_CLIENT; ? 停止上述数据库实例

? 备份使用ASM实例的数据库文件

? 查看磁盘组:select * from V$ASM_DISKGROUP

? 删除磁盘组:drop diskgroup diskgroup_name including contents; ? 停止所有节点的ASM实例,并检查确认

? 如果Oracle Home使用共享群集文件系统,则执行

delete %ORACLE_HOME%\\database\\*ASM* delete %ORACLE_BASE%\\admin\\+ASM

? 如果没有使用共享群集文件系统,则在每个节点执行以上命令 ? 删除ASM服务:oradim -delete -asmsid +ASMnode_number ? 如果监听器在此Oracle Home上运行,使用NETCA删除它

6. 从Windows环境删除Oracle Clusterware

? 删除Oracle Clusterware

? 在所有节点停止并删除Oracle Clusterware节点应用

srvctl stop nodeapps -n node_name svrctl remove nodeapps -n node_name ? 停止OracleRemExecService服务 ? 运行OUI,选择deinstall product

? 如果存在OracleCRSTokenname服务,运行crsuser remove user_name命

令删除

? 停止并重新启动所有节点

? 如果没有使用群集文件系统,那么在每个节点使用资源管理器删除

Oracle目录

7. 卸载Oracle Clusterware并降级到9.2

? 如果没有使用OCFS存储OCR,则运行

? CRS_Home\\bin\\GuiOracleOBJManager.exe

? 如果Oracle9.2 Clusterware使用OCFS,那么在所有节点上确认:

? HKLM\\SOFTWARE\\Oracle\\osd9i\\ocr键存在

? HKLM\\SOFTWARE\\Oracle\\osd9i\\ocr下的CfsOcrRoot键值指向9.2 OCR

所在位置

? 停止节点应用:srvctl stop nodeapps -n nodename

本文来源:https://www.bwwdw.com/article/0ir5.html

Top