从11gR2开始,RAC的ocr和vote开始通过创建一个磁盘组的形式共同存在于ASM中, 从而很好的控制了10g中仍需要为这2个RAC节点划分相应的设备, 并且相应的ASM的spfile也可以存放到ASM diskgroup中以实现多节点ASM的共享管理了。
不过这听上去似乎有些不可思议,照常理来说 ASM实例启动并mount diskgroup后才能够访问diskgroup上的文件, 但是ASM实例只有获得ASM spfile后才能够启动实例,这2者形成了死循环。到底是先启动ASM实例还是RAC先管理到OCRVOTE磁盘组呢。下面我们通过一系列的实验及说明来解释这个问题:
从11.2开始Oracle Cluterware标示voting disk files的方法较之前的版本11.1或10.2有所区别,11.2之前voting disk file的位置存放在OCR中, 但是因为从11.2开始ocr和votedisk可以存放在ASM了 , 所以自11.2始voting disk file通过GPNP profile中的CSS voting file discovery string来定位。
CSS voting disk file的discovery string将指向ASM,所以它要使用ASM discovery string的值。我们利用gpnptool get命令获得gpnp profile:
[grid@s1-11g ~]$ gpnptool get
Warning: some command line parameters were defaulted. Resulting command line:
/oracle/grid/bin/gpnptool.bin get -o-
jifUhk40NCZKYHu9E2s9wHZpt+M=OxCHW6vbO+hmX6HnEL6KO1t5gJNv2uBP3406XaLPKc3265v+m29znkwTXXo1erFFr/FeP3Da2wit3vkcckGT4UquuLJ1nEfmDBAAkfJIFYfDoWF6RwDLj9VW8jK1fO8lSjlb2DGrkBE9KdB5llz+uFzUSzdgtY0x1bwL9hM9KOg=
Success.
其中重要的2条记录:
==》css voting disk指向+ASM
==》该记录表达了ASM的DiscoveryString=”/dev/asm*”,即ASM实例启动时会去寻找的设备路径,SPFILE记录了ASM Parameter FILE的ALIAS
但是请注意虽然GPNP记录了ASM Parameter FILE的ALIAS,但这不代表ASM直接能访问到该SPFILE,在实际Diskgroup被Mount之前光知道一个ASM ALIAS是没有用的。
我们来看一下+OCRVOTE/s1-11g-cluster/asmparameterfile/registry.253.824566899这个SPFILE在ASM中所处的位置:
[grid@s1-11g ~]$ sqlplus "/ as sysasm"
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 18 13:38:04 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> set linesize 140 pagesize 1400
SQL> col "FILE NAME" format a40
SQL> set head on
SQL> select NAME "FILE NAME",
2 AU_KFFXP "AU NUMBER",
3 NUMBER_KFFXP "FILE NUMBER",
4 DISK_KFFXP "DISK NUMBER"
5 from x$kffxp, v$asm_alias
6 where GROUP_KFFXP = GROUP_NUMBER
7 and NUMBER_KFFXP = FILE_NUMBER
8 and name in ('REGISTRY.253.824566899')
9 order by DISK_KFFXP,AU_KFFXP;
FILE NAME AU NUMBER FILE NUMBER DISK NUMBER
---------------------------------------- ---------- ----------- -----------
REGISTRY.253.824566899 59 253 1
REGISTRY.253.824566899 59 253 2
SQL> col path for a50
SQL> select disk_number,path from v$asm_disk where disk_number in (1,2) and GROUP_NUMBER=2;
DISK_NUMBER PATH
----------- --------------------------------------------------
1 /dev/asm-nocr2
2 /dev/asm-nocr1
可以看到该ASM SPFILE共有2份镜像(redundancy=high),分别保留在 /dev/asm-nocr2的AU=59和/dev/asm-nocr1 AU=59
我们利用kfed命令分别检查这三个ASM DISK的header:
[grid@s1-11g ~]$ kfed read /dev/asm-nocr2|grep spfile
kfdhdb.spfile: 59 ; 0x0f4: 0x0000003b
[grid@s1-11g ~]$ kfed read /dev/asm-nocr1|grep spfile
kfdhdb.spfile: 59 ; 0x0f4: 0x0000003b
可以看到ASM disk header的kfdhdb.spfile指向ASM SPFILE在这个DISK上的AU NUMBER即其位置, ASM实例在启动时只需要通过GPNP PROFILE中的 DiscoveryString找到合适的设备路径,并读取其ASM disk header即可以找到kfdhdb.spfile这个位置属性,从而在没有MOUNT DISKGROUP的情况下读取ASM SPFILE,并成功启动ASM, 这也就解决了鸡生蛋、蛋生鸡的难题。
这也是我们在后台日志中看到的gpnp启动:
2013-08-27 14:22:41.603
[gpnpd(10544)]CRS-2328:GPNPD started on node s1-11g.
2013-08-27 14:22:44.580
[cssd(10608)]CRS-1713:CSSD daemon is started in clustered mode
2013-08-27 14:22:46.573
[ohasd(9248)]CRS-2767:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE
2013-08-27 14:24:10.235
[cssd(10608)]CRS-1707:Lease acquisition for node s1-11g number 1 completed
2013-08-27 14:24:11.934
[cssd(10608)]CRS-1605:CSSD voting file is online: /dev/asm-ocr_vote; details in /oracle/grid/log/s1-11g/cssd/ocssd.log.
2013-08-27 14:24:11.962
[cssd(10608)]CRS-1605:CSSD voting file is online: /dev/asm-nocr2; details in /oracle/grid/log/s1-11g/cssd/ocssd.log.
2013-08-27 14:24:11.986
[cssd(10608)]CRS-1605:CSSD voting file is online: /dev/asm-nocr1; details in /oracle/grid/log/s1-11g/cssd/ocssd.log.
来源:CSDN
作者:andy-2019
链接:https://blog.csdn.net/weixin_44799695/article/details/103456943