Databases Reference
In-Depth Information
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
AND x.xnum_kffxp=trunc(21798*8192/1048576);
EXTENT GRP# FILE# BYTES AU_SIZE AU# TYPE FAILGROUP PATH
------ ---- ----- --------- ------- --- ------- --------- -------------------------
170 1 263 183508992 1048576 238 PRIMARY SDA9 /dev/oracleasm/disks/SDA9
Finally, we need to find the correct block within the 1 MB sized allocation unit. The
following formula calculates the offset of a database block from the beginning of an ASM disk:
AU# AU Size
+
Block# DB_BLOCK_SIZE
-
ASM Extent# AU Size
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DB_BLOCK_SIZE
In the preceding formula, AU# is the allocation unit (offset) in an ASM disk ( X$KFFXP.AU_
KFFXP ), AU size is the ASM allocation unit size, Block# is the block number in the database
segment, DB_BLOCK_SIZE is the database block size (or tablespace block size, if different), and
ASM Extent# is the ASM extent number ( X$KFFXP.XNUM_KFFXP ) in the ASM file. The offset thus
obtained is in multiples of the database (or tablespace) block size. Entering the figures from the
preceding query result into the formula yields the following:
238
1048576
+
21798
8192
-
170
1048576
---------------------------------------------------------------------------------------------------------------------
=
30502
8192
The database block, which contains the string “Los Angeles”, is at an offset of 30502 blocks
from the beginning of the disk, where each block has a size of 8192 bytes. To extract this block,
we need to use the following dd command:
$ dd if=/dev/oracleasm/disks/SDA9 bs=8192 skip=30502 count=1 | strings | \
grep "Los Angeles"
1+0 records in
1+0 records out
Los Angeles
Of course, I did not cheat by creating a table that contains the string “Los Angeles” in each
and every row. Adjacent blocks do not contain this string.
$ dd if=/dev/oracleasm/disks/SDA9 bs=8192 skip=30501 count=1 | strings | \
grep "Los Angeles"
1+0 records in
1+0 records out
$ dd if=/dev/oracleasm/disks/SDA9 bs=8192 skip=30503 count=1 | strings | \
grep "Los Angeles"
1+0 records in
1+0 records out
Search WWH ::




Custom Search