ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC添加和删除OCR及VoteDisk

RAC添加和删除OCR及VoteDisk

原创 Linux操作系统 作者:aaqwsh 时间:2011-05-08 14:13:45 0 删除 编辑
以下操作都是在虚拟机上和版本oracle 10.2.0.1上完成的:
最近准备仔细学习一下rac,根据《大话oracle rac》,于是练习一下添加和删除OCR及VoteDisk:
 
原来的环境为:
[root@node1 ~]# cd /dev/raw
[root@node1 raw]# ll
total 0
crw-r----- 1 oracle oinstall 162, 1 May  8 09:34 raw1
crw-r----- 1 oracle oinstall 162, 2 May  8 09:34 raw2
crw-r----- 1 oracle oinstall 162, 3 May  8 09:32 raw3
crw-r----- 1 oracle oinstall 162, 4 May  8 09:32 raw4
 
加了3块硬盘:
[root@node1 raw]# ll
total 0
crw-r----- 1 oracle oinstall 162, 1 May  8 09:56 raw1
crw-r----- 1 oracle oinstall 162, 2 May  8 09:55 raw2
crw-r----- 1 oracle oinstall 162, 3 May  8 09:56 raw3
crw-r----- 1 oracle oinstall 162, 4 May  8 09:56 raw4
crw-r----- 1 oracle oinstall 162, 5 May  8 09:56 raw5
crw-r----- 1 oracle oinstall 162, 6 May  8 09:56 raw6
crw-r----- 1 oracle oinstall 162, 7 May  8 09:56 raw7
 
在添加ocr的时候报错PROT-22: Storage too small,在网上查了一下为bug,可通过升级解决,还有另外的办法就是增大硬盘。
[root@node1 crs]# ocrconfig -export ocrexp.exp -s online  
[root@node1 crs]#
[root@node1 crs]# ls -al
total 12000
drwxrwxr-x 2 oracle oinstall    4096 May  8 10:13 .
drwxrwxr-x 4 oracle oinstall    4096 Aug 22  2010 ..
-rw-r--r-- 1 root   root     4026368 Nov 21 19:04 backup00.ocr
-rw-r--r-- 1 root   root     4026368 Nov 21 19:04 day.ocr
-rw-r--r-- 1 root   root       86752 May  8 10:13 ocrexp.exp
-rw-r--r-- 1 root   root       86750 May  8 10:12 ocrexp.ocr
-rw-r--r-- 1 root   root     4026368 Nov 21 19:04 week.ocr
[root@node1 crs]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       3840
         Available space (kbytes) :     100504
         ID                       :  912938640
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded
                                    Device/File not configured
         Cluster registry integrity check succeeded
 
[root@node1 crs]# ocrconfig -replace ocrmirror /dev/raw/raw7
PROT-22: Storage too small
[root@node1 crs]# crsctl query crs softwareversion
CRS software version on node [node1] is [10.2.0.1.0]
 
我原来的硬盘为107M,这次增加的为256M(虚拟机操作起来比较方便,懒得升级):
[root@node1 raw]# ocrconfig -replace ocrmirror /dev/raw/raw7
[root@node1 raw]#
[root@node1 raw]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       3848
         Available space (kbytes) :     100496
         ID                       :  912938640
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw7
                                    Device/File integrity check succeeded
         Cluster registry integrity check succeeded
[root@node1 raw]# ocrconfig -replace ocr /dev/raw/raw7
PROT-21: Invalid parameter
[root@node1 raw]# ocrconfig -replace ocr
[root@node1 raw]#
[root@node1 raw]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     250776
         Used space (kbytes)      :       3848
         Available space (kbytes) :     246928
         ID                       :  912938640
         Device/File Name         : /dev/raw/raw7
                                    Device/File integrity check succeeded
                                    Device/File not configured
         Cluster registry integrity check succeeded
 
增加votedisk:
[root@node1 crs]# crsctl query css votedisk
 0.     0    /dev/raw/raw1
located 1 votedisk(s).
[root@node1 crs]#
[root@node1 crs]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@node1 crs]# crsctl add css votedisk /dev/raw/raw5
Cluster is not in a ready state for online disk addition
[root@node1 crs]# crsctl add css votedisk /dev/raw/raw5 -force
Now formatting voting disk: /dev/raw/raw5
successful addition of votedisk /dev/raw/raw5.
[root@node1 crs]# crsctl add css votedisk /dev/raw/raw6 -force
Now formatting voting disk: /dev/raw/raw6
successful addition of votedisk /dev/raw/raw6.
[root@node1 crs]# crsctl query css votedisk
 0.     0    /dev/raw/raw1
 1.     0    /dev/raw/raw5
 2.     0    /dev/raw/raw6
located 3 votedisk(s).
[root@node1 crs]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
 
另外,记录一下rhel5 里裸设备的映射, SCSI设备的major number 是8,minor number=driver*16+partition number:
[root@node2 raw]# cat /etc/udev/rules.d/60-raw.rules
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
#
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add", KERNEL=="/dev/sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"
ACTION=="add", KERNEL=="/dev/sde1",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="65",RUN+="/bin/raw /dev/raw/raw4 %M %m"
ACTION=="add", KERNEL=="/dev/sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="81",RUN+="/bin/raw /dev/raw/raw5 %M %m"
ACTION=="add", KERNEL=="/dev/sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="97",RUN+="/bin/raw /dev/raw/raw6 %M %m"
ACTION=="add", KERNEL=="/dev/sdh1",RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="113",RUN+="/bin/raw /dev/raw/raw7 %M %m"
KERNEL=="raw[1-7]", WNER="oracle", GROUP="oinstall", MODE="640"
 
[root@node2 raw]# start_udev
Starting udev:                                             [  OK  ]
 
[root@node2 ~]# cd /dev/raw
[root@node2 raw]# ll
total 0
crw-r----- 1 oracle oinstall 162, 1 May  8 10:03 raw1
crw-r----- 1 oracle oinstall 162, 2 May  8 10:03 raw2
crw-r----- 1 oracle oinstall 162, 3 May  8 10:03 raw3
crw-r----- 1 oracle oinstall 162, 4 May  8 10:03 raw4
crw-r----- 1 oracle oinstall 162, 5 May  8 10:03 raw5
crw-r----- 1 oracle oinstall 162, 6 May  8 10:03 raw6
crw-r----- 1 oracle oinstall 162, 7 May  8 10:03 raw7

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/758322/viewspace-694763/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-24

  • 博文量
    132
  • 访问量
    262279