ASM: Backup and restore DG metadata

Overview – ASMCMD md_backup and md_restore

  • ASMCMD 11g  is extended to include ASM disk group metadata backup and restore functionality.
  • This provides the ability to recreate a pre-existing ASM disk group with the same disk paths,disk names,failure groups, attributes, templates and alias directory structure
  • In 10g you have to manually recreate the ASM disk group and any required user directories/templates.
  • In 11g we can take backup of ASM diskgroup metadata

The md_backup command creates a backup file containing metadata for one or more disk groups. i
By default all the mounted disk groups are included in the backup file which is saved in the current working directory.

 

Backup and restore DG metadata

Backup ACFS DG metadata
ASMCMD> md_backup ACFS_DG.backup -G ACFS
Disk group metadata to be backed up: ACFS

[root@grac41 Desktop]# srvctl status diskgroup -g ACFS
Disk Group ACFS is running on grac42,grac43

Stop DG ACFS and check DG status
[root@grac41 Desktop]# srvctl stop  diskgroup -g ACFS -f
[grid@grac41 ASM]$ asmcmd lsdg -g  --discovery ACFS
Inst_ID  State       Type  Rebal  Sector  Block  AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
      3  DISMOUNTED        N           0   4096   0         0        0                0               0              0             N  ACFS/
      2  DISMOUNTED        N           0   4096   0         0        0                0               0              0             N  ACFS/
      1  DISMOUNTED        N           0   4096   0         0        0                0               0              0             N  ACFS/

Remove DG cleaup disk headers  and check status 
[root@grac41 Desktop]# srvctl remove  diskgroup -g ACFS -f
[grid@grac41 ASM]$ dd if=/dev/zero of=/dev/asm_test_1G_disk1 bs=8192 count=1000
[grid@grac41 ASM]$ dd if=/dev/zero of=/dev/asm_test_1G_disk2  bs=8192 count=1000
[root@grac41 Desktop]# srvctl status diskgroup -g ACFS
Disk Group ACFS is not running
[grid@grac41 ASM]$  asmcmd lsdg -g  --discovery ACFS
ASMCMD-8001: diskgroup 'ACFS' does not exist or is not mounted


Before recreationg DG - check disk status and diskgroup status on all nodes 
[grid@grac41 ASM]$  asmcmd lsdg -g  --discovery ACFS
ASMCMD-8001: diskgroup 'ACFS' does not exist or is not mounted
[grid@grac41 ASM]$  asmcmd lsdsk -k -g --candidate
Inst_ID  Total_MB  Free_MB  OS_MB  Name       Failgroup  Failgroup_Type  Library  Label  UDID  Product  Redund   Path
      3         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk1
      2         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk1
      1         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk1
      3         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk2
      2         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk2
      1         0        0   1019                        REGULAR         System                         UNKNOWN  /dev/asm_test_1G_disk2

Restore DG in full mode 
  - The full mode restores the diskgroup exactly as it was at the time of backup
ASMCMD>  md_restore ACFS_DG.backup  --full  -G ACFS
Current Diskgroup metadata being restored: ACFS
Diskgroup ACFS created!
System template DATAFILE modified!
System template AUTOBACKUP modified!
System template OCRFILE modified!
System template ASMPARAMETERFILE modified!
System template PARAMETERFILE modified!
System template DUMPSET modified!
System template ARCHIVELOG modified!
System template XTRANSPORT modified!
System template DATAGUARDCONFIG modified!
System template BACKUPSET modified!
System template ONLINELOG modified!
System template CONTROLFILE modified!
System template FLASHFILE modified!
System template XTRANSPORT BACKUPSET modified!
System template FLASHBACK modified!
System template TEMPFILE modified!
System template CHANGETRACKING modified!

[grid@grac41 ASM]$ asmcmd lsdg -g  --discovery ACFS 
Inst_ID  State       Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
      3  DISMOUNTED          N           0   4096        0         0        0                0               0              0             N  ACFS/
      2  DISMOUNTED          N           0   4096        0         0        0                0               0              0             N  ACFS/
      1  MOUNTED     NORMAL  N         512   4096  1048576      2032     1926                0             963              0             N  ACFS/

Restart DG on the remaining nodes and display DG status 
[grid@grac41 ASM]$ srvctl status diskgroup -g ACFS 
Disk Group ACFS is running on grac41
[grid@grac41 ASM]$ srvctl start  diskgroup -g ACFS 
[grid@grac41 ASM]$ srvctl status diskgroup -g ACFS 
Disk Group ACFS is running on grac42,grac43,grac41


[grid@grac41 ASM]$ asmcmd lsdg -g  --discovery ACFS
Inst_ID  State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
      3  MOUNTED  NORMAL  N         512   4096  1048576      2032     1758                0             879              0             N  ACFS/
      2  MOUNTED  NORMAL  N         512   4096  1048576      2032     1758                0             879              0             N  ACFS/
      1  MOUNTED  NORMAL  N         512   4096  1048576      2032     1758                0             879              0             N  ACFS/

Reference

  • ASMCMD – New commands in 11gR1 (Doc ID 451900.1)

One thought on “ASM: Backup and restore DG metadata

  1. Pingback: Valid 1Z0-067 Dumps with VCE and PDF for Free (Question 61 – Question 75) | All PassLeader Oracle Dumps with VCE and PDF for Free

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>