RAC上ocr和voting disk维护操作和需求1

Oracle从10.1开始推出了自己真正意义的集群软件(9i和9i之前的版本,Oracle只有集群数据库,集群的存储和网络是由第三方厂商维护的,比如IBM的HACMP,HPUX的MC SERVICE GUARD /OA,SUN的suncluster,True64的Trucluster,linux就用ocfs和check-timer等等)。
因此,从10.1开始,oracle的集群有了自己的管理网络和存储的机制,ocr存放集群配置信息,voting disk用于磁盘心跳。

本文就简单的汇总一下各版本对于ocr和voting disk在一些维护操作和安装需求大致做个总结。

1,各个版本ocr和vot的空间需求:

For 10.1:
OCR device minimum size (each): 100M
Voting disk minimum size (each): 20M
 
For 10.2:
OCR device minimum size (each): 256M
Voting disk minimum size (each): 256M
 
For 11.1:
OCR device minimum size (each): 280M
Voting disk minimum size (each): 280M
 
For 11.2:
OCR device minimum size (each): 300M
Voting disk minimum size (each): 300M
2,各个版本ocr和vot的磁盘组权限:

For OCR device:
chown root:oinstall <OCR device>
chmod 640 <OCR device>
 
For Voting device:
chown <crs/grid>:oinstall <Voting device>
chmod 644 <Voting device>
 
For ASM disks used for OCR/Voting disk:
chown griduser:asmadmin <asm disks>
chmod 660 <asm disks>
3,voting disk个数的要求:

For Voting disks (never use even number of voting disks):
External redundancy requires minimum of 1 voting disk (or 1 failure group)
Normal redundancy requires minimum of 3 voting disks (or 3 failure group)
High redundancy requires minimum of 5 voting disks (or 5 failure group)
4,OCR个数的要求:

10.2 and 11.1, maximum 2 OCR devices: OCR and OCRMIRROR
11.2+, upto 5 OCR devices can be added.
5,各版本操作命令的差异:

1)ocrconfig -replace也可以用来替换ocr。
如果用这个命令,请注意11.2以后的 Bug 8604794 – FAIL TO CHANGE OCR LOCATION TO DG WITH ‘OCRCONFIG -REPAIR -REPLACE’
2)添加ocr的镜像,10.2和11.1只能用ocrconfig -replace ocrmirror来做,11.2用add
3)替换,10.2和11.1用ocrconfig -replace,11.2用ocrconfig -add,再ocrconfig -delete
4)对于vot,10.2的add和delete都需要force选项,例如; crsctl add css votedisk -force;
11.1以后(包括11.2),除了windows平台,Linux和unix平台都不需要force了
例:添加、删除oracle 11g的ocr磁盘

1)检查当前的ocr所在磁盘:
[grid@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2720
         Available space (kbytes) :     259400
         ID                       : 1510791855
         Device/File Name         :  +OCR_VOTE
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user
检查OCR在linux系统下的配置文件(/etc/oracle/ocr.loc)
[root@rac1 oracle]# more ocr.loc
#Device/file  getting replaced by device +OCR_VOTE
ocrconfig_loc=+OCR_VOTE
local_only=false

2)添加+DATE1作为新的存放ocr的磁盘组:
[grid@rac1 ~]$ ocrconfig -add +DATE1
PROT-20: Insufficient permission to proceed. Require privileged user
切换root用户
[root@rac1 bin]# ./ocrconfig -add +DATE1
[grid@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2720
         Available space (kbytes) :     259400
         ID                       : 1510791855
         Device/File Name         :  +OCR_VOTE
                                    Device/File integrity check succeeded
         Device/File Name         :     +DATE1
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user
检查OCR在linux系统下的配置文件(/etc/oracle/ocr.loc)         
[root@rac1 oracle]# more ocr.loc
#Device/file  +OCR_VOTE getting replaced by device +DATE1
ocrconfig_loc=+OCR_VOTE
ocrmirrorconfig_loc=+DATE1
local_only=false

3)删除+OCR_VOTE上的ocr:
[root@rac1 bin]# ./ocrconfig -delete +OCR_VOTE
[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2720
         Available space (kbytes) :     259400
         ID                       : 1510791855
         Device/File Name         :     +DATE1
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check succeeded
检查OCR在linux系统下的配置文件(/etc/oracle/ocr.loc) 
[root@rac1 oracle]# more ocr.loc
#Device/file +OCR_VOTE being deleted 
ocrconfig_loc=+DATE1
local_only=false
例:修改voting disk磁盘位置

查看voting disk当前存放在哪个磁盘组
[grid@rac1 client]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   084fec0c7a4f4f2cbf63b61e46a73331 (/dev/raw/raw3) [OCR_VOTE]
 2. ONLINE   748dc79ee4614f45bfc76e3fb78a58d9 (/dev/raw/raw2) [OCR_VOTE]
 3. ONLINE   5ff80e77545e4f20bfd673774e560869 (/dev/raw/raw1) [OCR_VOTE]
Located 3 voting disk(s).
[grid@rac1 ~]$ asmcmd -p lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  4194304      3912     1576                0            1576              0             N  DATE1/
MOUNTED  NORMAL  N         512   4096  1048576      5883     4957              310            2323              0             N  OCR_VOTE/
将voting disk替换到+DATE1磁盘组:
[grid@rac1 ~]$ crsctl replace votedisk +DATE1
Successful addition of voting disk 824e6c4304a14ff0bf0e7d774c80b1bf.
Successful deletion of voting disk 084fec0c7a4f4f2cbf63b61e46a73331.
Successful deletion of voting disk 748dc79ee4614f45bfc76e3fb78a58d9.
Successful deletion of voting disk 5ff80e77545e4f20bfd673774e560869.
Successfully replaced voting disk group with +DATE1.
CRS-4266: Voting file(s) successfully replaced
[grid@rac1 ~]$ 
[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   824e6c4304a14ff0bf0e7d774c80b1bf (/dev/raw/raw5) [DATE1]
Located 1 voting disk(s).
[grid@rac1 ~]$ asmcmd -p lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  4194304      3912     1544                0            1544              0             N  DATE1/
MOUNTED  NORMAL  N         512   4096  1048576      5883     5053              278            2387              0             N  OCR_VOTE/
部分转自http://www.lunar2013.com/









你可能感兴趣的:(RAC,disk,ocr,votding)