从ocr磁盘里获取asm spfile和voting file
环境:
OS:Centos 7
DB:12.2.0.1
当Oracle ASM实例查找初始化参数文件时,会从GPnP profile文件中查找
获取spfile文件
[grid@rac01 ~]$ cd $ORACLE_HOME/gpnp/rac01/profiles/peer
[grid@rac01 peer]$ gpnptool getpval -asm_spf
Warning: some command line parameters were defaulted. Resulting command line:
/u01/grid/grid_home/12.2.0.1/bin/gpnptool.bin getpval -asm_spf -p=profile.xml -o-
+OCR/rac-cluster/ASMPARAMETERFILE/registry.253.1154785957
获取ocr磁盘路径
[grid@rac01 peer]$ gpnptool getpval -p=profile.xml -asm_dis -o-
/dev/mapper/*
1.从ocr磁盘里获取asm spfile文件内容
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk01 | grep -E 'spf|ausize'
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk02 | grep -E 'spf|ausize'
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk03 | grep -E 'spf|ausize'
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
kfdhdb.spfile: 2177 ; 0x0f4: 0x00000881
kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk04 | grep -E 'spf|ausize'
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
这里spfile就存放在/dev/mapper/ocrdisk03
[grid@rac01 peer]$ dd if=/dev/mapper/ocrdisk03 of=/tmp/ASMspfile_copy.ora skip=2177 bs=4M count=1
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00781124 s, 537 MB/s
[grid@rac01 peer]$ strings /tmp/ASMspfile_copy.ora | more
+ASM1.__oracle_base='/u01/grid/grid_base'#ORACLE_BASE set from in memory value
+ASM2.__oracle_base='/u01/grid/grid_base'#ORACLE_BASE set from in memory value
*.asm_diskgroups='DATA','OCR','ARCH'#Manual Mount
*.asm_diskstring='/dev/mapper/*'
*.asm_power_limit=1
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
2.获取voting file
同样的方式也可以查找voting file
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk01 | grep vf
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk02 | grep vf
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk03 | grep vf
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
[grid@rac01 peer]$ kfed read /dev/mapper/ocrdisk04 | grep vf
kfdhdb.vfstart: 24 ; 0x0ec: 0x00000018
kfdhdb.vfend: 32 ; 0x0f0: 0x00000020
这里voting file就存放在/dev/mapper/ocrdisk04,使用如下命令查询也是返回/dev/mapper/ocrdisk04
[grid@rac01 peer]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE e3d7ba56bf7f4fbfbffae07e1611e53a (/dev/mapper/ocrdisk04) [OCR]
Located 1 voting disk(s).