您的位置:首页 > 数据库 > Oracle

RHEL5.4_Oracle10g RAC,iSCSI,asm安装

2011-07-19 15:46 706 查看
RHEL5.4_Oracle10g RAC,iSCSI,asm安装
                                                       Author:parl.li
目录
前言:认识oracle RAC 3
设置ISCSI共享存储 4
####Server端ISCSI设置: 4
####Client端iSCSI设置 6
一 硬件环境: 8
二 准备环境(需要在各节点) 8
2.1 IP地址的分配 8
2.2 需要安装的rpm包 9
2.3 集群实例分配 9
2.4 用户环境 10
2.5 raw设备分配 11
2.6 调整内核参数 13
2.7 准备ASM环境 14
2.8 设置各节点时间同步 15
2.9 建立oracle用户信任关系 15
三 安装oracle clusterware软件 16
3.1  上传安装文件到rac1 /opt分区下 16
3.2  测试安装环境 16
3.3 安装 17
3.4 解决vipca不能运行的问题 23
四 安装database软件 29
五 升级clusterware软件到10204 36
六 升级database到10204 38
七 NETCA配置listener 41
八 DBCA创建数据库 46
九 打补丁,解决emctl不能启动的问题 51
十 share最后的状态 53
十一 设置DIAGWAIT 54
11.1停止所有节点的CRS #crsctl stop crs 55
11.2 停止10.2.0.3到11.1.0.6版RAC中的OPROCD进程 #<CRS_HOME>/bin/oprocd stop 55
11.3 检查是否还有CRS相关的进程在运行 ps -ef |egrep "crsd.bin|ocssd.bin|evmd.bin|oprocd" 55
11.4在任意一个节点使用ROOT用户来设置DIAGWAIT的值(按照ORACLE的推荐设置为13) [root@rac1 oracle]# crsctl set css diagwait 13 -force 55
11.5启动所有节点的CRS 55
后语 关于安装错误,心中的痛!! 55
Error1: 55
Error2: 56
删除crs重新安装 56
Re: RAC中使用EM管理磁盘组问题 57
Oracle10g  EM 启动故障 58

前言:认识oracle RAC

Rac架构
Rac 各组件磁盘规划要求:

设置ISCSI共享存储

####Server端ISCSI设置:

[root@PD_110 ~]# yum install  scsi-target-utils -y 
  scsi-target-utils.x86_64 0:0.0-5.20080917snap.el5                                                         
  perl-Config-General.noarch 0:2.40-1.el5 
openib.noarch 
librdmacm
libcxgb3
openib
libibverbs
[root@PD_110 ~]# /etc/init.d/tgtd restart
Stopping SCSI target daemon:                               [  OK  ]
Starting SCSI target daemon:                               [  OK  ]
[root@PD_110 ~]# chkconfig tgtd on
[root@PD_110 ~]# tgtadm --lld iscsi --op new --mode target --tid 1 --targetname  iqn.2011-03-15
[root@PD_110 ~]# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store  /dev/cciss/c0d1p9 
[root@PD_110 ~]# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 4  --backing-store  /dev/cciss/c0d1p6
[root@PD_110 ~]# tgtadm --lld iscsi --op bind  --mode target --tid 1 --initiator-address 192.168.22.5
[root@PD_110 ~]# tgtadm --lld iscsi --op bind  --mode target --tid 1 --initiator-address 192.168.22.7
###查看共享出去的块设备
[root@PD_110 ~]#  tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2011-03-15
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0 MB
            Online: Yes
            Removable media: No
            Backing store: No backing store
        LUN: 1
            Type: disk
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 30006 MB
            Online: Yes
            Removable media: No
            Backing store: /dev/cciss/c0d1p9
    Account information:
    ACL information:
        192.168.22.5
        192.168.22.7
将配置写入文件保存。
[root@PD_110 ~]# tgt-admin -dump > /etc/tgt/targets.conf
[root@PD_110 ~]# cat /etc/tgt/targets.conf
default-driver iscsi
 
<target iqn.2011-03-05>
        backing-store /dev/cciss/c0d1p9
        backing-store /dev/cciss/c0d1p10
        backing-store /dev/cciss/c0d1p5
        backing-store /dev/cciss/c0d1p6
        backing-store /dev/cciss/c0d1p8
        initiator-address 192.168.22.5
        initiator-address 192.168.22.7
</target>
[root@PD_110 ~]# cat /etc/tgt/targets.conf 
# TGTD example targets file
#
# Example iSCSI target with one LUN.
# This gets read when "service tgtd start" is run.
#
#<target iqn.2007-04.com.example:tgtd>
        # List of files to export as LUNs
        #backing-store /usr/storage/disk_1.img
 
        # Authentication :
        # if no "incominguser" is specified, it is not used
        #incominguser backup secretpass12
 
        # Access control :
        # defaults to ALL if no "initiator-address" is specified
 
4000
       #initiator-address 192.168.1.2
#</target>
<target iqn.2011-03-15>
backing-store /dev/cciss/c0d1p9
backing-store /dev/cciss/c0d1p10
backing-store /dev/cciss/c0d1p5
backing-store /dev/cciss/c0d1p6
backing-store /dev/cciss/c0d1p8
initiator-address 192.168.22.5
initiator-address 192.168.22.7
</target>

####Client端iSCSI设置

