Step by step AUL/MyDUL data recovery example

Links: http://www.dbatools.net/mydul/aul_example.html

    Download the binary and put it into a directory with enough free space to hold the recovered data, then prepare a text file (db10g.cfg) to tell AUL (MyDUL) where the data files is. As following.

#  FILE#   RFILE# NAME
       0        0 C:\ORACLE\ORADATA\SYSTEM01.DBF
       0        0 C:\ORACLE\ORADATA\AULTEST01.DBF

    Then register and apply the license, and open the configuration file (db10g.cfg), check the output and the first column should be "Y".

AUL> open db10g.cfg
*  ts#  fno  rfn ver bsize     blocks filename
- ---- ---- ---- --- ----- ---------- -----------------------------------
Y    0    1    1 a2   8192      32768 C:\ORACLE\ORADATA\SYSTEM01.DBF
Y    5    5    5 a2   8192       3072 C:\ORACLE\ORADATA\AULTEST01.DBF

    System tablespace is available here, so we run the following four commands to unload the data dictionary data ("USER$", "OBJ$", "TAB$", "COL$"), it will make the recovery easy for you.

AUL> UNLOAD TABLE USER$;
2006-08-04 09:39:00
2006-08-04 09:39:00
AUL> UNLOAD TABLE OBJ$;
2006-08-04 09:39:07
2006-08-04 09:39:08
AUL> UNLOAD TABLE TAB$;
2006-08-04 09:39:12
2006-08-04 09:39:13
AUL> UNLOAD TABLE COL$;
2006-08-04 09:39:17
2006-08-04 09:39:18
AUL> ! dir AUL*.TXT
Volume in drive C has no label.
Volume Serial Number is 5CF4-08FE

Directory of C:\MYDUL

2006-08-04  09:39         1,479,173 AULCOL.TXT
2006-08-04  09:39           272,935 AULOBJ.TXT
2006-08-04  09:39            36,112 AULTAB.TXT
2006-08-04  09:39               428 AULUSR.TXT
               4 File(s)      1,788,648 bytes

    Now use the "LIST" command to generate the unload commands for you.

AUL> LIST TABLE SCOTT
UNLOAD TABLE SCOTT.EMP TO EMP.txt;
UNLOAD TABLE SCOTT.DEPT TO DEPT.txt;
UNLOAD TABLE SCOTT.SALGRADE TO SALGRADE.txt;
UNLOAD TABLE SCOTT.BONUS TO BONUS.txt;

    As we are going to recover the data as text format, please set the field separator and the row separator, following are the settings I usually used.

AUL> set field_tag \x07
  Current FIELD_TAG :\x07
AUL> set record_tag \x06
  Current RECORD_TAG :\x06

    Save these command to a text file, for example "unload_scott.sql", and then run it.

AUL> @unload_scott.sql
AUL> UNLOAD TABLE SCOTT.EMP TO EMP.txt;
2007-09-15 13:41:11
Unload OBJD=10478 FILE=5 BLOCK=1475 CLUSTER=0 ...
2007-09-15 13:41:12
AUL> UNLOAD TABLE SCOTT.DEPT TO DEPT.txt;
2007-09-15 13:41:12
Unload OBJD=10476 FILE=5 BLOCK=1459 CLUSTER=0 ...
2007-09-15 13:41:12
AUL> UNLOAD TABLE SCOTT.SALGRADE TO SALGRADE.txt;
2007-09-15 13:41:12
Unload OBJD=10481 FILE=5 BLOCK=1499 CLUSTER=0 ...
2007-09-15 13:41:12
AUL> UNLOAD TABLE SCOTT.BONUS TO BONUS.txt;
2007-09-15 13:41:12
Unload OBJD=10480 FILE=5 BLOCK=1491 CLUSTER=0 ...
2007-09-15 13:41:12
AUL>

    The recovery is complete now, for each table, 3 files generated, a SQL file to recreate the table, a SQL Loader control file used for data loading and a text file contain the data. These files are generated under the directory where you run this utility.

EMP.txt         -- Data File
EMP_sqlldr.ctl  -- SQL Loader Control File
EMP_syntax.sql  -- Recreate Table SQL File

    Then we can restore it to new database, with SQL*Plus and SQL Loader.

sqlplus scott/tiger @EMP_syntax.sql
sqlldr scott/tiger control=EMP_sqlldr.ctl

    If you have a lot of tables to be restored, please write a shell script for it, not so difficult. And finally check the SQL Loader log files and check the data in the new database. Don't forget to process the payment if you purchase the license for recovery.

Comments (1)

Read this to set field tag and record tag options correctly.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36