As you aware spfile located in asm disks only starting 11gR2 in cluster environment.
When CRSD need to start the various resources of the node or updates it changes in OCR. the location of spfile also should known to crsd.
Here the gpnp profile comes into handy. (read more here for gpnp)
The order of searching for spfile is,
- GPnP profile
- ORACLE_HOME/dbs/spfile<sid.ora>
- ORACLE_HOME/dbs/init<sid.ora>
For example if my gpnp profile contains the spfile location as ASM disk group
Sample profile.xml in $GRID_HOME/gpnp/profiles/peer.
[root@host01 peer]# gpnptool get
<?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="
.....
ClusterName="cluster01" PALocation=""><gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*"><gpnp:Network id="net1" IP="192.9.201.0" Adapter="eth0" Use="public"/><gpnp:Network id="net2" IP="10.0.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="" SPFile="+DATA/cluster01/asmparameterfile/registry.253.783619911"/>
....
</gpnp:GPnP-Profile>
Or using the gpnptool, find the spfile location.
[grid@host01 peer]$ gpnptool getpval -asm_spf
Warning: some command line parameters were defaulted. Resulting command line:
/u01/app/11.2.0/grid/bin/gpnptool.bin getpval -asm_spf -p=profile.xml -o-
+DATA/cluster01/asmparameterfile/registry.253.793721441
The output of the query shows that SPfile is on ASM in DATA diskgroup. To find out the
location of ASM disks, do the following
[root@host01 peer]# gpnptool getpval -asm_dis
ASM-Profile id="asm" DiscoveryString=""
Note the discovery string is empty, means all the disks of ASM (in /dev/oracleasm/disks) will be scanned for spfile.
[root@host01 ~]# kfed read /dev/sdb3 | grep -E 'spf|ausize' kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000 kfdhdb.spfile: 16 ; 0x0f4: 0x00000010 kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001
In the output above, we see that
kfed is the utility resides in ORACLE_HOME/bin which can read the disk header
the device /dev/sdb1 contains a copy of the ASM spfile (spfflg=1).
The ASM spfile location starts at the disk offset of 16 (spfile=16)
Considering the allocation unit size (kfdhdb.ausize = 1M), let's dump the ASM spfile from the device:
[root@host01 ~]# dd if=/dev/sdb3 of=spfileASM_Copy2.ora skip=16 bs=1M count=1 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.170611 seconds, 6.1 MB/s [root@host01 ~]# strings spfileASM_Copy2.ora +ASM1.__oracle_base='/u01/app/grid'#ORACLE_BASE set from in memory value +ASM2.__oracle_base='/u01/app/grid'#ORACLE_BASE set from in memory value +ASM3.__oracle_base='/u01/app/grid'#ORACLE_BASE set from in memory value +ASM3.asm_diskgroups='FRA'#Manual Mount +ASM2.asm_diskgroups='FRA'#Manual Mount +ASM1.asm_diskgroups='FRA'#Manual Mount *.asm_power_limit=1 *.diagnostic_dest='/u01/app/grid' *.instance_type='asm' *.large_pool_size=12M *.remote_login_passwordfile='EXCLUSIVE'
Now we have got the spfile from the asm disk directly, you can create your own pfile etc. Same case applies to rdbms spfile too.
-Thanks
Geek DBA
Follow Me!!!