grid 版本:11.2.0.4.0
GPnP profile
Gpnp profile文件是一个xml文件,它存储的位置是在$GRID_HOME/gpnp/profile/peer/profile.xml
当集群启动的时候,Cluster Synchronization Services (CSS)将扫描所有的ASM disks,它利用的是GPnP profile文件中的ASM discovery string.如下所示:
<orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
<orcl:ASM-Profile id="asm" DiscoveryString="/dev/" SPFile="+DATA/rac-scan/asmparameterfile/registry.253.790450611"/>
gpnptool工具可以查看gpmp pfofile 内容:
[grid@prod01 ~]$ gpnptool get -o-
<?xml version="1.0" encoding="UTF-8"?><gpnp:GPnP-Profile 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="4" ClusterUId="158afe4ecd6dff76bfdfcb0a73c44320" ClusterName="prod-cluster" PALocation=""><gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*"><gpnp:Network id="net1" IP="192.168.0.0" Adapter="eth0" Use="public"/><gpnp:Network id="net2" IP="12.168.0.0" Adapter="eth1" Use="cluster_interconnect"/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/><orcl:ASM-Profile id="asm" DiscoveryString="/dev/*" SPFile="+DATA/prod-cluster/asmparameterfile/registry.253.990525365"/><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl xsi"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>omBcXU12u7D2rNJWiLbiRlEenpU=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>GdjloSdmpnW0iuhLVAmR9bhQknVPxAvVuVpOVaQR3ZZO35ff164e9QYlXtQgfL2/63fA/YwpeQhi8uwMtqEjddFaFw8wCxm8RyMOa+6WcCMMBceIycgTNaMMnw93hGcmrYYClh3lt+2ACV3gkcjB3VTB82WfZEvvvcTZ1OTukVk=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
Success.
定位votedisk
CSSD scans the headers of all ASM disks ( as indicated in ASM_DISKSTRING in GPnP profile) to identify the disk containing the voting file. Using the pointers in ASM disk headers, the Voting Files locations on ASM Disks are accessed by CSSD and CSSD is able to complete initialization and start or join an existing cluster.
css通过gpnp profile 文件的DiscoveryString确定votedisk 发现路径,然后扫描该路径下的磁盘的磁盘头信息。
kfdhdb.vfstart 是votedisk开始AU的偏移量,kfdhdb.vfend是votedisk结束AU偏移量。通过这2个值确定vd文件的位置
[grid@prod01 dev]$ kfed read /dev/asm-diskb |grep -E 'vf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.vfstart: 256 ; 0x0ec: 0x00000100
kfdhdb.vfend: 288 ; 0x0f0: 0x00000120
[grid@prod01 dev]$ kfed read /dev/asm-diskc |grep -E 'vf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.vfstart: 256 ; 0x0ec: 0x00000100
kfdhdb.vfend: 288 ; 0x0f0: 0x00000120
[grid@prod01 dev]$ kfed read /dev/asm-diskd |grep -E 'vf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.vfstart: 256 ; 0x0ec: 0x00000100
kfdhdb.vfend: 288 ; 0x0f0: 0x00000120
[grid@prod01 dev]$ kfed read /dev/asm-test01 |grep -E 'vf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
[grid@prod01 dev]$ kfed read /dev/asm-test02 |grep -E 'vf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
定位asm spfile
通过kfdhdb.spfile,kfdhdb.spfflg标志确定asm spfile 位置,启动asm实例。
kfdhdb.spfile:
Allocation unit number of the ASM spfile. Version 11.2 and later only.
kfdhdb.spfflg:
ASM spfile flag. If this is 1, the ASM spfile is on this disk in allocation unit kfdhdb.spfile. Version 11.2 and later only.
[grid@prod01 dev]$ kfed read /dev/asm-diskb |grep -E 'spf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.spfile: 59 ; 0x0f4: 0x0000003b
kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001
[grid@prod01 dev]$ kfed read /dev/asm-diskc |grep -E 'spf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
[grid@prod01 dev]$ kfed read /dev/asm-diskd |grep -E 'spf|au'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.spfile: 59 ; 0x0f4: 0x0000003b
kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001
[grid@prod01 dev]$ asmcmd
lASMCMD> sdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 15360 14434 5120 4657 0 Y DATA/
MOUNTED EXTERN N 512 4096 1048576 6144 6047 0 6047 0 N DG1/
ASMCMD> exit
[grid@prod01 dev]$ asmcmd spget
+DATA/prod-cluster/asmparameterfile/registry.253.990525365
When an Oracle ASM instance searches for an initialization parameter file, the search order is:
The location of the initialization parameter file specified in the Grid Plug and Play (GPnP) profile
If the location has not been set in the GPnP profile, then the search order changes to:
SPFILE in the Oracle ASM instance home
For example, the SPFILE for Oracle ASM has the following default path in the Oracle Grid Infrastructure home in a Linux environment:
$ORACLE_HOME/dbs/spfile+ASM.ora
PFILE in the Oracle ASM instance home