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 understand AMDU data extraction

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

Share

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

This article mainly introduces "how to understand AMDU data extraction". In daily operation, I believe many people have doubts about how to understand AMDU data extraction. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to understand AMDU data extraction"! Next, please follow the editor to study!

In the first half of the year, a customer expanded the capacity of an ASM disk group, and the disk group was dismount due to improper operation during the expansion period. The log is as follows:

Through the log, we can see that because the metadata of the disk head is corrupted, ASM detection found that the PST table does not meet the redundancy requirements, and the disk group is dismount. For this kind of thing, because the ASM disk metadata is corrupted, the disk group cannot be mount, and the metadata can not be repaired. When you need to retrieve the lost ASM files in the ASM disk group, you can use the AMDU tool provided by Oracle to extract.

AMDU introduction

AMDU is the abbreviation of ASM Metadata Dump Utility, or ASM metadata export utility. It can extract metadata information and files on disk directly from asm disk. The tool does not depend on the state of asm disk group, and can be used normally when asm instance is shut down and asm disk group dismount. When the disk group is unable to mount due to some failures, you can use the amdu tool to repair and extract the data files in the asm disk group. But it should be noted that amdu can only extract the files from the asm disk. If the file itself is corrupted, amdu cannot repair it, and the extracted files will still be damaged. In this case, if you need to retrieve the data in the corrupted data files You can use the dul class tool to read the extracted data file directly and retrieve the data.

Return to the theme

Back to the fault handling, the disk group can no longer be mount and is difficult to repair. We can only use AMDU to extract the data file directly from the asm disk. Because the control file, parameter file and log file are all normal, the whole recovery is relatively simple. If the disk group in which the control file belongs cannot be mount, we can find the location of the database control file in the database alert file, which is usually the first step:

Control file recovery:

Control_files= "+ REDODG/xxxpd/controlfile/current.269.957297789"

Then extract the control file through amdu:

Amdu-diskstring'/ dev/xxx/*'-extract REDODG.269-noreport-nodir

The meaning of the parameters related to the above command:

Diskstring: use the full path of the disk or the ASM_DISKSTRING parameter value

Extract: disk group name.ASM file serial number

Output: extracted output file (current directory)

Noreport: do not output the execution process of amdu

Nodir: do not create a dump directory

The database starts to the mount state:

Because the startup information output in the alert log file will contain the instance parameter information, we can start the database to the mount state through the parameter file and control file by editing a parameter file again.

SQL > startup nomount pfile='/orabackup/tmp/init.ora'ORACLE instance started.Total System Global Area 3.2068E+10 bytesFixed Size 2269072 bytesVariable Size 4362076272 bytesDatabase Buffers 2.7649E+10 bytesRedo Buffers 55242752 bytesSQL > alter database mount;Database altered.SQL >

Get the data file name:

At this point, because the database has been started to the mount state, the data file name can be obtained through the v$datafile view.

Select name from vested datafileterDATADG server xxxUniverse datafileUniverse system.347.957297809 database datafileUniverse sysaux.368.957297823 benchmark datafileUniverse xxxdatabase datafilelash undotbs1.316.957297837 percent DATADGUniverse xxUniverse datafileax xxlarge.335.957297873

Extract the data files from the ASM disk group to the local file system:

If the data file is named in OMF format, you can directly use the amdu command to extract, the command is the same as the extraction control file, but when the data file is named in + DATADG/xxx/tbs01.dbf mode, you need to extract metadata first, and find the corresponding fnum in the metadata through the alias of the data file. Please refer to "asm Translation Series" for more details.

Customers always use OMF file management method when creating data files, and directly edit the following data file extraction commands:

Amdu-diskstring'/ dev/xxx/*'-extract datadg.347-noreport-nodiramdu-diskstring'/ dev/xxx/*'-extract datadg.368-noreport-nodiramdu-diskstring'/ dev/xxx/*'-extract datadg.316-noreport-nodiramdu-diskstring'/ dev/xxx/*'-extract datadg.335-noreport-nodir

The file format after extraction defaults to the command rule such as DATADG_347.f. Since the name of the data file has changed after it has been extracted locally, the name of the data file recorded in the control file will be renamed in the database mount state, so that the database can identify the data file extracted locally.

Rename the data file:

Alter database rename file'+ DATADG/xxx/datafile/system.347.957297809' to'/ orabackup/xxx/DATADG_347.f';alter database rename file'+ DATADG/xxx/datafile/sysaux.368.957297823' to'/ orabackup/xxx/DATADG_368.f';alter database rename file'+ DATADG/xxxdatafile/undotbs1.316.957297837' to'/ orabackup/xxx/DATADG_316.f';...

Change the database OPEN:

Because there is no dismount problem in the disk group where the log file is located, the log file is intact and can be accessed normally, in which case you can directly open the database.

SQL > alter database open;Database altered.SQL >

The database is opened normally, but at this time, all the data files are stored in the local file system. You also need to move the data files to the asm disk group. Since there is no asm disk group available in the customer environment, delete and re-create the above problem disk group process and use rman copy to move the files in the local file system back to the asm disk group:

Select 'backup as copy datafile' | | file_id | | 'format' | |'+ DATADG;' from dba_data_files;select 'switch datafile' | | file_id | |'to copy;' from dba_data_files; at this point, the study on "how to understand AMDU data extraction" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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