Understanding Oracle ASM Metadata: Files, AU, Disk Headers, and Recovery
This article explains Oracle ASM metadata concepts, including ASM file types, allocation units, physical and virtual metadata structures, disk header composition, and practical methods for querying, validating, backing up, and restoring ASM metadata using tools like KFOD, KFED, and X$KFFXP.
Since Oracle 10g, data files can be stored in ASM, where files such as control files, datafiles, redo logs, archive logs, and others are referred to as ASM FILEs. An ASM FILE name starts with a "+" followed by the DiskGroup name, e.g., +DATAA/orcl/datafile/system.256.689832921, and its format encodes the database name, file type, tablespace, file number, and incarnation number.
ASM File Types
Control File
Datafile
Temporary data file
Online Redo Log
Archive Log
RMAN backup
Datafile Copy
SPFILE
Disaster Recovery Configuration
Flashback Log
Change Tracking Bitmap
DataPump Dumpset
Only these file types may reside in an ASM Diskgroup; unrecognizable files cause creation errors.
Allocation Units (AU)
ASM allocates space in Allocation Units (AU). In Oracle 10gR2 the default AU size is 1 MB with a stripe size of 128 KB, configurable via _asm_ausize and _asm_stripesize. From 11g onward, AU sizes of 1, 2, 4, 8, 16, 32, or 64 MB can be set when creating a Diskgroup.
File Blocks
All ASM‑supported file types use their native block size (e.g., 8 KB for datafiles) as the basic read/write unit. The block size for each file type is recorded in the FILEDIR metadata.
ASM Metadata
Metadata is stored on ASM disks and describes Diskgroup composition, space allocation, file names, and extents. It is divided into physical metadata (fixed location in the disk header) and virtual metadata (stored as regular ASM files distributed across disks). All metadata blocks are 4 KB and include checksums.
Physical Metadata (Disk Header)
The first 4096 bytes of each ASM disk constitute the disk header (block 0). It holds Diskgroup name, creation timestamp, sector size, AU size, metadata block size, software compatibility, redundancy, mount timestamp, and disk‑specific fields such as disk name, number, failure group, and size in AUs. This header is replicated on every disk in the group.
Logical Metadata (File Directory)
The File Directory resides in AU 0 and AU 1 and maps each ASM file to its extents, recording disk numbers and AU numbers. The directory starts at AU 2 of disk 0, with 256 blocks of 4 KB each. Block 0 is reserved for the header; subsequent blocks list the distribution of ASM files (e.g., File#1 occupies AU 2 on disks 0 and 1).
Querying Metadata
Use the Oracle‑provided KFOD tool to list shared disks.
Use KFED to view ASM disk headers and block information.
Query the X$KFFXP view (or related dynamic performance views) to see the File Extent Map, showing AU distribution per file.
Validating Metadata
Run kfed find to check that all blocks in AU 0 have expected metadata types; any deviation indicates possible corruption.
Backup and Recovery of Disk Headers
Before 11.1.0.7, backup methods include copying the first 4096 bytes with dd or using kfed. Restoration involves writing the saved header back to the disk and remounting the Diskgroup.
From 11.1.0.7 onward, ASM automatically backs up the disk header to the second‑last block of AU 1. The backup can be inspected and restored with kfed without manual copying.
Manual Reconstruction of Disk Headers
For older versions lacking automatic backup, manual reconstruction requires editing fields such as kfbh.endian, kfdhdb.dsknum, kfdhdb.grpname, etc., using the information from a healthy disk’s header as a template.
Steps include:
Destroy the corrupted disk header (simulation).
Copy a healthy header from another disk in the group.
Modify values to match the damaged disk (disk number, name, size, timestamps).
Write the corrected header back to the disk and remount the Diskgroup.
These procedures enable DBAs to recover from disk‑header failures and ensure ASM Diskgroup integrity.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
