Complete Guide to ASM Metadata Backup

ASM_en

In an Oracle Automatic Storage Management (ASM) environment, metadata is the most critical information as it manages the configuration of disk groups and data placement. If this metadata becomes corrupted, there is a risk that the entire disk group may become unrecognizable. This article explains the essential backup and restore techniques for protecting ASM metadata.

Oracle 26ai RAC Setup Procedure ① 【GI・Grid Infrastructure】
Do you want to build the latest version of Oracle Database, Oracle 26ai Real Application Clusters (Oracle RAC), but find…

1. What is ASM Metadata?

ASM metadata contains the following important information:

  • Disk Group Configuration: Names, redundancy information, and lists of constituent disks.
  • File Structure: ASM directory and filename information.
  • Allocation Information: Maps indicating which disk data blocks are placed on.
  • Template Information: Storage attributes for ASM files.

2. Backing Up Metadata (md_backup)

From Oracle 11g onwards, you can back up metadata in bulk using the md_backup command in asmcmd.

Executing the Basic Command

# Execution example (-b option is deprecated, but we preserve existing behavior here)
asmcmd md_backup -b /home/grid/backup/asm_metadata.bkp
[grid@restart ~]$ asmcmd md_backup -b /home/grid/backup/asm_metadata.bkp
WARNING:option 'b' is deprecated for 'md_backup'
Disk group metadata to be backed up: DATA
Current alias directory path: V19/PARAMETERFILE
Current alias directory path: ASM
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: V19/ONLINELOG
Current alias directory path: V19/TEMPFILE
Current alias directory path: V19/DATAFILE
Current alias directory path: V19
Current alias directory path: ASM/PASSWORD
Current alias directory path: V19/CONTROLFILE

[grid@restart ~]$ ls -l /home/grid/backup
total 16
-rw-r--r--. 1 grid oinstall 13245 Mar 10 14:26 asm_metadata.bkp  ★

Key Options

OptionDescription
-b <file>Specifies the path of the backup file
-g <diskgroup>Acquires only the specified disk group
-t <template>Acquires only template information
-o <attr>Includes disk group attributes

3. Restoring Metadata (md_restore)

To restore corrupted metadata, use md_restore to reconstruct the disk group.

Executing a Restore

asmcmd md_restore -b /backup/asm_metadata.bkp --full

Key Options

OptionDescription
-b <file>Specifies the backup file
--fullFull restoration including disk group reconstruction
--diskgroup <diskgroup>Restores only a specific disk group

4. Low-Level Verification (kfed)

When you need to directly reference the physical information of a disk, use kfed. This is a powerful diagnostic tool for checking what header information a disk holds.

kfed read /dev/oracleasm/disks/DISK1

5. Backup Best Practices

  • External Storage: Store backup files on NFS or a separate local disk, not within an ASM disk group.
  • Regular Acquisition: Perform backups at least once a week, or immediately after configuration changes (such as adding disks).
  • Restore Drills: Confirm that the acquired files are valid through periodic verification tests.

6. Troubleshooting

Below are countermeasures for typical errors during backup and restoration.

  • md_backup error (ORA-15032):Check the operational status of the ASM instance and ensure that the disk group is mounted.
  • md_restore error (ORA-15042):Check if the specified disk name exists and if the device path /dev/oracleasm/disks/ is correctly recognized at the OS level.

7. Frequently Asked Questions (FAQ)

Q1. Can md_backup be executed online?

A. Yes. It can be executed without stopping the database.

Q2. Why should backups be placed outside of ASM?

A. Because when metadata corruption occurs, the entire disk group becomes inaccessible; if the backup is saved inside ASM, you will not be able to retrieve the backup itself.

Q3. How often should the kfed command be used?

A. It is not necessary for normal operations. Use it as a last resort when performing advanced failure diagnosis that cannot be resolved with asmcmd or other tools.


8. Summary

  • ASM metadata is the lifeline of a disk group, and regular backups are essential.
  • By mastering md_backup and md_restore, rapid recovery is possible.
  • Store backup data outside of ASM to minimize operational risks.

This article targets Oracle Database 19c (other versions may have different screens or default values).

[reference]
Oracle Database Backup and Recovery Reference, 19c

Differences Between Oracle RMAN Backup Sets and Image Copies
In Oracle Database operations, RMAN (Recovery Manager) is the cornerstone of data protection. RMAN offers two primary st…

コメント

Copied title and URL