[root@rac1 db_1]# yum install iscsi-initiator-utils
        iscsi-initiator-utils.i386 0:6.2.0.871-0.10.el5 
[root@rac1 db_1]# /etc/init.d/iscsi start
iscsid is stopped
Turning off network shutdown. Starting iSCSI daemon:               [  OK  ]
Setting up iSCSI targets: iscsiadm: No records found!                 [  OK  ]
####查找server共享出来的存储
[root@RAC1 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.22.9
192.168.22.9:3260,1 iqn.2011-03-15            
[root@RAC1 ~]# iscsiadm --mode node  --portal 192.168.22.9  --targetname iqn.2011-03-15 --login
Logging in to [iface: default, target: iqn.2011-03-15, portal: 192.168.22.9,3260]
Login to [iface: default, target: iqn.2011-03-15, portal: 192.168.22.9,3260]: successful
注销与删除操作:
[root@virt1 ~]# iscsiadm -m node -T iqn.2010-06.com.sys.disk1 -p 192.168.1.206:3260 -u
Logging out of session [sid: 2, target: iqn.2010-06.com.sys.disk1, portal: 192.168.1.206,3260]
Logout of [sid: 2, target: iqn.2010-06.com.sys.disk1, portal: 192.168.1.206,3260]: successful
[root@virt1 ~]# iscsiadm -m node -o delete -T iqn.2010-06.com.sys.disk1 -p 192.168.1.206:3260
iscsiadm -m node -op delete -targetname
//在客户端删除iscsi target
[root@rac2 ~]# fdisk -l
 
Disk /dev/hda: 262 MB, 262144000 bytes
255 heads, 63 sectors/track, 31 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14          31      144585   8e  Linux LVM
 
Disk /dev/sda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9964    80035798+  8e  Linux LVM
 
Disk /dev/sdb: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
 
Disk /dev/sdc: 30.0 GB, 30005805056 bytes
64 heads, 32 sectors/track, 28615 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
 
Disk /dev/sdc doesn't contain a valid partition table
 
Disk /dev/sdd: 56.4 GB, 56456216576 bytes
64 heads, 32 sectors/track, 53840 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
 
Disk /dev/sdd doesn't contain a valid partition table
 
Disk /dev/sde: 20.0 GB, 20003848192 bytes
64 heads, 32 sectors/track, 19077 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
 
Disk /dev/sde doesn't contain a valid partition table
 
Disk /dev/sdf: 20.0 GB, 20003864576 bytes
64 heads, 32 sectors/track, 19077 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1       19077    19534832    5  Extended
/dev/sdf5               1         239      244704   83  Linux
/dev/sdf6             240         478      244720   83  Linux
/dev/sdf7             479         717      244720   83  Linux
/dev/sdf8             718         956      244720   83  Linux
/dev/sdf9             957        1195      244720   83  Linux
 
Disk /dev/sdg: 304 MB, 304971776 bytes
10 heads, 59 sectors/track, 1009 cylinders
Units = cylinders of 590 * 512 = 302080 bytes
 
Disk /dev/sdg doesn't contain a valid partition table

一 硬件环境:

Rac1  
Bitbond :Intel(R) Celeron(R) CPU 2.80GHz  1g memory  80gHD
OS :rhel_as54_x32
Rac2  
Bitbond :Intel(R) Celeron(R) CPU 2.80GHz  1g memory  80gHD
OS :rhel_as54_x32
共享存储:
Hp :DL 380G5  Intel(R) Xeon(R) CPU E5420  @ 2.50GHz  4g memory   73GHD
OS:  rhel_as 5.4 x64
ISCSI: 146gHD

二 准备环境(需要在各节点)

2.1 IP地址的分配

[root@rac2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
#pub 
192.168.22.5  rac1
192.168.22.7  rac2
#vip 
192.168.22.6  rac1-vip
192.168.22.8  rac2-vip
#priv
172.16.22.5  rac1-priv
172.16.22.7  rac2-priv
##以上vip地址,先不需要在网卡上配置
ISCSI 设备的IP与pub网址处于同一网段一致为:192.168.22.9

2.2 需要安装的rpm包

gcc-c++-4.1.1-52.el5.i386.rpm and all its dependent packages:
l gcc-4.1.1-52.el5.i386.rpm?   
l libstdc++-devel-4.1.1-52.el5.i386.rpm?   
l glibc-devel-2.5-12.i386.rpm?   
l glibc-headers-2.5-12.i386.rpm?   
l ibgomp-4.1.1-52.el5.i386.rpm?   
libXp-1.0.0-8.i386.rpm?   
compat-gcc-34-3.4.6-4.i386rpm?   
compat-gcc-c++-34-3.4.6-4.i386rpm?   
compat-libstdc++-33-3.2.3-61.i386.rpm?   
sysstat-5.0.5-1.i386.rpm (OEL5 only) 

2.3 集群实例分配

集群实例名:
 bee 
 
OCR(oracle集群注册表)
/dev/raw/raw1   /dev/sdf5       250M
/dev/raw/raw2   /dev/sdf6       250M
 
表决磁盘(voting disk)
/dev/raw/raw3   /dev/sdf7       250M
/dev/raw/raw4   /dev/sdf8       250M
/dev/raw/raw5   /dev/sdf9       250M
 
ASM Disk Devices
/dev/raw/raw6   /dev/sdc        30g
/dev/raw/raw7   /dev/sdd        57g
/dev/raw/raw8   /dev/sde        20g
/dev/raw/raw9   /dev/sdg        300M

2.4 用户环境

2.4.1 设置用户和目录
[root@rac2 ~]# groupadd dba                       
[root@rac2 ~]# groupadd oper                      
[root@rac2 ~]# groupadd oinstall                  
[root@rac2 ~]# useradd -g oinstall -G dba oracle  
[root@rac2 ~]# passwd oracle                      
[oracle@rac1 opt]$ id oracle
uid=500(oracle) gid=502(oinstall) groups=502(oinstall),500(dba)
注意两个节点的oracle用户属性要一致,否则建立信任关系时通过不了
2.4.2 创建oracle安装目录,并授权
[root@RAC1 ~]# mkdir  /opt/oracle/crs  -p 
[root@RAC1 ~]# mkdir /opt/oracle/product/10.2.0/db_1  -p
[root@RAC1 ~]# chown oracle:oinstall  /opt/oracle
2.4.3设置用户环境
[oracle@rac1 ~]$ cat ~/.bash_profile 
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
#PATH=$PATH:$HOME/bin
#export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
umask 022
ORACLE_HOSTNAME=rac1; export ORACLE_HOSTNAME
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=bee1; export ORACLE_SID     ####rac2的ORACLE_SID=bee2
ORA_CRS_HOME=$ORACLE_BASE/crs;export ORA_CRS_HOME
PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/usr/sbin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
2.4.4 是用户环境即时生效
[oracle@rac1 ~]$ .  ~/.bash_profile 
2.4.5 测试用户环境
[oracle@rac2 ~]$ echo $ORA_CRS_HOME
/opt/oracle/crs

2.5 raw设备分配

2.5.1 设置raw设备绑定

[root@RAC1 ~]# cat  /etc/sysconfig/rawdevices
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
#OCR Devices
/dev/raw/raw1  /dev/sdb5
/dev/raw/raw2  /dev/sdb6
#Voting Disk Devices
 
/dev/raw/raw3  /dev/sdb7
/dev/raw/raw4  /dev/sdb8
/dev/raw/raw5  /dev/sdb9
#ASM Disk Devices
/dev/raw/raw6   /dev/sdc
/dev/raw/raw7   /dev/sdd
/dev/raw/raw8   /dev/sde
/dev/raw/raw9   /dev/sdg

2.5.2 启动raw绑定

[root@RAC1 ~]# /etc/init.d/rawdevices restart
Assigning devices: 
           /dev/raw/raw1  -->   /dev/sdb5
/dev/raw/raw1:  bound to major 8, minor 21
           /dev/raw/raw2  -->   /dev/sdb6
/dev/raw/raw2:  bound to major 8, minor 22
           /dev/raw/raw3  -->   /dev/sdb7
/dev/raw/raw3:  bound to major 8, minor 23
           /dev/raw/raw4  -->   /dev/sdb8
/dev/raw/raw4:  bound to major 8, minor 24
           /dev/raw/raw5  -->   /dev/sdb9
/dev/raw/raw5:  bound to major 8, minor 25
Done

2.5.3 配置raw绑定运行级别和授权

[root@rac2 ~]# chkconfig rawdevices on
[root@rac1 ~]# cat /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
 
touch /var/lock/subsys/local
insmod /lib/modules/2.6.18-164.el5/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=1 hangcheck_margin=10 hangcheck_reboot=1  ###时间同步
chown root:oinstall /dev/raw/raw[12]
chmod 640 /dev/raw/raw[12]
chown oracle:oinstall /dev/raw/raw[3-5]
chmod 640 /dev/raw/raw[3-5]
chown oracle:dba /dev/raw/raw[6-9]
chmod 660 /dev/raw/raw[6-9]
####下面的这这个文件,可以达到2.5节的功能!!!####
[root@rac1 ~]# cat /etc/udev/rules.d/51-permissions.rules 
KERNEL=="sdf5", NAME="raw/raw1", MODE="0640",OWNER="root", GROUP="oinstall" 
KERNEL=="sdf6", NAME="raw/raw2", MODE="0640",OWNER="root", GROUP="oinstall"
KERNEL=="sdf7", NAME="raw/raw3", MODE="0640",OWNER="oracle", GROUP="oinstall"
KERNEL=="sdf8", NAME="raw/raw4", MODE="0640",OWNER="oracle", GROUP="oinstall"
KERNEL=="sdf9", NAME="raw/raw5", MODE="0640",OWNER="oracle", GROUP="oinstall"
KERNEL=="sdc", NAME="raw/raw6", MODE="0660",OWNER="oracle", GROUP="dba"
KERNEL=="sdd", NAME="raw/raw7", MODE="0660",OWNER="oracle", GROUP="dba"
KERNEL=="sde", NAME="raw/raw8", MODE="0660",OWNER="oracle", GROUP="dba"
KERNEL=="sdg", NAME="raw/raw9", MODE="0660",OWNER="oracle", GROUP="dba"
设置raw设备的用户和权限信息
 把/dev/sdb1 知道到raw1上,就可以在/etc/udev/rules.d/60-raw.rules文件里添加如下内容:
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
在/etc/udev/rules.d/60-raw.rules文件里添加如下信息:
ACTION=="add", KERNEL=="raw1", OWNER="dave", GROUP="tianlesoftware", MODE="660"
如果有多个raw设备,可以写成:
ACTION=="add", KERNEL=="raw[1-4]", OWNER="dave", GROUP="tianlesoftware", MODE="660"
Eg:
ACTION=="add", KERNEL=="sdc3",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add",KERNEL=="raw[1-5]", OWNER="oracle", GROUP="oinstall", MODE="660"
 [root@HOST_RHEL5 rules.d]# start_udev 
 Starting udev:                                             [  OK  ] 

2.6 调整内核参数

2.6.1  修改/etc/sysctl.conf,添
15617
加:

kernel.shmall = 268435456
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024  65500
net.core.rmem_default = 262144
net.core.rmem_max = 2097152
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
2.6.2 激活更改的内核
# sysctl -p 立刻生效

2.6.3   Setting Shell Limits for the oracle User,尾部添加

[root@rac1 ~]# cat /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

2.6.4  添加到 /etc/pam.d/login

session         required        /lib/security/pam_limits.so

2.6.5 添加到 /etc/profile

  if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
     else
          ulimit -u 16384 -n 65536
     fi
   fi

2.6.6 设置Hangcheck-timer模块

1. Log in as root, and enter the following command to check the kernel version:
# uname -a
2. Enter the following command on each node to determine which kernel modules are loaded: 
# /sbin/lsmod
3. If the hangcheck-timer module is not listed for any node:
on Kernel 2.4 enter a command similar to the following to start the module on that node:
# /sbin/insmod hangcheck-timer hangcheck_tick=1 hangcheck_margin=10 hangcheck_reboot=1
on Kernel 2.6 enter a command similar to the following to start the module located in the directories of the
current kernel version:
# insmod /lib/modules/kernel_version/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=1
hangcheck_margin=10 hangcheck_reboot=1
In the preceding command example, the variable kernel_version is the kernel version running on your system
that you have got from uname -a.
[root@rac2 ~]# uname -a
Linux rac2 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
####效果见2.5.3节########
4. To confirm that the hangcheck module is loaded, enter the following command:
[root@rac1 ~]# lsmod | grep hang
hangcheck_timer         8025  0 

2.7 准备ASM环境

从Oracle OTN下载 ASM, ASMLib, ASMLib support,针对你的kernel的,不要下错  http://www.oracle.com/technology/tech/linux/asmlib/index.html [root@rac2 ~]# uname -a
Linux rac2 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
Download:
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.4-1.el5.i386.rpm
[root@rac2 ~]# rpm –ivh  oracleasm*rpm

2.8 设置各节点时间同步

[root@rac2 ~]# crontab -e
0-59/1  *   * * *  /usr/sbin/ntpdate 192.168.16.87  2&1>/dev/null

2.9 建立oracle用户信任关系

2.91 各节点执行
[oracle@rac1 ~]$ mkdir ~/.ssh
[oracle@rac1 ~]$ chmod 700 ~/.ssh
[oracle@rac1 ~]$ ssh-keygen -t rsa
[oracle@rac1 ~]$ ssh-keygen -t dsa
2.92 切换回rac1,接着执行
[oracle@rac1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@rac1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
2.93 同步节点间的key
提示:下列命令会提示你输入rac2 的oracle 密码,按照提示输入即可,如果失败可重新尝试执行命令。
Rac1 节点:
[oracle@rac1 ~]$ scp ~/.ssh/authorized_keys  rac2:~/.ssh/authorized_keys
Rac2节点:
[oracle@rac2 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@rac2 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[oracle@rac2 ~]$  scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keys
2.9.4  测试信任关系
[oracle@rac1 opt]$ ssh rac2 date ; ssh rac1 date
Mon Mar 21 17:41:30 CST 2011
Mon Mar 21 17:41:30 CST 2011
####在这里还可以检测时间同步的问题
[oracle@rac2 ~]$ ssh rac1 date;ssh rac2 date
Mon Mar 21 17:49:16 CST 2011
Mon Mar 21 17:49:16 CST 2011
[oracle@rac2 ~]$ ssh rac1-priv date;ssh rac2-priv date
Mon Mar 21 17:51:01 CST 2011
Mon Mar 21 17:51:01 CST 2011

三 安装oracle clusterware软件

3.1  上传安装文件到rac1 /opt分区下

[root@rac1 opt]# ls
10201_clusterware_linux32.zip  10201_database_linux32.zip  clusterware  database  Disk1  oracle  ORCLfmap  p6810189_10204_Linux-x86.zip  README.html
[root@rac1 opt]# chown oracle:oinstall *zip
[oracle@rac1 opt]$ unzip *zip

3.2  测试安装环境

3.2.1 检查存储组件

[oracle@rac1 cluvfy]$ ./runcluvfy.sh comp ssa -n rac1,rac2 -verbose
 
Verifying shared storage accessibility 
 
Checking shared storage accessibility...
 
WARNING: 
Unable to determine the sharedness of /dev/sdb on nodes:
        rac2,rac2,rac1,rac1
 
  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdc                              rac2 rac1               
 
  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdd                              rac2 rac1               
 
  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sde                              rac2 rac1               
 
  Disk                                  Sharing Nodes (2 in count)
  ------------------------------------  ------------------------
  /dev/sdf                              rac2 rac1               
 
 
Shared storage check was successful on nodes "rac2,rac1".
 
Verification of shared storage accessibility was successful.

3.2.2 检查crs环境

[oracle@rac1 cluvfy]$./runcluvfy.sh stage -pre crsinst  -n rac1,rac2 -r 10gR2 –verbose

3.3 安装

[root@rac1 opt]#xhost +
[oracle@rac1 opt]$ cd clusterware
[oracle@rac1 clusterware]$ ./runInstaller 
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-25_09-21-55AM. Please wait ...[oracle@pub2 clusterware]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.
输入crs安装路径 /opt/oracle/crs
添加rac1,2的pub 节点名
编辑eth0的‘interface type’为public:
选择normal Redundancy,输入crs磁盘 /dev/raw/raw1,/dev/raw/raw2
选择normal Redundancy,输入vote磁盘 /dev/raw/raw3,/dev/raw/raw4,/dev/raw/raw5

3.4 解决vipca不能运行的问题

在安装Oracle 10.2.0.1 RAC的cluster software的时候,在最后一步,第二个节点,执行root.sh的时候,报告error while loading shared libraries: libpthread.so.0的错误,详细错误信息如下:
[root@rac2 crs]# /u01/crs/oracle/product/10.2.0/crs/root.sh
WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node : 
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
/u01/crs/oracle/product/10.2.0/crs/jdk/jre//bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory 
解决这个问题,需要三个步骤来完成:
1、在每个节点上,修改$CRS_HOME/bin目录下的srvctl和vipca文件,在vipca文件ARGUMENTS=""行之前和srvctl文件的export LD_ASSUME_KERNEL行之后增加 unset LD_ASSUME_KERNEL 语句 
2、使用$CRS_HOME/bin目录下的oifcfg工具配置pub ip和pri ip 
3、在任意一个节点上,用root用户,手动运行vipca,配置完正确的prvip和vip 信息之后,crs就可以安装完成,操作过程如下:

3.4.1修改vipca文件,增加标记为红色的那一行:

3.4.2修改srvctl文件,增加标记为红色的那一行:

[root@rac2 crs]# pwd
/u01/crs/oracle/product/10.2.0/crs
[root@rac2 crs]# cd bin/
[root@rac2 bin]# cp vipca vipca.bak
[root@rac2 bin]# vi vipca

……
152 export LD_LIBRARY_PATH
153 ;;
154 esac
155 
156 unset LD_ASSUME_KERNEL
157 
158 ARGUMENTS=""
159 NUMBER_OF_ARGUMENTS=$#
160 if [ $NUMBER_OF_ARGUMENTS -gt 0 ]; then
161 ARGUMENTS=$*
162 fi
163 
164 # Run Vipca
165 exec $JRE $JRE_OPTIONS $SRVM_PROPERTY_DEFS -classpath $CLASSPATH oracle.ops.vipca.VipCA -orahome $ORACLE_HOME $ARGUME NTS
"vipca" 167L, 5034C written

3.4.3在任意一个节点上使用oifcfg配置public和vip网络

[root@rac2 bin]# cp srvctl srvctl.bak
[root@rac2 bin]# vi srvctl

#!/bin/sh
……
166 #Remove this workaround when the bug 3937317 is fixed
167 LD_ASSUME_KERNEL=2.4.19
168 export LD_ASSUME_KERNEL
169 unset LD_ASSUME_KERNEL
170 
171 # Run ops control utility
"srvctl" 173L, 5578C written

3.4.4以root手动执行$CRS_HOME/bin/vipca工具,配置IP信息。

点击 OK 后;
vipca工具配置成功后,检查crs状态,两个节点的crs都已正常运行
点击”exit”后,再回来完成clustat安装的三个脚本执行.

3.4.5 检查crs启动的状态

[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2  
[oracle@rac1 ~]$ cd /opt/clusterware/cluvfy/
[oracle@rac1 cluvfy]$ cluvfy stage -post crsinst -n all
 
……
 
Checking existence of VIP node application (required)
Check passed. 
 
Checking existence of ONS node application (optional)
Check passed. 
 
Checking existence of GSD node application (optional)
Check passed. 
Post-check for cluster services setup was successful.

四 安装database软件

Oracle10g(10.2.0.1)软件安装
# 安装oracle rac soft
[oracle@rac1 10g]$ cd database/
[oracle@rac1 database]$ ls
doc  install  response  runInstaller  stage  welcome.html
[oracle@rac1 database]$ ./runInstaller 
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-25_11-00-34AM. Please wait ...[oracle@pub2 database]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.
 
输入oracle安装路径
选择节点
选择oracle安装组件
检查安装环境
选择只安装software
以root分别在pub2,pub1上执行root.sh
以root分别在rac1,rac2执行root.sh
# oracle rac soft安装完成后执行root.sh
[root@rac1 db_1]# sh root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Oracle10g(10.2.0.1) software安装完成。

五 升级clusterware软件到10204

摘自:oracle
At this point we have installed Oracle Clusterware 10.2.0.1. In this section we will patch the Oracle Clusterware to the latest release of Oracle 10gR2 - 10.2.0.4. The patchset can be downloaded from metalink.
Note: The Oracle Clusterware software must be at the same or newer level as the Oracle software in the Oracle RAC Oracle home. Therefore, you should always upgrade Oracle Clusterware before you upgrade Oracle RAC. This patch does not allow you to upgrade Oracle RAC before you upgrade Oracle Clusterware.
We will apply this patchset in a non rolling upgrade.
######从这段话中,可以知道应该先升级clusterware,再升级database#####
[oracle@rac1 Disk1]$ ./runInstaller 
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-25_11-16-05AM. Please wait ...[oracle@pub2 Disk1]$ Oracle Universal Installer, Version 10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.
TZ set to Asia/Chungking
如下图的很重要,需要选择ORA_CRS_HOME路径
根据要求执行以下脚本关闭crs; 
下一步,覆盖原来路径,再下一步直到执行root102.sh脚本。

六 升级database到10204 

[oracle@rac1 Disk1]$ ./runInstaller 
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-25_11-16-05AM. Please wait ...[oracle@pub2 Disk1]$ Oracle Universal Installer, Version 10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.
TZ set to Asia/Chungking
如下图的很重要,需要选择ORACLE _HOME路径
下一步,覆盖原来路径:

七 NETCA配置listener

[oracle@rac1 Disk1]$ netca

八 DBCA创建数据库

#####转进入第7节的操作,启动监听端口

九 打补丁,解决emctl不能启动的问题

关于上述的emctl 启动不成功,是因为oracle 10204的bug,需要打一个补丁p8350262修复。
解压后执行opatch安装补丁
[oracle@rac1 8350262]$ /opt/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.4.2
 
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /opt/oracle/product/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-03-21_15-37-57PM.log
 
ApplySession applying interim patch '8350262' to OH '/opt/oracle/product/10.2.0/db_1'
 
Running prerequisite checks...
 
OPatch detected the node list and the local node from the inventory.  OPatch will patch the local system then propagate the patch to the remote nodes.
 
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8350262' for restore. This might take a while...
Backing up files affected by the patch '8350262' for rollback. This might take a while...
 
Patching component oracle.sysman.agent.core, 10.2.0.4.0a...
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"
ApplySession adding interim patch '8350262' to inventory
 
Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.
 
Patching in rolling mode.
 
Updating nodes 'rac2' 
   Apply-related files are:
     FP = "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt"
     DP = "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt"
     MP = "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/make_cmds.txt"
     RC = "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/remote_cmds.txt"
 
Instantiating the file "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/opt/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_14_2010_04_59_44/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
 
OPatch succeeded.

十 share最后的状态

十一 设置DIAGWAIT

很多时候RAC中的节点宕机的时候,因为CPU或者磁盘等资源的繁忙或者其他问题,导致缓冲区中的日志还没有被写入磁盘上的日志中,节点就已经被重启,给故障诊断带来一定的麻烦,通过适当设置DIAGWAIT的值,使得节点被驱逐到真正OS REBOOT之间的时间适当延长,则可以记录更多有帮助的日志信息。具体操作过程如下(摘自METALINK:559365.1)

11.1停止所有节点的CRS
#crsctl stop crs

11.2 停止10.2.0.3到11.1.0.6版RAC中的OPROCD进程
#<CRS_HOME>/bin/oprocd stop

11.3 检查是否还有CRS相关的进程在运行
ps -ef |egrep "crsd.bin|ocssd.bin|evmd.bin|oprocd"

11.4在任意一个节点使用ROOT用户来设置DIAGWAIT的值(按照ORACLE的推荐设置为13)
[root@rac1 oracle]# crsctl set css diagwait 13 -force

Configuration parameter diagwait is now set to 13
11.5启动所有节点的CRS
#crsctl start crs 
11.6验证所有的CRS已经正常运行
#crsctl check crs
[root@rac1 oracle]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources 
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

后语 关于安装错误,心中的痛!!

Error1:

在第二个节点执行root.sh,报错
Expecting the CRS daemons to be up within 600 seconds.
Failure at final check of Oracle CRS stack.
10
Css.log日志
2011-03-18 18:15:42.323: [ COMMCRS][59779984]clsc_connect: (0x924aee8) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_rac2_crs))
2011-03-18 18:15:42.324: [ CSSCLNT][9778880]clsssInitNative: connect failed, rc 9
2011-03-18 18:15:42.324: [  CRSRTI][9778880]0CSS is not ready. Received status 3 from CSS. Waiting for good status .. 
2011-03-18 18:15:43.325: [ CRSMAIN][9778880][PANIC]0CRSD exiting: Could not init the CSS context
 
2011-03-18 18:15:43.327: [ default][9778880]Terminating clsd session                                                                                
2011-03-18 18:16:42.673: [ CSSCLNT][1568592]clsssInitNative: connect failed, rc 9
2011-03-18 18:16:45.342: [ CSSCLNT][1568592]clsssInitNative: connect failed, rc 9
这问题出在crs和vote共享磁盘。这两种磁盘是共享存储的一部分,不能是本地磁盘。

Error2:

在第二个节点执行root.sh,报错
Setting the permissions on OCR backup directory
Setting up NS directories
PROT-1: Failed to initialize ocrconfig
Failed to upgrade Oracle Cluster Registry configuration
这是第二次执行root.sh,残余安装没有删除干净,执行
sh  /opt/oracle/product/10.2.0/db_1/inventory/Templates/install/rootdelete.sh
sh /opt/oracle/product/10.2.0/db_1/install/rootdelete.sh

删除crs重新安装

[root@pub2 opt]# rm -rf /etc/ora*
[root@pub2 opt]# rm -rf /opt/crs/*
[root@pub2 opt]# rm -rf /opt/oracle/*
[root@pub2 opt]# rm -rf /crsdata/clusterdata/*
[root@pub2 opt]# rm -rf /etc/init.d/init*
[root@RAC2 client]# rm -f /usr/tmp/.oracle/*
[root@RAC2 client]# rm -f /tmp/.oracle/*
[root@RAC2 client]# rm -f /var/tmp/.oracle/*
[root@RAC2 client]# rm -fr /etc/init.d/init.c*
[root@RAC2 client]# rm -fr /etc/init.d/init.evmd
[root@RAC2 client]# rm -fr /etc/rc2.d/?96init.crs
[root@RAC2 client]# rm -fr /etc/rc3.d/?96init.crs
[root@RAC2 client]# rm -fr /etc/rc5.d/?96init.crs
[root@RAC2 client]#rm -fr /tmp/CVU_10.2.0.1.0.1_oinstall
[root@RAC2 client]#rm -fr /tmp/OraIns*
###清零raw
dd if=/dev/zero of=/dev/raw/raw1 bs=1M
dd if=/dev/zero of=/dev/raw/raw2 bs=1M

Re: RAC中使用EM管理磁盘组问题

Which version of EM ?  10.1  or  10.2  ?

What's your problem ?  Do  you  mean  you can't  see  ASM  instance
from  EM  interface ?  If  this, please follow up  these steps:

1.  Open "targets.xml"  from  $ORACLE_HOME/<host_name>_<sid>/sysman/emd, add following
entries:

<Target TYPE="osm_instance" NAME="+ASM1" DISPLAY_NAME="+ASM1">
   <Property NAME="SID" VALUE="+ASM1"/>
   <Property NAME="MachineName" VALUE="rac1_vip"/>
   <Property NAME="OracleHome" VALUE="/home/oracle/product/10.2.0/db_2"/>
   <Property NAME="UserName" VALUE="sys"/>
   <Property NAME="password" VALUE="oracle" ENCRYPTED="FALSE"/>
   <Property NAME="Role" VALUE="SYSDBA"/>
   <Property NAME="Port" VALUE="1521"/>
</Target>  
<Target TYPE="osm_instance" NAME="+ASM2" DISPLAY_NAME="+ASM2">
   <Property NAME="SID" VALUE="+ASM2"/>
   <Property NAME="MachineName" VALUE="rac2_vip"/>
   <Property NAME="OracleHome" VALUE="/home/oracle/product/10.2.0/db_2"/>
   <Property NAME="UserName" VALUE="sys"/>
   <Property NAME="password" VALUE="oracle" ENCRYPTED="FALSE"/>
   <Property NAME="Role" VALUE="SYSDBA"/>
   <Property NAME="Port" VALUE="1521"/>
</Target>  

Note: Change SID, MachineName, OracleHome, password 
according to your env setting.

2. Restart agent and wait some minutes to let  agent upload
these meta data information.

3. Logon EM to check.

Oracle10g  EM 启动故障

[oracle@app log]$  vim /opt/oracle/product/10.2.0/db_1/app_BEE/sysman/log/emdctl.trc
2011-05-31 10:50:40 Thread-4135749312 ERROR http: 6: Unable to initialize ssl connection with server, aborting connection attempt
2011-05-31 10:59:46 Thread-4134991552 ERROR ssl: nzos_Handshake failed, ret=28864
安装P2617419 Opatch工具包给oracle10g以后的打补丁会出错; p6880880才是适合10g后的Optach补丁工具.
[oracle@app oracle]$ unzip Opatch_p6880880_102000_Linux-x86-64.zip 
Archive:  Opatch_p6880880_102000_Linux-x86-64.zip
 extracting: OPatch/ocm/ocm.zip      
   creating: OPatch/ocm/lib/
  inflating: OPatch/ocm/lib/osdt_jce.jar  
  inflating: OPatch/ocm/lib/osdt_core3.jar  
  inflating: OPatch/ocm/lib/emocmclnt-14.jar  
  inflating: OPatch/ocm/lib/emocmutl.jar  
   creating: OPatch/ocm/bin/
  inflating: OPatch/ocm/bin/emocmrsp  
  inflating: OPatch/ocm/ocm_platforms.txt  
   creating: OPatch/crs/
   creating: OPatch/crs/log/
  inflating: OPatch/crs/patch112.pl  
  inflating: OPatch/crs/crsdelete.pm  
  inflating: OPatch/crs/crspatch.pm  
  inflating: OPatch/crs/s_crsconfig_defs  
  inflating: OPatch/crs/crsconfig_lib.pm  
  inflating: OPatch/crs/oracss.pm    
  inflating: OPatch/crs/auto_patch.pl  
  inflating: OPatch/crs/s_crsconfig_lib.pm  
replace OPatch/opatch? [y]es, 
o, [A]ll, 
one, [r]ename: y
  inflating: OPatch/opatch           
   creating: OPatch/opatchprereqs/
   creating: OPatch/opatchprereqs/opatch/
  inflating: OPatch/opatchprereqs/opatch/runtime_prereq.xml  
  inflating: OPatch/opatchprereqs/opatch/opatch_prereq.xml  
  inflating: OPatch/opatchprereqs/opatch/rulemap.xml  
  inflating: OPatch/opatchprereqs/prerequisite.properties  
   creating: OPatch/opatchprereqs/oui/
  inflating: OPatch/opatchprereqs/oui/knowledgesrc.xml  
replace OPatch/opatch.ini? [y]es, 
o, [A]ll, 
one, [r]ename: A
  inflating: OPatch/opatch.ini       
  inflating: OPatch/emdpatch.pl      
  inflating: OPatch/opatch.pl        
  inflating: OPatch/jlib/opatchprereq.jar  
  inflating: OPatch/jlib/opatchactions.jar  
  inflating: OPatch/jlib/opatchutil.jar  
  inflating: OPatch/jlib/opatchfmw.jar  
  inflating: OPatch/jlib/opatchext.jar  
  inflating: OPatch/jlib/opatch.jar  
  inflating: OPatch/opatch.bat       
  inflating: OPatch/docs/Prereq_Users_Guide.txt  
  inflating: OPatch/docs/FAQ         
  inflating: OPatch/docs/Users_Guide.txt  
  inflating: OPatch/README.txt       
[oracle@app oracle]$ cd -
/opt/oracle/8350262       ###切换到补丁目录下
[oracle@app 8350262]$ /opt/oracle/OPatch/opatch  apply
Invoking OPatch 10.2.0.5.1
 
Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /opt/oracle/product/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-05-30_16-47-08PM.log
 
Patch history file: /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
 
ApplySession applying interim patch '8350262' to OH '/opt/oracle/product/10.2.0/db_1'
 
Running prerequisite checks...
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 
 
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, 
o) 
:  Y
 
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
 
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8350262' for restore. This might take a while...
Backing up files affected by the patch '8350262' for rollback. This might take a while...
 
Patching component oracle.sysman.agent.core, 10.2.0.4.0a...
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"
ApplySession adding interim patch '8350262' to inventory
 
Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.
 
OPatch succeeded.
[oracle@app 8350262]$ /opt/oracle/OPatch/opatch lsinventory ###查看已经安装的oracle补丁
Invoking OPatch 10.2.0.5.1
 
Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /opt/oracle/product/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-05-30_17-02-53PM.log
 
Patch history file: /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
 
Lsinventory Output file location : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-05-30_17-02-53PM.txt
 
--------------------------------------------------------------------------------
Installed Top-level Products (2): 
 
Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
There are 2 products installed in this Oracle Home.
 
 
Interim patches (1) :
 
Patch  8350262      : applied on Mon May 30 16:47:32 CST 2011
Unique Patch ID:  13011839
   Created on 14 Sep 2010, 04:59:44 hrs PST8PDT
   Bugs fixed:
     8350262
 
--------------------------------------------------------------------------------
 
OPatch succeeded.
[oracle@app 8350262]$ emctl secure dbconsole –reset  ##重新设置EM
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0  
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved. https://app:1158/em/console/aboutApplication Enter Enterprise Manager Root Password : 
DBCONSOLE already stopped...   Done.
Agent is already stopped...   Done.
Securing dbconsole...   Started.
Checking Repository...   Done.
Checking Em Key...   Done.
Checking Repository for an existing Enterprise Manager Root Key...
WARNING! An Enterprise Manager Root Key already exists in
the Repository. This operation will replace your Enterprise
Manager Root Key.
All existing Agents that use HTTPS will need to be
reconfigured if you proceed. Do you wish to continue and
overwrite your Root Key
(Y/N) ?
Y
Are you sure ? Reset of the Enterprise Manager Root Key
will mean that you will need to reconfigure each Agent
that is associated with this OMS before they will be
able to upload any data to it. Monitoring of Targets
associated with these Agents will be unavailable until
after they are reconfigured.
(Y/N) ?
Y
Generating Enterprise Manager Root Key (this takes a minute)...   Done.
Fetching Root Certificate from the Repository...   Done.
Updating HTTPS port in emoms.properties file...   Done.
Generating Java Keystore...   Done.
Securing OMS ...   Done.
Generating Oracle Wallet Password for Agent....   Done.
Generating wallet for Agent ...    Done.
Copying the wallet for agent use...    Done.
Storing agent key in repository...   Done.
Storing agent key for agent ...   Done.
Configuring Agent... 
Configuring Agent for HTTPS in DBCONSOLE mode...   Done.
EMD_URL set in /opt/oracle/product/10.2.0/db_1/app_BEE/sysman/config/emd.properties
   Done.
Configuring Key store..   Done.
Securing dbconsole...   Sucessful.
[oracle@app ~]$ emctl start dbconsole      ###启动EM: 可能需要重启系统
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0  
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved. https://app:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 10g Database Control ........................... started. 
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/app_BEE/sysman/log 
测试时:
[oracle@rac2 ~]$ cat load_test.sql
col instance_name  format a20
select instance_name from v$instance
/
[oracle@rac2 ~]$ cat rac_test.sh
#!/bin/sh
count=0
while [ $count  -lt $2 ]
do
   count='expr $count +1'
   sqlplus  -s system/oracle@$1 @load_test.sql
   sleep 1
done
[oracle@rac2 ~]$ sh rac_test.sh BEE   1000
 
INSTANCE_NAME
--------------------
bee1
SQL> select INSTANCE_NAME,count(*) from gv$instance group by INSTANCE_NAME;
 
INSTANCE_NAME      COUNT(*)
---------------- ----------
bee2                      1
bee1                      1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息