You can back up the ASM diskgroup metadata using a FileSystem subclient. The diskgroup metadata is used to reconstruct an ASM diskgroup that gets corrupted, for example, due to an accidental write to a disk using OS commands.
The metadata backup operation does not back up the file contents in the ASM diskgroup. To back up the file contents, use an appropriate utility, such as RMAN for database files.
Before You Begin
To back up the ASM diskgroup metadata, use the asmcmd utility provided with the Oracle Grid Infrastructure. Refer to Oracle documentation for the syntax and full list of supported options for your version of Oracle Grid Infrastructure.
Procedure
-
Create a script on the client where the diskgroup metadata is being backed up.
Sample script:
#!/bin/sh BACKUP_DATE=`date +%Y%m%d` BACKUP_DIR=/path/to/backup_dir ORACLE_HOME=/path/to/grid_home ORACLE_SID=+ASM PATH=$ORACLE_HOME/bin:$PATH export ORACLE_HOME ORACLE_SID PATH asmcmd md_backup ${BACKUP_DIR}/asm_metadata_${BACKUP_DATE}
-
Add the script in the pre-scan phase of the File System subclient.
-
Add the backup directory specified in the script as the subclient content on the File System subclient.
-
Optional: To remove the metadata backup file and prevent the metadata from building up, add the following script in the post-scan phase of the File System subclient:
#!/bin/sh BACKUP_DATE=`date +%Y%m%d` BACKUP_DIR=/path/to/backup_dir rm -f ${BACKUP_DIR}/asm_metadata_${BACKUP_DATE}