Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the md_backup command in Oracle Database 11gR2

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to use the md_backup command in Oracle Database 11gR2, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

In Oracle Database 11gR2, Oracle adds two commands for backup and recovery of ASM metadata: md_backup and md_restore.

Md is an acronym for metadata, and this tool greatly simplifies the metadata maintenance of ASM.

In asmcmd, you can see detailed command prompts through help md_backup:

ASMCMD > help md_backup

Md_backup

The md_backup command creates a backup file containing metadata

For one or more disk groups.

Volume and Oracle Automatic Storage Management Cluster File System

(Oracle ACFS) file system information is not backed up.

Md_backup backup_file [- G diskgroup [, diskgroup,...]]

The options for the md_backup command are described below.

Backup_file-Specifies the backup file in which you want to

Store the metadata.

-G diskgroup-Specifies the diskgroup name of the diskgroup

That must be backed up

By default all the mounted disk groups are included in the backup file

Which is saved in the current working directory.

The first example shows the use of the backup command when you run it

Without options. This example backs up all of the mounted disk groups

And creates the backup image in the current working directory. The

Second example creates a backup of disk group DATA and FRA. The backup

That this example creates is saved in the / tmp/dgbackup20090714 file.

ASMCMD [+] > md_backup / tmp/dgbackup20090716

ASMCMD [+] > md_backup / tmp/dgbackup20090716-G DATA,FRA

Disk group metadata to be backed up: DATA

Disk group metadata to be backed up: FRA

Current alias directory path: ASM/ASMPARAMETERFILE

Current alias directory path: ORCL/DATAFILE

Current alias directory path: ORCL/TEMPFILE

Current alias directory path: ORCL/CONTROLFILE

Current alias directory path: ORCL/PARAMETERFILE

Current alias directory path: ASM

Current alias directory path: ORCL/ONLINELOG

Current alias directory path: ORCL

Current alias directory path: ORCL/CONTROLFILE

Current alias directory path: ORCL/ARCHIVELOG/2009_07_13

Current alias directory path: ORCL/BACKUPSET/2009_07_14

Current alias directory path: ORCL/ARCHIVELOG/2009_07_14

Current alias directory path: ORCL

Current alias directory path: ORCL/DATAFILE

Current alias directory path: ORCL/ARCHIVELOG

Current alias directory path: ORCL/BACKUPSET

Current alias directory path: ORCL/ONLINELOG

Now that backup_file is a mandatory parameter, the following command backs up all the disk group metadata in ASM:

ASMCMD > md_backup / tmp/oradgbackup20110322

Disk group metadata to be backed up: ACFSG

Disk group metadata to be backed up: CRSDG

Disk group metadata to be backed up: ORADG

Current alias directory path: EYGLE/ONLINELOG

Current alias directory path: EYGLE

Current alias directory path: EYGLE/CONTROLFILE

Current alias directory path: ASM

Current alias directory path: EYGLE/PARAMETERFILE

Current alias directory path: EYGLE/CONTROLFILE

Current alias directory path: EYGLE/TEMPFILE

Current alias directory path: EYGLE/DATAFILE

Current alias directory path: EYGLE

Current alias directory path: EYGLE/ONLINELOG

Current alias directory path: ASM/ASMPARAMETERFILE

You can also make backup specific disk group information:

ASMCMD > md_backup / tmp/oradgbackup20110323-G ORADG

Disk group metadata to be backed up: ORADG

The backup records the parameter information of the disk group in text format:

[grid@enmou1 ~] $more / tmp/oradgbackup20110323

