Oracle 11gRAC数据库安装(HPUX11.31+ASM without MC-SG) - 图文 下载本文

HPUX11.31+RAC11G数据库安装

2011年6月

Author: ma.yu@163.com

目录

1. 用户需求:........................................................................................................................... 3 2.安装过程: ................................................................................................................................ 4

2.1 系统环境准备,检查两台机器的状况: ..................................................................... 4 2.2 网络环境准备: ............................................................................................................. 7 2.3 补丁:............................................................................................................................. 7 2.4 内核参数修改: ............................................................................................................. 7 2.5 创建ORACLE用户:.................................................................................................. 8 2.6 磁盘分配:................................................................................................................... 10 2.7 ORACLE 安装前准备:............................................................................................. 13 2.8 ORACLE Clusterware安装: .................................................................................... 15 2.9 ORACLE RAC database软件安装: ..................................................................... 30 2.10 升级11.1.0.6到11.1.0.7: ...................................................................................... 38 2.11 Listener创建: ........................................................................................................... 53 2.12 dbca创建数据库: .................................................................................................... 54

1. 用户需求:

用户需要安装一套数据库RAC: 数据库软件:Oracle11g

数据库软件版本:11.1.0.6 ,升级到11.1.0.7。 模式:rac

数据库sid:MIS

数据库ip 规划如下:

型号 Hp rx6600 Hp rx6600 主机名 HOSTA HOSTB 实 Vip 实 Vip IP 10.111.11.19 10.111.11.21 10.111.11.20 10.111.11.22 服务器 MIS数据库服务器1 MIS数据库服务器2

目前这边硬件环境是两台rx6600 ,操作系统版本:HP-UX B.11.31

存贮设备 hp storage works P2000,总存储空间2.8T ,这套存储设备供MIS系统使用的磁盘分为四个,分别为1G,800G*3。

2.安装过程:

由于用户没有购买SGeRAC,所以在这次的安装过程中,使用Clusterware+RACdatabase+ASM的方式,不使用SGeRAC。

这样的话,所有的非ASM数据都要保存在共享磁盘分区裸设备上,而不是共享的lv上。

2.1 系统环境准备,检查两台机器的状况:

A.检查内存大小,至少>1GB.

# /usr/contrib/bin/machinfo | grep -i Memory # /usr/sbin/dmesg | grep \

16GB.

B.交换空间的检查:

-If RAM between 1GB and 2GB, then swap space required is 1.5 times the size of RAM -If RAM > 2GB, then swap space required is equal to the size of RAM

# /usr/sbin/swapinfo –a 16GB。

C./tmp 空间: #bdf /tmp 最少400MB。 目前2GB.

D. 安装ORACLE软件的目录,最少4GB. #bdf /oracle 目前20GB。

E.操作系统版本和机器位数: #uname –a

(尽管oracle10G只支持到HP UX11.23,但是在11.31上仍然能够安装。) HP-UX hosta B.11.31 U ia64 3599024424 unlimited-user license

# /bin/getconf KERNEL_BITS 64

F.检查Async I/O配置。 在11.23/11.31上已缺省配好。 # ll /dev/async

crw-rw-rw- 1 bin bin 101 0x000000 Mar 28 17:41 /dev/async

If you want to use Oracle on RAW devices and Async I/O is not configured, then Create the /dev/async character device

# /sbin/mknod /dev/async c 101 0x0 # chown oracle:dba /dev/async # chmod 660 /dev/async

Configure the async driver in the kernel using SAM => Kernel Configuration => Kernel

=> the driver is called 'asyncdsk' Generate new kernel Reboot

Set HP-UX kernel parameter max_async_ports using SAM. max_async_ports limits the maximum number of processes that can concurrently use /dev/async. Set this parameter to the sum of 'processes' from init.ora + number of background processes. If max_async_ports is reached, subsequent processes will use synchronous i/o.

Set HP-UX kernel parameter aio_max_ops using SAM. aio_max_ops limits the maximum number of asynchronous i/o operations that can be queued at any time. Set thisparameter to the default value (2048), and monitor over time using glance。

G.检查C编译器

For PL/SQL native compilation, Pro*C/C++, Oracle Call Interface, Oracle C++ Call Interface, Oracle XML Developer’s Kit (XDK):

HP-UX 11i v2 (11.23):

HP C/ANSI C Compiler (A.06.00): C-ANSI-C HP aC++ Compiler (C.06.00): ACXX

# cc –V

(Bundled) cc: HP C/aC++ B3910B A.06.12 [Oct 11 2006] 此外,需要有aCC编译器,否则有bug. [ID 794903.1] 也就是说命令 $aCC

应该可以执行。

H.为了成功编译链接Oralce,建立以下连接: # cd /usr/lib

# ln -s /usr/lib/libX11.3 libX11.sl # ln -s /usr/lib/libXIE.2 libXIE.sl # ln -s /usr/lib/libXext.3 libXext.sl # ln -s /usr/lib/libXhp11.3 libXhp11.sl # ln -s /usr/lib/libXi.3 libXi.sl # ln -s /usr/lib/libXm.4 libXm.sl # ln -s /usr/lib/libXp.2 libXp.sl # ln -s /usr/lib/libXt.3 libXt.sl # ln -s /usr/lib/libXtst.2 libXtst.sl

I.确保两个节点的时间非常接近,最好使用NTP协议进行时间同步。

J. 补丁:

HP-UX Operating System Itanium:

? HP-UX 11i Version 3 (11.31) with March 2007 Patch bundle for HP-UX (11iV2-B.11.23.0703) (此为oracle安装文档需求,如果有最新的,尽量打最新的补丁。) 目前:

2011Mar1131 2011.03 HPUX 11.31 Megpatch for Mar 2011

其他补丁: HP-UX 11.31:

General Patches:

? PHKL_37296 vfs module patch (已被40167 替代)

? PHKL_37452 vm cumulative patch [replaces PHKL_35900, PHKL_35936] (已被41362 替代)

? PHKL_37453 esdisk cumulative patch [replaces PHKL_36249] (已被41006 替代)

? PHKL_37454 esctl cumulative patch [replaces PHKL_36248] (已被40922 替代) ? PHCO_37476 libc cumulative patch (已被38658 替代) ? PHCO_37807 Cumulative Patch for bcheckrc (有)

? PHSS_37948 linker + fdp cumulative patch(已被41492 替代) ? PHSS_37954 Integrity Unwind Library (已被40542 替代)

? PHNE_35894 Networking commands cumulative patch (已被39717 替代)

C and C++ patches for Pro*C/C++,Oracle Call Interface,Oracle C++ Call Interface, Oracle XML Developer’s Kit (XDK):

? PHSS_35976 HP C/aC++ Compiler (A.06.14) Itanium 没有。

尝试过,这个补丁打不上。可能是aC++没有安装的缘故。

实际上需要有aCC编译器,否则有bug. [ID 794903.1] 也就是说 $aCC

应该可以执行

但目前没有,导致bug. Bug的处理方法见后。

Serviceguard 11.18 Patches (optional, only if you want to use Serviceguard): ? PHSS_37602 Serviceguard A.11.18.00

没有使用ServiceGuard.

使用

#swlist -l patch -a supersedes|grep PHKL_XXXXX检查是否已有或是已被替代。

2.2 网络环境准备:

A.目前机器的服务IP定为:

hosta: 10.111.11.19 VIP:10.111.11.21 hostb: 10.111.11.20 VIP:10.111.11.22

配置/etc/hosts: (两台机器都配)

127.0.0.1 hostb

127.0.0.1 localhost loopback

10.111.11.19 hosta 10.111.11.20 hostb

10.111.11.21 hosta_vip 10.111.11.22 hostb_vip

192.168.1.1 hosta_rac 192.168.1.2 hostb_rac

经过检查,发现刚安装完毕的HOSTA,HOSTB上面的lan是一一对应的,不需要调整。 配置完毕后:

HOSTA:lan900: 10.111.11.19 lan0:192.168.1.1 HOSTB: lan900 10.111.11.20 lan0:192.168.1.2

2.3 补丁:

针对11.31,已打最新补丁。

2011Mar1131 2011.03 HPUX 11.31 Megpatch for Mar 2011

2.4 内核参数修改:

针对HP UX11.31的内核,修改两台机器的参数(16GB内存):

首先列出现有参数: # kctune > /tmp/kctune.log

然后,执行脚本:

kctune 'nproc>=4096'

kctune 'ksi_alloc_max>=33600' #kctune ‘executable_stack=0’(缺省是0)

kctune 'max_thread_proc>=1024' kctune 'maxdsiz>=1073741824'

kctune 'maxdsiz_64bit>=2147483648' kctune 'maxssiz>=134217728'

kctune 'maxssiz_64bit>=1073741824' kctune 'maxuprc>=3780' #kctune 'msgmap>=4202' kctune 'msgmni>=4200' #kctune 'msgseg>=32767' kctune 'msgtql>=4200' kctune 'ncsize>=36672' #kctune 'nfile>=202048' kctune 'nflocks>=4200' kctune 'ninode>=35648' kctune 'nkthread>=7366' #kctune 'semmap>=8402' kctune 'semmni>=4200' kctune 'semmns>=8400' kctune 'semmnu>=4196' kctune 'semvmx>=32767'

kctune 'shmmax>=16000000000' kctune 'shmmni>=4096' kctune 'shmseg>=512' kctune 'swchunk>=40960' kctune 'vps_ceiling>=12000'

前面有#的表示HPUX11.31中没有

这里有几个参数比较大,是因为内存比较大。

执行完毕后,使用命令:#kctune –D列出需要重新启动才能生效的参数。 然后reboot。

2.5 创建ORACLE用户:

在两台机器上创建组/用户: # /usr/sbin/groupadd -g 201 dba # /usr/sbin/groupadd -g 200 oinstall

# /usr/sbin/useradd -u 200 -g oinstall -G dba oracle

# id oracle

uid=200(oracle) gid=200(oinstall) groups=201(dba)

Create HOME directory for Oracle user # mkdir /home/oracle

# chown oracle:oinstall /home/oracle

修改密码:

#passwd oracle (oracle用户密码:oracle) 配置ssh:

SSH Set-up(两台机器都设置)

Hosta$ mkdir ~/.ssh Hosta $ chmod 700 ~/.ssh

Hosta $ /usr/bin/ssh-keygen -t rsa Here, we leave the passphrase empty.

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

然后把两台机器的id_rsa.pub的内容合并,并存放到两个节点上:

/home/oracle/.ssh/authorized_keys on both nodes.

Hosta$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Hosta$ ssh oracle@hostb cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys Hosta$ chmod 644 ~/.ssh/authorized_keys

Hosta$ scp ~/.ssh/authorized_keys Hostb:~/.ssh/authorized_keys

Ssh测试:

Hosta$ ssh hosta ls Hosta$ssh hostb ls Hostb$ ssh hosta ls Hostb$ssh hostb ls

发现不成功,经检查发现可能是文件权限问题。 修改/home/oracle的权限为0755。 然后修改~/.ssh/的权限为0700 修改其他文件的权限如下: $ ls -l ~/.ssh total 64

-rw-r--r-- 1 oracle oinstall 788 Jun 21 11:44 authorized_keys -rw------- 1 oracle oinstall 1675 Jun 21 11:40 id_rsa -rw-r--r-- 1 oracle oinstall 394 Jun 21 11:40 id_rsa.pub -rw-r--r-- 1 oracle oinstall 1326 Jun 21 11:39 known_hosts 然后测试成功。

配置两台机器的.rhosts文件: # .rhosts file in $HOME of root HOSTA root HOSTA_vip root HOSTA_rac root HOSTB root HOSTB_vip root HOSTB_rac root

# .rhosts file in $HOME of oracle HOSTA oracle HOSTA_vip oracle HOSTA_rac oracle HOSTB oracle

HOSTB_vip oracle HOSTB_rac oracle

分别使用root/oracle帐户进行远程测试: #remsh HOSTA ll $remsh HOSTB ll 等。

2.6 磁盘分配:

由于无法使用SGeRAC,所以采用ASM方式。

规划: OCR占用两个磁盘,互为备份,大小1G左右。 CRS Voting磁盘占用3个,互为备份,大小1G左右。

ASM磁盘6个:全部为405G左右,5个存放DATA,1个存放FLASH_RECOVERY

由于两边的磁盘需要一致,所以,调整HOSTA,HOSTB上的磁盘: HOSTA[/]#ioscan -m lun

Class I Lun H/W Path Driver S/W State H/W Type Health Description

======================================================================

disk 12 64000/0xfa00/0xd esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x0 0/7/0/0/0/0.0x247000c0ff119abc.0x0

/dev/disk/disk12 /dev/rdisk/disk12

disk 13 64000/0xfa00/0xe esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x1000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x1000000000000 /dev/disk/disk13 /dev/rdisk/disk13

disk 14 64000/0xfa00/0xf esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x2000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x2000000000000 /dev/disk/disk14 /dev/rdisk/disk14

disk 15 64000/0xfa00/0x10 esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x3000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x3000000000000 /dev/disk/disk15 /dev/rdisk/disk15

使用命令检查两边的磁盘大小,确保两边对应的一致: diskinfo /dev/rdisk/disk12 diskinfo /dev/rdisk/disk13 diskinfo /dev/rdisk/disk14 , diskinfo /dev/rdisk/disk15

检查WWID号,确保两台机器的磁盘是一致的,例如: scsimgr lun_map -D /dev/rdisk/disk12

磁盘顺序为: 0x0 <-> disk12 976560 Kbytes (1G)

0x 1000000000000<-> disk13 830078112 Kbytes (800G) 0x 2000000000000<-> disk14 830078112 Kbytes (800G) 0x 3000000000000<-> disk15 830078112 Kbytes (800G)

如果不一致,需要使用ioinit调整。

由于没有SGeRAC,无法使用slvm,所以然后按照下表,对磁盘进行分区: P1: P2: P3: Disk12: 400M(Voting) 400M(OCR)

Disk13: 400M(Voting) 400G(ASM) 400G(ASM) Disk14: 400M(Voting) 400G (ASM) 400G(ASM) Disk15: 400M(OCR) 400G(ASM) 400G(ASM)

分区过程如下:

创建 /tmp/disk12par,/tmp/disk13par:

HOSTA[/tmp]#more disk12par 2

EFI 403MB HPUX 100%

HOSTA[/tmp]#more disk13par(disk14par,disk15par和disk13par相同) 3

EFI 403MB

HPUX 405110MB HPUX 100%

然后使用命令:# idisk -f /tmp/disk12par -w /dev/rdisk/disk12 对几个个磁盘进行分区。分区完成后,使用命令: #insf –e –C disk创建各个分区的设备文件。 HOSTA[/tmp]#ioscan -m lun

Class I Lun H/W Path Driver S/W State H/W Type Health Description

======================================================================

disk 12 64000/0xfa00/0xd esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x0

0/7/0/0/0/0.0x247000c0ff119abc.0x0

/dev/disk/disk12 /dev/rdisk/disk12 /dev/disk/disk12_p1 /dev/rdisk/disk12_p1 /dev/disk/disk12_p2 /dev/rdisk/disk12_p2

disk 13 64000/0xfa00/0xe esdisk CLAIMED DEVICE online HP P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x1000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x1000000000000 /dev/disk/disk13 /dev/rdisk/disk13 /dev/disk/disk13_p1 /dev/rdisk/disk13_p1 /dev/disk/disk13_p2 /dev/rdisk/disk13_p2 /dev/disk/disk13_p3 /dev/rdisk/disk13_p3

disk 14 64000/0xfa00/0xf esdisk CLAIMED DEVICE P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x2000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x2000000000000 /dev/disk/disk14 /dev/rdisk/disk14 /dev/disk/disk14_p1 /dev/rdisk/disk14_p1 /dev/disk/disk14_p2 /dev/rdisk/disk14_p2 /dev/disk/disk14_p3 /dev/rdisk/disk14_p3

disk 15 64000/0xfa00/0x10 esdisk CLAIMED DEVICE P2000 G3 FC

0/6/0/0/0/0/2/0/0/0.0x207000c0ff119abc.0x3000000000000 0/7/0/0/0/0.0x247000c0ff119abc.0x3000000000000 /dev/disk/disk15 /dev/rdisk/disk15 /dev/disk/disk15_p1 /dev/rdisk/disk15_p1 /dev/disk/disk15_p2 /dev/rdisk/disk15_p2 /dev/disk/disk15_p3 /dev/rdisk/disk15_p3

使用命令:diskinfo /dev/rdisk/diskX_pX核对各个磁盘的大小,确保两边一致。# diskinfo /dev/rdisk/disk12_p1

SCSI describe of /dev/rdisk/disk12_p1: vendor: HP

product id: P2000 G3 FC type: direct access size: 412652 Kbytes bytes per sector: 512

# diskinfo /dev/rdisk/disk12_p2

SCSI describe of /dev/rdisk/disk12_p2: vendor: HP

product id: P2000 G3 FC type: direct access size: 563200 Kbytes

online HP online HP bytes per sector: 512

# diskinfo /dev/rdisk/disk13_p1

SCSI describe of /dev/rdisk/disk13_p1: vendor: HP

product id: P2000 G3 FC type: direct access size: 412640 Kbytes bytes per sector: 512

# diskinfo /dev/rdisk/disk13_p2

SCSI describe of /dev/rdisk/disk13_p2: vendor: HP

product id: P2000 G3 FC type: direct access

size: 414832640 Kbytes bytes per sector: 512

# diskinfo /dev/rdisk/disk13_p3

SCSI describe of /dev/rdisk/disk13_p3: vendor: HP

product id: P2000 G3 FC type: direct access

size: 414832640 Kbytes bytes per sector: 512 #

核对完成后,在两台机器上修改磁盘的属性:

OCR disks:(所有的都修改,这里以disk12_p2为例) # chown root:dba /dev/rdisk/disk12_p2 # chmod 640 /dev/rdisk/disk12_p2

ASM & Voting disks: (所有的都修改,这里以disk12_p1为例) # chown oracle:dba /dev/rdisk/disk12_p1 # chmod 660 /dev/rdisk/disk12_p1

2.7 ORACLE 安装前准备:

创建文件: /etc/privgroup,包括: dba MLOCK RTSCHED RTPRIO 在两台机器上执行:

#setprivgrp –f /etc/privgroup

可以使用#getprivgrp dba来验证设置是否正确。

在两台机器上都创建目录: # mkdir /var/opt/oracle

# chown oracle:oinstall /var/opt/oracle # chmod 755 /var/opt/oracle

Oracle Clusterware:

# mkdir -p /oracle/product/CRS Oracle RAC:

# mkdir –p /oracle/product/RAC11g

# chown -R oracle:oinstall /oracle/product

编辑两台机器上的oracle用户的.profile文件:

# Set up the search paths: PATH=$PATH:.

# Set up the shell environment: set -u

trap \

# Set up the shell variables:

export PS1=`whoami`@`hostname`\\['$ORACLE_SID'\\]':$PWD$ '

# Oracle Environment

export ORACLE_BASE=/oracle/product

export ORACLE_HOME=$ORACLE_BASE/RAC11g export ORA_CRS_HOME=$ORACLE_BASE/CRS export ORACLE_SID=MIS1(或2)

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/rdbms/lib export PATH=$PATH:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin export

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib/ export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib print ' '

print '$ORACLE_SID: '$ORACLE_SID

print '$ORACLE_HOME: '$ORACLE_HOME print '$ORA_CRS_HOME: '$ORA_CRS_HOME print ' ' # ALIAS

alias psg=\

alias oh=\alias crs=\

在下面的安装过程中,可能会在安装前检查过程中报$PATH里有多余的ORACLE_HOME, 更正方法为:

修改PATH定义,从中删除$ORA_CRS_HOME/bin或是$ORACLE_HOME/bin中的一个,只

保留其中一个。再重新登录,重新启动runInstaller。

2.8 ORACLE Clusterware安装:

首先安装Clusterware.

ORACLE数据库本身所有帐号的密码都设置为:oracle.

在HOSTA上,使用Xmanager以oracle登录,并设置:

运行xclock进行测试。 Mount oracle安装光盘:

/usr/sbin/mount -F cdfs -o rr /dev/dsk/cxtydz /SD_CDROM

使用runcluvfy.sh进行检查: 但是调用时需要使用如下格式:

#/cdrom/runcluvfy.sh

/tmp/bootstrap/bin/cluvfy: not found.

检查不一定能通过。大致检查下,更改下主要的错误。

然后运行/cdrom下的runInstaller. $/cdrom/runInstaller &

选项,这里选择Oracle Clusterware:

输入Inventory的位置和可以管理Inventory的组:

出现安装目录输入要求时,填写OraCrs11g_home,这个以及相应的path:/oracle/product/CRS,应该和RAC database软件的安装目录不一样。

然后会进行安装前检查,这个检查一定要通过:

出现安装CRS检查的时候报错,错误原因出自于/etc/nsswitch.conf:

报错信息如下:

Checking Network Configuration File Permissions ...

Check complete. The overall result of this check is: Failed <<<<

Problem: The network configuration file nswitch.conf is not world readable. It needs to have world read permissions in order for hostnames to resolve properly.

Recommendation: Set the permissions on the file nswitch.conf to 444. ========================================================

错误原因:

HP OS 11.31和以前的版本11.23有比较大的改动。以前11.23在/etc/目录下有一个叫“nsswitch.conf\文件,但是在11.31版本没有这个文件。

解决办法:

# cp /etc/nsswitch.files /etc/nsswitch.conf # chown bin:bin nsswitch.conf

# chmod 444 nsswitch.conf //修改相应权限,问题解决。

选择Cluster节点, 选择Public Node/Private Node的界面(类似下图):

输入/etc/hosts中定义的 HOSTA/HOSTB, HOSTA_rac/HOSTB_rac, HOSTA_vip/HOSTB_vip。

然后输入网络选择,类似下图,这里将Lan900/10.111.11.0设为Public, lan0/192.168.1.0 设为Private.

选择OCR的位置,类似下图,我们这里输入/dev/rdisk/disk12_p2,/dev/rdisk/disk15_p1, Normal Redundancy.

接下来输入Voting Disk的位置,类似下图,我们这里输入: /dev/rdisk/disk12_p1,/dev/rdisk/disk13_p1,/dev/rdisk/disk14_p1

下一步,后进入Summary Page, 进行安装。

安装进行中:

安装完毕执行脚本:

安装完毕后,会要求在HOSTB上执行:/oracle/oraInventory/orainstRoot.sh hostb# ./orainstRoot.sh

Creating the Oracle inventory pointer file (/var/opt/oracle/oraInst.loc) Changing permissions of /oracle/oraInventory to 770. Changing groupname of /oracle/oraInventory to oinstall. The execution of the script is complete

以及在HOSTA,HOSTB上执行:/oracle/product/CRS/root.sh

按照要求,首先在HOSTB上执行orainstRoot.sh(如上),然后在HOSTA上执行root.sh,创建CRS,格式化CRS的磁盘。执行完毕后,再在HOSTB上执行root.sh,会识别出CRS/Voting的磁盘,并添加vip: hosta# ./root.sh

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

Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory Setting up Network socket directories

Oracle Cluster Registry configuration upgraded successfully

The directory '/oracle/product' is not owned by root. Changing owner to root

The directory '/oracle' is not owned by root. Changing owner to root Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: hosta hosta_rac hosta node 2: hostb hostb_rac hostb

Creating OCR keys for user 'root', privgrp 'sys'.. Operation successful.

Now formatting voting device: /dev/rdisk/disk12_p1 Now formatting voting device: /dev/rdisk/disk13_p1 Now formatting voting device: /dev/rdisk/disk14_p1 Format of 3 voting devices complete.

Startup will be queued to init within 30 seconds. Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds. Cluster Synchronization Services is active on these nodes. hosta

Cluster Synchronization Services is inactive on these nodes. hostb

Local node checking complete. Run root.sh on remaining nodes to start CRS daemons. hosta#

hostb# ./root.sh

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

Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory Setting up Network socket directories

Oracle Cluster Registry configuration upgraded successfully

