Database Reference
In-Depth Information
Run against an ASM instance, the five-way join below retrieves all the information that is
required to retrieve an SPFILE from ASM storage with the UNIX command dd . 1 The query receives
the name of the SPFILE as input (not the absolute path within the disk group, which would be
assigned to the parameter SPFILE ). The following example is from a disk group with external
redundancy. Thus, there is merely the primary allocation unit and no second allocation unit
for mirroring.
SQL> SELECT a.name, a.group_number AS group#, a.file_number AS file#,
f.bytes, allocation_unit_size AS au_size, au_kffxp AS au#, decode(x.lxn_kffxp, 0,
'PRIMARY', 1, 'MIRROR') AS type,
d.failgroup AS failgrp, d.path
FROM v$asm_alias a, v$asm_file f, x$kffxp x, v$asm_disk d, v$asm_diskgroup dg
WHERE lower(a.name)=lower('spfileTEN.ora')
AND a.group_number=f.group_number
AND a.file_number=f.file_number
AND f.group_number=x.group_kffxp
AND f.file_number=x.number_kffxp
AND x.disk_kffxp=d.disk_number
AND f.group_number=dg.group_number;
NAME GROUP# FILE# BYTES AU_SIZE AU# TYPE FAILGRP PATH
------------- ------ ----- ----- ------- --- ------- ------- --------------------
spfileTEN.ora 1 265 2560 1048576 240 PRIMARY SDA9 /dev/oracleasm/disks
/SDA9
With normal redundancy, i.e., two-way mirroring by ASM, you would see a primary and a
secondary allocation unit, which are assigned to different disks belonging to disjoint fail groups.
NAME GROUP# FILE# BYTES AU_SIZE AU# TYPE FAILGRP PATH
------------- ------ ----- ----- ------- --- ------- ------- ----------------------
spfileten.ora 1 257 2560 1048576 23 PRIMARY DC1 /dev/rlv_asm_dc1_dsk09
spfileten.ora 1 257 2560 1048576 26 MIRROR DC2 /dev/rlv_asm_dc2_dsk09
The column AU# in the query output ( X$KFFXP.AU_KFFXP ) is the offset of an allocation unit
from the first block of an ASM disk. The default size of an ASM allocation unit is 1048576 bytes
(1 MB). Taking this into consideration, the SPFILE with a size of 2560 bytes, which is stored in
allocation unit 240, may be retrieved with the following command pipeline:
$ dd if=/dev/oracleasm/disks/SDA9 bs=1048576 skip=240 count=1 \
| dd bs=2560 count=1 | strings > spfile.txt
1+0 records in
1+0 records out
1+0 records in
0+0 records out
The dd options bs , skip , and count indicate the block size, number of blocks to skip from
the beginning of a file, and the number of blocks to read respectively. The strings command
near the end of the command pipeline removes all non-ASCII characters. Hence, the resulting
On Windows, use the dd command that ships with Cygwin.
1.
 
Search WWH ::




Custom Search