@ diskgroup_set = (

{

'ATTRINFO' = > {

'_. _ DIRVERSION' = >' 11.2.0.0.0'

'COMPATIBLE.ASM' = >' 11.2.0.0.0'

'COMPATIBLE.RDBMS' = >' 10.1.0.0.0'

}

'DISKSINFO' = > {

'VOL3' = > {

'VOL3' = > {

'TOTAL_MB' = >' 987'

'FAILGROUP' = >' VOL3'

'NAME' = >' VOL3'

'DGNAME' = >' ORADG'

'PATH' = >' ORCL:VOL3'

}

}

}

'DGINFO' = > {

'DGTORESTORE' = > 0

'DGCOMPAT' = >' 11.2.0.0.0'

'DGNAME' = >' ORADG'

'DGDBCOMPAT' = >' 10.1.0.0.0'

'DGTYPE' = >' EXTERN'

'DGAUSZ' = >' 1048576'

}

'ALIASINFO' = > {}

'TEMPLATEINFO' = > {

'6' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' ONLINELOG'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'11' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' AUTOBACKUP'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'3' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' FINE'

'TEMPNAME' = >' CONTROLFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'7' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' DATAGUARDCONFIG'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'9' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' CHANGETRACKING'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'12' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' BACKUPSET'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'2' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' DUMPSET'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'14'= > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' DATAFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'15' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' ASMPARAMETERFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'8' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' FLASHBACK'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'4' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' FLASHFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'1' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' OCRFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'0' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' PARAMETERFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'10' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' XTRANSPORT'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'13' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' TEMPFILE'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

'5' = > {

'DGNAME' = >' ORADG'

'STRIPE' = >' COARSE'

'TEMPNAME' = >' ARCHIVELOG'

'REDUNDANCY' = >' UNPROT'

'SYSTEM' = >' Y'

}

}

}

);

With this information, the metadata of ASM can be quickly recovered if the disk group is damaged.

Restore is not allowed when the diskgroup is available:

ASMCMD > md_restore-- full-G oradg / tmp/oradgbackup20110323

Current Diskgroup metadata being restored: ORADG

ASMCMD-09352: CREATE DISKGROUP failed

ORA-15018: diskgroup cannot be created

ORA-15030: diskgroup name "ORADG" is in use by another diskgroup (DBD ERROR: OCIStmtExecute)

The following is the whole process of performing the recovery after DROP ORADG. After the recovery is completed, the disk group is created and the template information is restored:

ASMCMD > md_restore-- full-G oradg / tmp/oradgbackup20110323

Current Diskgroup metadata being restored: ORADG

Diskgroup ORADG created!

System template ONLINELOG modified!

System template AUTOBACKUP modified!

System template CONTROLFILE modified!

System template DATAGUARDCONFIG modified!

System template CHANGETRACKING modified!

System template DUMPSET modified!

System template BACKUPSET modified!

System template ASMPARAMETERFILE modified!

System template DATAFILE modified!

System template FLASHBACK modified!

System template OCRFILE modified!

System template FLASHFILE modified!

System template PARAMETERFILE modified!

System template TEMPFILE modified!

System template XTRANSPORT modified!

System template ARCHIVELOG modified!

The-S parameter allows you to generate only the recovery script and not perform the restore action:

ASMCMD > md_restore-S create_oradg.sql / tmp/oradgbackup20110323

Current Diskgroup metadata being restored: ORADG

The following commands are executed when the ORADG disk group is restored:

[grid@enmou1 ~] $more create_oradg.sql

Create diskgroup ORADG EXTERNAL redundancy disk 'ORCL:VOL3' name VOL3 size 987m attribute' compatible.asm' = '11.2.0.0.0,' compatible.r

Dbms' = '10.1.0.0.0'

Alter diskgroup / * ASMCMD AMBR*/ORADG set attribute'_. _ DIRVERSION' = '11.2.0.0.0'

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template ONLINELOG attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template AUTOBACKUP attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template CONTROLFILE attributes (UNPROTECTED FINE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template CHANGETRACKING attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template DUMPSET attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template BACKUPSET attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template DATAFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template FLASHBACK attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template OCRFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template FLASHFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template PARAMETERFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template TEMPFILE attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template XTRANSPORT attributes (UNPROTECTED COARSE)

Alter diskgroup / * ASMCMD AMBR*/ORADG alter template ARCHIVELOG attributes (UNPROTECTED COARSE); this is all the content of the article "how to use md_backup commands in Oracle Database 11gR2". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report