The directory '/oracle/product' is not owned by root. Changing owner to root The directory '/oracle' is not owned by root. Changing owner to root clscfg: EXISTING configuration version 4 detected. clscfg: version 4 is 11 Release 1.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: hosta hosta_rac hosta node 2: hostb hostb_rac hostb

clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.

-force is destructive and will destroy any previous cluster configuration.

Oracle Cluster Registry for cluster has already been initialized Startup will be queued to init within 30 seconds. Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds. Cluster Synchronization Services is active on these nodes. hosta hostb

Cluster Synchronization Services is active on all the nodes. Waiting for the Oracle CRSD and EVMD to start

Oracle CRS stack installed and running under init(1M) Running vipca(silent) for configuring nodeapps

Creating VIP application resource on (2) nodes... Creating GSD application resource on (2) nodes... Creating ONS application resource on (2) nodes... Starting VIP application resource on (2) nodes... Starting GSD application resource on (2) nodes... Starting ONS application resource on (2) nodes...

Done.

Clusterware安装完成:

检查VIP: #

Hosta# netstat -niw

Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll

lan0 1500 192.168.1.0 192.168.1.1 6144 0 4659 0 0

lo0 32808 127.0.0.0 127.0.0.1 16415 0 16415 0 0

lan900 1500 10.111.11.0 10.111.11.19 422953 0 1496848 0 0

lan900:801 1500 10.111.11.0 10.111.11.21 0 0 0 0 0

安装完成后,可以使用$olsnode/$crsctl check crs检查安装,并使用ps应该可以看到evmd,ocssd,crsd,oprocd.

/etc/inittab中应该包括以下部分:

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

这个时候,crs_stat –t应该可以列出GSD/ONS/VIP等的状态。

Clusterware安装,完成,重新启动机器,crs应该能够自动启动。

2.9 ORACLE RAC database软件安装:

设置新的$ORACLE_HOME,

$export ORACLE_HOME=/oracle/product/RAC11g $/cdrom/runInstaller&

选择Oracle Database11g:

选择Enterprise Edition:

修改Name,Path的内容,和CRS不能重叠,类似下图,这里为Name:OraDb11g_home1 Path:/oracle/product/RAC11g

选择Cluster方式,包含两个节点,hosta,hostb:

安装前需求检查,一定要通过:

因为要把oracle11g 11.1.0.6升级到oracle11.1.0.7,所以这里选择只安装软件,这样,升级会相对方便点:

选择各个管理员所在的组,如下图所示,也可以都改为dba组:

开始安装软件:

结束:

启动Netca,配置监听:

配置完毕后,使用$crs_stat –t应该可以列出监听。

2.10 升级11.1.0.6到11.1.0.7:

完成后,使用crs_stat –t检查安装的状态。 重新启动机器,准备安装11.1.0.7的补丁。

首先对Clusterware进行补丁:

从oracle 网站下载unzip软件,解开两个压缩包: p6890831_111070_HPUX-IA64_1of2.zip p6890831_111070_HPUX-IA64_2of2.zip 解压后,所有文件都存放到Disk1下:

按照补丁的说明,采用Non rolling upgrade,停止一切oracle活动:

以oracle用户,停止所有的oracle实例,asm等,如srvctl stop database –d MIS(目前没有这些,只有crs和nodeapps,停止nodeapps.) $srvctl stop nodeapps –n hosta $srvctl stop nodeapps –n hostb

以root用户停止crs: #crsctl stop crs

停止后,在hosta上设置ORACLE_HOME, 在此,OUI其实并不理会这个。 运行patch的runInstaller.

开始升级clusterware和database软件到11.1.0.7,会同时自动升级OUI到11.1.0.7。 执行

$./Disk1/runInstaller & 开始升级:

首先升级CRS,选择OraCrs11g_home,path会自动改为/oracle/product/CRS:

选择Cluster 安装方式:

对CRS升级前,全面检查,一定要通过:

通过后,列出要安装的软件:

选择Install,开始安装。

安装完成后,需要执行脚本:

按照以下说明,执行脚本:

To complete the installation of this patchset, you must perform the following tasks on each node: 1. Log in as the root user. 2. As the root user, perform the following tasks: a. Shutdown the CRS daemons by issuing the following command: /oracle/product/CRS/bin/crsctl stop crs b. Run the shell script located at: /oracle/product/CRS/install/root111.sh This script will automatically start the CRS daemons on the patched node upon completion.

3. After completing this procedure, proceed to the next node and repeat.

首先停止CRS:

Hosta,hostb上都停止crs:

#/oracle/product/CRS/bin/crsctl stop crs

执行root111.sh: hosta# ./root111.sh

Creating pre-patch directory for saving pre-patch clusterware files /oracle/product/CRS/lib32/libskgxn2.so not found

Completed patching clusterware files to /oracle/product/CRS Relinking some shared libraries.

Relinking of patched files is complete.

Preparing to recopy patched init and RC scripts. Recopying init and RC scripts.

Startup will be queued to init within 30 seconds. Starting up the CRS daemons.

Waiting for the patched CRS daemons to start. This may take a while on some systems. . . . . . . .

11107 patch successfully applied.

clscfg: EXISTING configuration version 4 detected. clscfg: version 4 is 11 Release 1.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: hosta hosta_rac hosta

Creating OCR keys for user 'root', privgrp 'sys'.. Operation successful.

clscfg -upgrade completed successfully

Creating '/oracle/product/CRS/install/paramfile.crs' with data used for CRS configuration Setting CRS configuration values in /oracle/product/CRS/install/paramfile.crs Setting cluster unique identifier Restarting Oracle clusterware Stopping Oracle clusterware Stopping resources.

This could take several minutes.

Successfully stopped Oracle Clusterware resources Stopping Cluster Synchronization Services.

Shutting down the Cluster Synchronization Services daemon. Shutdown request successfully issued.

Waiting for Cluster Synchronization Services daemon to stop Waiting for Cluster Synchronization Services daemon to stop Cluster Synchronization Services daemon has stopped Starting Oracle clusterware

Attempting to start Oracle Clusterware stack

Waiting for Cluster Synchronization Services daemon to start Waiting for Cluster Synchronization Services daemon to start Waiting for Cluster Synchronization Services daemon to start Waiting for Cluster Synchronization Services daemon to start Waiting for Cluster Synchronization Services daemon to start Waiting for Cluster Synchronization Services daemon to start Cluster Synchronization Services daemon has started Event Manager daemon has started

Cluster Ready Services daemon has started hosta#

Hostb# ./root111.sh

Creating pre-patch directory for saving pre-patch clusterware files /oracle/product/CRS/lib32/libskgxn2.so not found

Completed patching clusterware files to /oracle/product/CRS Relinking some shared libraries.

Relinking of patched files is complete.

Preparing to recopy patched init and RC scripts. Recopying init and RC scripts.

Startup will be queued to init within 30 seconds. Starting up the CRS daemons.

Waiting for the patched CRS daemons to start. This may take a while on some systems. .

11107 patch successfully applied.

clscfg: EXISTING configuration version 4 detected. clscfg: version 4 is 11 Release 1.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 2: hostb hostb_rac hostb

Creating OCR keys for user 'root', privgrp 'sys'.. Operation successful.

clscfg -upgrade completed successfully

Creating '/oracle/product/CRS/install/paramfile.crs' with data used for CRS configuration Setting CRS configuration values in /oracle/product/CRS/install/paramfile.crs hostb#

两台机器都执行完成root111.sh后,可以结束clusterware patch过程。使用命令

$/oracle/product/CRS/bin/crsctl query crs activeversion检查升级后的crs版本: Oracle Clusterware active version on the cluster is [11.1.0.7.0]

$crs_stat –t检查crs是否正常运行。

然后对RAC database软件升级:

停止两台机器上的nodeapps, CRS, 重新执行 $./Disk1/runInstaller &

升级RAC Database。升级过程中,NAME选择OraDb11g_home1,path会自动改为/oracle/product/RAC11g。

要提供一个合法的email地址,接受oracle发来的邮件,可以忽略:

选择cluster安装方式,选择Cluster Installation:

升级database前全面检查:

列出要安装的软件: