I create a tablespace based on an Oracle ASM disk group with two physical disks, and create a table with 499999 rows to make sure the data distributed on two disks evenly.
SQL> select disk_number, name,path from v$asm_disk;
DISK_NUMBER NAME PATH
----------- ---------------- ------------------------------
0 TEST_0000 E:\ORACLEASM\FILE01.ASM
1 TEST_0001 E:\ORACLEASM\FILE02.ASM
SQL> create table emp_asm tablespace asmdemo as
2 select * from emp_bak where rownum < 500000;
Now we will use the AUL version 6 (with direct ASM access) to recover the table rows from the ASM storage. First prepare a text file ("disk.txt") contains the disk image files, as following:
E:\ORACLEASM\FILE01.ASM
E:\ORACLEASM\FILE01.ASM
Now we start the AUL 6, and run "ASM OPEN disk.txt" to open the disk files, and run "ASM LIST" to show the opened disks (all ASM command in AUL starts with "ASM").
E:\oracleasm>aul6
Register Code: BHAR-KDKF-QPHG-WLXQ-ZANU
AUL : AnySQL UnLoader(MyDUL) for Oracle 11g and ASM, release 6.0.0
(C) Copyright Lou Fangxin 2005-2012 (AnySQL.net), all rights reserved.
AUL> asm open disk.txt
2012-03-07 09:46:37
2012-03-07 09:46:37
AUL> asm list
2012-03-07 09:46:42
Total Disks = 2, ausize=1048576, blksize=4096
disk size block disk name disk group disk path
===== ======== ===== ================ ============ ========================
0 200 4096 TEST_0000 TEST e:\oracleasm\file01.asm
1 200 4096 TEST_0001 TEST e:\oracleasm\file02.asm
f1b1disk = 0, f1b1au = 2, score=256, compat=0x0a100000
file=(1,0,2,1), disk=(2,0,2,2), alias=(6,0,2,6)
2012-03-07 09:46:42
AUL>
We can run "ASM ALIAS" to find out all the data files created in Oracle ASM.
AUL> asm alias
2012-03-07 09:49:25
file inc parent fstblk flag refer alias
======== ============ ====== ====== ==== ====== ==========================
-1 -1 0 0 4 2 DB10G
-1 -1 0 2 4 3 DATAFILE
256 748430975 2 3 18 -1 ASMDEMO
2012-03-07 09:49:25
AUL>
We see that there is one oracle data file (with file id equals 256), please remember the file id in the first column. Now we will prepare a text file for AUL to specify the data files used for data recovery.
# TS FILENO PATH
5 5 +256
For data files stored in Oracle ASM storage, we just put the file id with prefix "+" for file name, now we run "OPEN" command in AUL.
AUL> OPEN DB.TXT
* ts# rfn ver bsize blocks sizemb filename
- ---- ---- --- ----- ---------- -------- -----------------------------------
Y 6 5 a2 8192 16384 0 +256
AUL>
Now we will run the AUL scan command to report the data segments (no system data file here, so we need to find out the data object id of each segment).
AUL> scan data
2012-03-07 09:56:52
RDBA=0x0140000c(5/12),type=0x06,fmt=0xa2,seq=0x01,flag=0x04
seg/obj=0x00003486=13446,csc=0x0000.004233eb,itc=3,typ=1 - DATA
tab#= 0 nrow= 2 offs= 0
RDBA=0x01400014(5/20),type=0x06,fmt=0xa2,seq=0x02,flag=0x04
seg/obj=0x00003490=13456,csc=0x0000.0041856a,itc=3,typ=1 - DATA
tab#= 0 nrow= 174 offs= 0
2012-03-07 09:56:52
AUL>
The data segment with data object id equals 13456 contains the rows we needed here.
AUL> unload object 13456 to 13456.txt;
2012-03-07 10:00:07
Sucessfully unload 499999 rows ...
2012-03-07 10:00:21
AUL>
Now we have get all our data back, congratulations!
