MERCADOS FINANCIEROS

sábado, 18 de julio de 2020

Backup and Restore of ASM Metadata in Oracle 11gR2 (md_backup and md_restore)


Backup and Restore of ASM Metadata in Oracle 11gR2 (md_backup and md_restore)
ASMCMD utility was introduced in Oracle 10g and offered some basic features for navigation, search, monitoring and management, for full description see the docs here. In Oracle 11gR1 the asmcmd functionality was extended to include ability to backup existing disk groups metadata among other new 11g features, for full information refer to the docs here. In Oracle 11gR2 with the introduction of the ACFS the ASMCMD functionality was further extended see here. In Oracle 11gR2 ASMCMD can be used to perform almost all of the activities that used to be performed from sqlplus prompt previously and both sqlplus and asmcmd can be used interchangeably. In this article I will demo how to backup a disk group using md_backup command and use md_restore to obtain the SQL statements to recreate the disk groups and all the dependencies such as templates, aliases, directories and disk group attributes.
The syntax of md_backup in Oracle 11gR2 is as follow.
ASMCMD> md_backup
usage: md_backup backup_file [-G diskgroup [,diskgroup,…]]
help: help md_backup
ASMCMD>
The syntax of md_restore is as follow.
ASMCMD> md_restore
usage: md_restore backup_file [–silent][–full|–nodg|–newdg -o ‘old_diskgroup:new_diskgroup [,…]’][-S sql_script_file] [-G ‘diskgroup [,diskgroup…]’]

md_backup /tmp/backup_ASM.bcp -G data,dgdup,dgdup1,dgdup2,prim,sec

The backed diskgroup metadata can be directly restored upon failure of the disk or we can have asmcmd generate a script and later use the script to generate the disk groups and all of the dependencies from sqlplus.

md_restore /tmp/backup_ASM.bcp –full -S /tmp/ASM_diskgroup.sql


ASMCMD>  md_backup backup.bck -G data,fra


No hay comentarios: