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/









oracle rac日常基本维护命令 所有实例和服务的状态 $ srvctl status database -d orcl Instance orcl1 is running on node linux1 Instance orcl2 is running on node linux2 单个实例的状态 $ srvctl status instance -d orcl -i orcl2 Instance orcl2 is running on node linux2 在数据库全局命名服务的状态 $ srvctl status service -d orcl -s orcltest Service orcltest is running on instance(s) orcl2, orcl1 特定节点上节点应用程序的状态 $ srvctl status nodeapps -n linux1 VIP is running on node: linux1 GSD is running on node: linux1 Listener is running on node: linux1 ONS daemon is running on node: linux1 ASM 实例的状态 $ srvctl status asm -n linux1 ASM instance +ASM1 is running on node linux1. 列出配置的所有数据库 $ srvctl config database orcl 显示 RAC 数据库的配置 $ srvctl config database -d orcl linux1 orcl1 /u01/app/oracle/product/10.2.0/db_1 linux2 orcl2 /u01/app/oracle/product/10.2.0/db_1 显示指定集群数据库的所有服务 $ srvctl config service -d orcl orcltest PREF: orcl2 orcl1 AVAIL: 显示节点应用程序的配置 —(VIP、GSD、ONS、监听器) $ srvctl config nodeapps -n linux1 -a -g -s -l VIP exists.: /linux1-vip/192.168.1.200/255.255.255.0/eth0:eth1 GSD exists. ONS daemon exists. Listener exists. 显示 ASM 实例的配置 $ srvctl config asm -n linux1 +ASM1 /u01/app/oracle/product/10.2.0/db_1 集群中所有正在运行的实例 SELECT inst_id , instance_number inst_no , instance_name inst_name , parallel , status , database_status db_status , active_state state , host_name host FROM gv$instance ORDER BY inst_id; INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST -------- -------- ---------- --- ------- ------------ --------- ------- 1 1 orcl1 YES OPEN ACTIVE NORMAL rac1 2 2 orcl2 YES OPEN ACTIVE NORMAL rac2 位于磁盘组中的所有数据文件 select name from v$datafile union select member from v$logfile union select name from v$controlfile union select name from v$tempfile; NAME ------------------------------------------- +FLASH_RECOVERY_AREA/orcl/controlfile/current.258.570913191 +FLASH_RECOVERY_AREA/orcl/onlinelog/group_1.257.570913201 +FLASH_RECOVERY_AREA/orcl/onlinelog/group_2.256.570913211 +FLAS
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值