lunes, 30 de noviembre de 2020

BACKUP DISKGROUP ASMCMD

Example

The first example shows the use of the backup command when run without the disk group option. This example backs up all the mounted disk groups and creates the backup image in the /scratch/backup/alldgs20100422 file. The second example creates a backup of the data disk group. The metadata backup that this example creates is saved in the /scratch/backup/data20100422 file.
Example 12-40 Using the ASMCMD md_backup command
 
ASMCMD [+] > md_backup /u01/data.bck
Disk group metadata to be backed up: DATA
Disk group metadata to be backed up: FRA
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ORCL/PARAMETERFILE
Current alias directory path: ORCL
Current alias directory path: ASM
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ORCL/TEMPFILE
Current alias directory path: ORCL/ARCHIVELOG/2010_04_20
Current alias directory path: ORCL
Current alias directory path: ORCL/BACKUPSET/2010_04_21
Current alias directory path: ORCL/ARCHIVELOG/2010_04_19
Current alias directory path: ORCL/BACKUPSET/2010_04_22
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ORCL/BACKUPSET/2010_04_20
Current alias directory path: ORCL/ARCHIVELOG
Current alias directory path: ORCL/BACKUPSET
Current alias directory path: ORCL/ARCHIVELOG/2010_04_22
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ORCL/ARCHIVELOG/2010_04_21

ASMCMD [+] > md_backup /u01/backup/ -G data
Disk group metadata to be backed up: DATA
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ASM
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ORCL/PARAMETERFILE
Current alias directory path: ORCL
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/TEMPFILE

md_restore

Purpose
The md_restore command restores disk groups from a metadata backup file.
Syntax and Description

md_restore backup_file [--silent]
     [--full|--nodg|--newdg -o 'old_diskgroup:new_diskgroup [,...]']
     [-S sql_script_file] [-G 'diskgroup [,diskgroup...]']
Table 12-39 describes the options for the md_restore command.
Table 12-39 Options for the md_restore command
OptionDescription
backup_fileReads the metadata information from backup_file.
--silentIgnore errors. Typically, if md_restore encounters an error, it stops. Specifying this flag ignores any errors.
--fullSpecifies to create a disk group and restore metadata.
--nodgSpecifies to restore metadata only.
--newdg -o old_diskgroup:new_diskgroup]Specifies to create a disk group with a different name when restoring metadata. The -o option is required with --newdg.
-S sql_script_fileWrite SQL commands to the specified SQL script file instead of executing the commands.
-G diskgroupSelect the disk groups to be restored. If no disk groups are defined, then all disk groups are restored.
Example

The first example restores the disk group data from the backup script and creates a copy. The second example takes an existing disk group data and restores its metadata. The third example restores disk group data completely but the new disk group that is created is named data2. The fourth example restores from the backup file after applying the overrides defined in the override.sql script file.
Example 12-41 Using the ASMCMD md_restore command
 
ASMCMD [+] > md_restore –-full –G data –-silent /scratch/backup/alldgs20100422

ASMCMD [+] > md_restore –-nodg –G data –-silent /scratch/backup/alldgs20100422

ASMCMD [+] > md_restore –-newdg -o 'data:data2' --silent /scratch/backup/data20100422

ASMCMD [+] > md_restore -S override.sql --silent /scratch/backup/data20100422

EJEMPLO BACKUP METADATA

ASMCMD> md_backup /u01/backup/backup_asm_data.bck -G DATA
Disk group metadata to be backed up: DATA
Current alias directory path: ASM
Current alias directory path: ACME
Current alias directory path: ACME/PARAMETERFILE
Current alias directory path: ACME/DATAFILE
Current alias directory path: ASM/PASSWORD
Current alias directory path: ACME/CONTROLFILE
Current alias directory path: ACME/TEMPFILE
Current alias directory path: ACME/ONLINELOG
Current alias directory path: ASM/ASMPARAMETERFILE
ASMCMD> md_backup /u01/backup/backup_asm_fra.bck -G FRA
Disk group metadata to be backed up: FRA
Current alias directory path: ACME/ARCHIVELOG/2021_05_04
Current alias directory path: ACME/ARCHIVELOG/2021_05_01
Current alias directory path: ACME/BACKUPSET
Current alias directory path: ACME/ARCHIVELOG/2021_05_03
Current alias directory path: ACME/ARCHIVELOG/2021_05_02
Current alias directory path: ACME/ARCHIVELOG
Current alias directory path: ACME/ONLINELOG
Current alias directory path: ACME/AUTOBACKUP/2021_05_07
Current alias directory path: ACME/BACKUPSET/2021_05_05
Current alias directory path: ACME/ARCHIVELOG/2021_05_06
Current alias directory path: ACME/DATAFILE
Current alias directory path: ACME/CONTROLFILE
Current alias directory path: ACME
Current alias directory path: ACME/ARCHIVELOG/2021_05_07
Current alias directory path: ACME/AUTOBACKUP
Current alias directory path: ACME/ARCHIVELOG/2021_05_05
Current alias directory path: ACME/AUTOBACKUP/2021_05_05
ASMCMD> 



No hay comentarios: