[grid@znode1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
从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的值。 如以下的例子使用udev绑定设备名作为ASM使用的LUN, 这些udev获得的设备形式如/dev/rasm-disk* , 我们利用gpnptool get命令获得gpnp profile:
[grid@maclean1
trace]$ gpnptool get
Warning:
some command line parameters were defaulted. Resulting command line:
/g01/grid/app/11.2.0/grid/bin/gpnptool.bin
get -o-
<?xml
version="1.0" encoding="UTF-8"?> Version="1.0"
xmlns="http://www.grid-pnp.org/2005/11/gpnp-profile"
xmlns:gpnp="http://www.grid-pnp.org/2005/11/gpnp-profile"
xmlns:orcl="http://www.oracle.com/gpnp/2005/11/gpnp-profile"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile
gpnp-profile.xsd"
ProfileSequence="9"
ClusterUId="452185be9cd14ff4ffdc7688ec5439bf"
ClusterName="maclean-cluster"
PALocation=""> id="gen"
HostName="*"> id="net1" IP="192.168.1.0" Adapter="eth0"
Use="public"/> id="net2" IP="172.168.1.0" Adapter="eth1"
Use="cluster_interconnect"/><
orcl:CSS-Profile
id="css" DiscoveryString="+asm"
LeaseDuration="400"/> DiscoveryString="/dev/rasm*"
SPFile="+SYSTEMDG/maclean-cluster/asmparameterfile/registry.253.788682933"/><
ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> URI=""> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"
PrefixList="gpnp
orcl xsi"/><
ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>L1SLg10AqGEauCQ4ne9quucITZA=<
/ds:Reference>rTyZm9vfcQCMuian6isnAThUmsV4xPoK2fteMc1l0GIvRvHncMwLQzPM/QrXCGGTCEvgvXzUPEKzmdX2oy5vLcztN60UHr6AJtA2JYYodmrsFwEyVBQ1D6wH+HQiOe2SG9UzdQnNtWSbjD4jfZkeQWyMPfWdKm071Ek0Rfb4nxE=
Success.
其中重要的2条记录:
id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/>
==》css voting disk指向+ASM
< orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/rasm*”
SPFile=”+SYSTEMDG/maclean-cluster/asmparameterfile/registry.253.788682933″/>
==》该记录表达了ASM的DiscoveryString=”/dev/rasm*”,即ASM实例启动时会去寻找的设备路径,SPFILE记录了ASM Parameter FILE的ALIAS
但是请注意虽然GPNP记录了ASM Parameter FILE的ALIAS,但这不代表ASM直接能访问到该SPFILE,在实际Diskgroup被Mount之前光知道一个ASM ALIAS是没有用的。
[grid@znode1 ~]$ kfed read /dev/raw/raw1|more
kfbh.type: 1 ; 0x002:
KFBTYP_DISKHEAD --Indicates that this is
ASM disk header
kfdhdb.dsknum: 0 ; 0x024: 0x0000 -- disk number
kfdhdb.grptyp: 2 ; 0x026:
KFDGTP_NORMAL -- Indicates mirroring
level, in my case it is NORMAL
kfdhdb.hdrsts: 3 ; 0x027:
KFDHDR_MEMBER -- number of member
kfdhdb.dskname: CRSDG_0000 ; 0x028:
length=10 -- disk name
kfdhdb.grpname: CRSDG ; 0x048: length=5 -- disk group name
kfdhdb.fgname: CRSDG_0000 ; 0x068: length=10 -- To which failure group this disk
belongs
kfdhdb.secsize: 512 ; 0x0b8: 0x0200 -- Disk sector size
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000 -- Disk block size
kfdhdb.ausize:
1048576 ; 0x0bc:
0x00100000 -- Disk au size
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 964 ; 0x0c4:
0x000003c4 -- disk total size MB
kfdhdb.vfstart: 256 ; 0x0ec: 0x00000100 -- Begin block address of voting disk
file
kfdhdb.vfend: 288 ; 0x0f0:
0x00000120 -- End block address of
voting disk file
kfdhdb.spfile: 59 ; 0x0f4:
0x0000003b -- Begin block address
of spfile
kfdhdb.spfflg: 1 ; 0x0f8:
0x00000001 -- Number of blocks
containing spfile
从X$KFFXP也可以查询到这个位置
X$KFFXP contains the physical allocation table for each
ASM file, that is it contains the mapping between ASM files (identified by
columns NUMBER_KFFXP and COMPOUND_KFFXP) and their location on disk is
Column Name
Description
ADDR
table address/identifier
INDX
row identifier
INST_ID
instance number (RAC)
NUMBER_KFFXP
ASM file number. Join with v$asm_file and v$asm_alias
COMPOUND_KFFXP
File identifier. Join with compound_index in v$asm_file
INCARN_KFFXP File
incarnation id. Join with incarnation in v$asm_file
PXN_KFFXP
Extent number per file
XNUM_KFFXP
Logical extent number per file (mirrored extents have the same value)
GROUP_KFFXP
ASM disk group number. Join with v$asm_disk and v$asm_diskgroup
DISK_KFFXP
Disk number where the extent is allocated. Join with v$asm_disk
AU_KFFXP
Relative position of the allocation unit from the beginning of the disk.
The allocation unit size (1 MB) in v$asm_diskgroup
LXN_KFFXP
0,1 used to identify primary/mirror extent, 2 identifies file header
allocation unit (hypothesis)
FLAGS_KFFXP
N.K.
CHK_KFFXP
N.K.
SQL> select NAME "FILE NAME",
2 AU_KFFXP "AU NUMBER",
3 NUMBER_KFFXP "FILE
NUMBER",
4 GROUP_Number,
5 DISK_KFFXP "DISK NUMBER"
6 from x$kffxp, v$asm_alias
7 where GROUP_KFFXP =
GROUP_NUMBER
8 and NUMBER_KFFXP = FILE_NUMBER
9 and lower(name)
='registry.253.787925627'
10 ;
FILE NAME AU NUMBER FILE
NUMBER GROUP_NUMBER DISK NUMBER
---------------------------------------- ----------
----------- ------------ -----------
REGISTRY.253.787925627 59 253 1 0
REGISTRY.253.787925627 59 253 1 2
SQL> select group_number,path,disk_number from
v$asm_disk order by 1,3;
GROUP_NUMBER PATH DISK_NUMBER
------------ -------------------- -----------
1
/dev/raw/raw1 0
1
/dev/raw/raw2 1
1
/dev/raw/raw3 2
2
/dev/raw/raw4 0
2
/dev/raw/raw5 1
3
/dev/raw/raw6 0
6 rows selected.
SQL> select group_number,name from v$asm_diskgroup;
GROUP_NUMBER NAME
------------ ------------------------------
1 CRSDG
2 DBDG
3 FLRV
[grid@maclean1
wallets]$ kfed read /dev/raw/raw1|grep spfile
kfdhdb.spfile: 59 ; 0x0f4: 0x00000023
[grid@maclean1
wallets]$ kfed read /dev/raw/raw2|grep spfile
kfdhdb.spfile: 59 ; 0x0f4: 0x00000027
所以得出的结论是
OHASD–>OLR—–>GPNP
profile(DiscoveryString)—>asm_disk物理路径—>扫描所有disk header,得到spfile物理位置—>直接路径读spfile—>启动ASM—>如有更新同步OLR
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29065182/viewspace-1151218/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29065182/viewspace-1151218/