Use note amdu to recover from a hard disk fault database is a free tool provided in Oracle 11g. It is used to analyze the metadata of the ASM disk group and extract data files from an unmounted disk group. NOTE: 553639.1 Placeholder for AMDU binaries and using with ASM 10g clearly states that AMDU can also be used for 10g, it also provides various versions of AMDU that can be used for 10 Gb for download. The principle of AMDU is to parse file directory. The same is true for ODU, but ODU does more thoroughly. Even if all file directories are damaged, ODU can extract data files, save User data as much as possible. Let's take a look at an instance that uses AMDU to extract data files from a disk group that cannot be mounted: We now shutdown the Oracle instance and the ASM instance: [root @ bspdev odu] # su-oracle [oracle @ bspdev ~] $ Sqlplus '/as sysdba'; SQL * Plus: Release 11.2.0.1.0 Production on Thu Feb 23 10:43:36 2012 Copyright (c) 1982,200 9, Oracle. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> shutdown immediate Database closed. database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle @ bspdev ~] $ Su-grid Password: [grid @ bspdev ~] $ Sqlplus '/as sysasm'; SQL * Plus: Release 11.2.0.1.0 Production on Thu Feb 23 10:45:05 2012 Copyright (c) 1982,200 9, Oracle. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production With the Automatic Storage Management option SQL> shutdown immediate ASM diskgroups dismounted ASM instance shutdown SQL> exit Disconnected from Oracle Database 11g Ent Erprise Edition Release 11.2.0.1.0-Production With the Automatic Storage Management option [grid @ bspdev ~] $ Crsctl status res NAME = ora. DATA. dg TYPE = ora. diskgroup. type TARGET = offline state = offline name = ora. LISTENER. lsnr TYPE = ora. listener. type TARGET = online state = ONLINE on bspdev NAME = ora. RECO. dg TYPE = ora. diskgroup. type TARGET = offline state = offline name = ora. asm TYPE = ora. asm. type TARGET = offline state = OFFLINE name‑ora.css d type‑ora.css d. type TARGET = online state = ONLINE on bspdev NAME = ora. diskmon TYPE = ora. di Skmon. type TARGET = online state = ONLINE on bspdev NAME = ora. ora11g. db TYPE = ora. database. type TARGET = offline state = OFFLINE asmcmd cannot be used when the ASM diskgroup cannot be mounted: [grid @ bspdev ~] $ Asmcmd Connected to an idle instance. ASMCMD> ls ASMCMD-08102: no connection to ASM; command requires ASM to run but now the asmcmd embedded in ODU can be used, therefore, we can easily use the asmcmd command embedded in ODU to obtain the names of all datafiles: [grid @ bspdev ~] $ Su-Password: [root @ bspdev ~] # Cd/u01/app/oracle/odu [root @ bspdev odu] #./odu Oracle Data Unloader: Release 4.2.1 loading default config ....... Byte_order little block_size 8192 block_buffers 1024 db_timezone-7 Invalid db timezone:-7 client_timezone 8 Invalid client timezone: 8 Bytes/odu/asmfile data_path data lob_path/odu/data/lob charset_name AL32UTF8 ncharset_name character output_format text lob_storage infile character big trace_level 1 delimiter | unload_deleted no limit 0 is_tru64 bytes Ddr no convert_clob_charset yes use_scanned_lob yes trim_scanned_blob yes 20000 db_block_checksum yes db_block_checking yes limit 10 compatible 10 load config file 'config.txt 'successful loading default asm disk file ...... Grp # dsk # bsize ausize disksize diskname groupname path -- --- ----- --------------- 1 0 4096 1024 K 9000 DATA_0000 DATA/dev/sda3 1 1 4096 1024 K 9000 DATA_0001 DATA/dev /sda5 1 2 4096 1024 K 9000 DATA_0002 DATA/dev/sda6 2 0 4096 K 1024 RECO_0000 RECO/dev/sda7 2 1 9000 4096 K 1024 RECO_0001 RECO/dev/sda8 load asm disk file 'asmdisk.txt 'successful loading default control file ...... Ts # fn rfn bsize blocks bf offset filename -- --------------- load control file 'control.txt 'successful loading dictionary data ...... Done loading scanned data ...... Done ODU> asmcmd Entering asmcmd module. ASMCMD> ls Current directory: <root> Disk Group ------------ data reco asmcmd> cd + DATA Current directory: + data asmcmd> ls Current directory: + DATA Name -------------- ASM <DIR> ORA11G <DIR> ASMCMD> cd ORA11G Current directory: + DATA/ORA11G ASMCMD> ls Current directory: + DATA/ORA11G Name -------------- DATAFILE <DIR> CONTROLFILE <DIR> ONLINELOG <DIR> TEMPFI LE <DIR> PARAMETERFILE <DIR> spfileora11g. ora => + DATA.265.747311071 ASMCMD> cd DATAFILE Current directory: + DATA/ORA11G/DATAFILE you can see that the Current 259th number (this 259 is the ASM internal file number) the file Name is + DATA/ORA11G/DATAFILE/USERS.259.747310451: ASMCMD> ls Current directory: + DATA/ORA11G/DATAFILE Name ------------ SYSTEM.256.747310449 %%%users.259.7473%51 49 then GAOZCINDEX1 => + DATA.267.770299335 then GAOZCDATA1 => + DATA.268.770299347 now we use AMDU to extract this file. Note that the DATA in the disk of this file is still in the unmount state. The syntax for extracting data files with AMDU is very simple. You only need to specify the name of the device file where the disk group is located (fuzzy match can be performed with the * number ), and the name of the disk group and the data file number to be extracted (the data file number here refers to the ASM internal file number: [root @ bspdev odu] #/u01/app/oracle/bin/amdu-diskstring '/dev/sda *'-extract 'DATA. 259 'amdu_2012_02_23_11_21_34/enter the preceding directory. You can see that the extracted file DATA_259.f has been generated: [root @ bspdev odu] # cd amdu_2012_02_23_11_21_34 [root @ bspdev amdu_2012_02_23_11_21_34] # ls-lrt total 39744-rw-r -. 1 root 8600 Feb 23 11: 21 report.txt-rw-r -. 1 root 40640512 Feb 23 DATA_259.f now we use ODU to submit the 259 file and compare it with AMDU: [root @ bspdev amdu_2012_02_23_11_21_34] # cd .. [root @ bspdev odu] #. /odu Oracle Data Unloader: Release 4.2.1 loading default config ....... Byte_order little block_size 8192 block_buffers 1024 db_timezone-7 Invalid db timezone:-7 client_timezone 8 Invalid client timezone: 8 Bytes/odu/asmfile data_path data lob_path/odu/data/lob charset_name AL32UTF8 ncharset_name character output_format text lob_storage infile character big trace_level 1 delimiter | unload_deleted no limit 0 is_tru64 bytes Ddr no convert_clob_charset yes use_scanned_lob yes trim_scanned_blob yes 20000 db_block_checksum yes db_block_checking yes limit 10 compatible 10 load config file 'config.txt 'successful loading default asm disk file ...... Grp # dsk # bsize ausize disksize diskname groupname path -- --- ----- --------------- 1 0 4096 1024 K 9000 DATA_0000 DATA/dev/sda3 1 1 4096 1024 K 9000 DATA_0001 DATA/dev /sda5 1 2 4096 1024 K 9000 DATA_0002 DATA/dev/sda6 2 0 4096 K 1024 RECO_0000 RECO/dev/sda7 2 1 9000 4096 K 1024 RECO_0001 RECO/dev/sda8 load asm disk file 'asmdisk.txt 'successful loading default control file ...... Ts # fn rfn bsize blocks bf offset filename -- ----------------- 0 1 8192 112640 N 0 + DATA/ORA11G/DATAFILE/SYSTEM.256.747310449 1 2 8192 119040 N 0 + DATA/ORA11G/DATAFILE/SYSAUX.257.747310449 2 3 8192 70400 N 0 + DATA/ORA11G/DATAFILE/documents 4 4 4 8192 4960 N 0 + DATA/ORA11G/DATAFILE/USERS.259.747310451 load control file 'oductl. dat 'successful loading dictionary d Ata ...... Done loading scanned data ...... Done ODU> asmcmd Entering asmcmd module. note: The extract command in the latest version of ODU has been replaced by the copy command: ASMCMD> extract asmfile + DATA/ORA11G/DATAFILE/users to/u01/app/oracle/odu/users/user01.dbf starting extract asm file '+ DATA/ORA11G/DATAFILE/Users' '/u01/app/oracle/odu/amdu_2012_02_23_11_21_34/user01.dbf ', file size is 40640512 asm file extract completed. ASMCMD> exit Exiting Asmcmd module. [root @ bspdev odu] # cd amdu_2012_02_23_11_21_34 [root @ bspdev amdu_2012_02_23_11_21_34] # ls-lrt total 79476-rw-r -. 1 root 8600 Feb 23 :21 report.txt-rw-r -. 1 root 40640512 Feb 23 :21 DATA_259.f-rw-r -. 1 root 40640512 Feb 23 user01.dbf from the results, we can see that the two are the same size. From the results of dbv verification, the two are the same: [oracle @ bspdev ~] $ Dbv file =/u01/app/oracle/odu/amdu_2012_02_23_11_21_34/DATA_259.f blocksize = 8192 DBVERIFY: Release 11.2.0.1.0-Production on Thu Feb 23 11:29:50 2012 Copyright (c) 1982,200 9, oracle and/or its affiliates. all rights reserved. DBVERIFY-Verification starting: FILE =/u01/app/oracle/odu/amdu_2012_02_23_11_21_34/DATA_259.f DBVERIFY-Verification complete Total Pages Examined: 4960 Total Pages P Rocessed (Data): 4442 Total Pages Failing (Data): 0 Total Pages Processed (Index): 33 Total Pages Failing (Index): 0 Total Pages Processed (Other ): 334 Total Pages Processed (Seg): 0 Total Pages Failing (Seg): 0 Total Pages Empty: 151 Total Pages Marked success upt: 0 Total Pages Influx: 0 Total Pages Encrypted: 0 Highest block SCN: 2132237218 (1932.2132237218) [oracle @ bspdev ~] $ Dbv file =/u01/app/oracle/odu/amdu_2012_02_23_11_21_34/user01.dbf blocksize = 8192 DBVERIFY: Release 11.2.0.1.0-Production on Thu Feb 23 11:30:11 2012 Copyright (c) 1982,200 9, oracle and/or its affiliates. all rights reserved. DBVERIFY-Verification starting: FILE =/u01/app/oracle/odu/amdu_2012_02_23_11_21_34/user01.dbf DBVERIFY-Verification complete Total Pages Examined: 4960 Total Pages Processed (Data ): 4442 Total Pages Failing (Data): 0 Total Pages Processed (Index): 33 Total Pages Failing (Index): 0 Total Pages Processed (Other): 334 Total Pages Processed (Seg ): 0 Total Pages Failing (Seg): 0 Total Pages Empty: 151 Total Pages Marked reset upt: 0 Total Pages Influx: 0 Total Pages Encrypted: 0 Highest block SCN: 2132237218 (1932.2132237218)