Create a SQL file to create the table for faster recovery

    When we cannot open the database for access, we can try AUL software. With system available we can use the DMP format for recovery, however TXT format is more robust according to the previous experience. And sometime DBA cannot find out the script to recreate the tables in new database, so generate a script to recreate the tables is useful during recovery. I made this change, when you recover database with TXT format, a new SQL file will be created.

    For example, describe the table structure in AUL.

AUL> desc anysql.emp

Storage(OBJ#=10560 OBJD=10560 TS=4 FILE=4 BLOCK=627 CLUSTER=0)
No. SEQ INT Column Name                   Type
--- --- --- ----------------------------- ----------------
  1   1   1 EMPNO                         NUMBER(4) NOT NULL
  2   2   2 ENAME                         VARCHAR2(30)
  3   3   3 JOB                           VARCHAR2(9)
  4   4   4 MGR                           NUMBER(4)
  5   5   5 HIREDATE                      DATE
  6   6   6 SAL                           NUMBER(7,2)
  7   7   7 COMM                          NUMBER(7,2)
  8   8   8 DEPTNO                        NUMBER(2)

    Recover the table by TXT format.

AUL> unload table anysql.emp to emp.txt;
2007-05-31 21:43:35
Unload OBJD=10560 FILE=4 BLOCK=627 CLUSTER=0 ...
2007-05-31 21:43:35
AUL>

    You will find that a new SQL file (tablename_syntax.sql) will be created under the directory where you run the AUL, for example (EMP_syntax.sql) :

CREATE TABLE "EMP" ( "EMPNO" NUMBER(4) NOT NULL , "ENAME" VARCHAR2(30) , "JOB" VARCHAR2(9) , "MGR" NUMBER(4) , "HIREDATE" DATE , "SAL" NUMBER(7,2) , "COMM" NUMBER(7,2) , "DEPTNO" NUMBER(2) );

    Hope this improvement can fasten the database recovery.

Post a comment

SCode:
Mail(*, but will not be displayed):
Home: