Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to dump oracle database to DDL/SQL syntax

Re: Is it possible to dump oracle database to DDL/SQL syntax

From: Howard J. Rogers <howardjr_at_www.com>
Date: Sun, 27 Aug 2000 08:46:56 +1100
Message-ID: <39a83aa6@news.iprimus.com.au>

<fenton_travers_at_my-deja.com> wrote in message news:8o4vkc$hos$1_at_nnrp1.deja.com...
> I have an oracle database and I want to dump it to a ddl file. Ie a
> file that I could later use like:
>
> $ sqlplus < myData.ddl
>
> so it would have the table drop syntax, table create syntax and the
> insert into syntax.
>
> I can do this simply with MySQL but my Oracle DBA says I can't do this
> in oracle and I don't believe him.
>

Always trust your DBA, Fenton!!

Seriously, though... he's sort of right. There's no way to track all DDL issued against a database that I can think of. On the other hand, if you want a script that will re-create a database, you could do worse than try doing an import with the 'indexfile' parameter set (to be a path/filename). If you do this when attempting a full database import, the 'indexfile' thus generated has actually got all the commands needed to reconstruct the entire database -although all the 'create table' statements etc will have 'REM' comments before them. Still -this is a text file, so you should be able to edit them out without too much bother.

How you then re-populate all those tables? Well, you could try *another* run of the import utility, this time setting 'ignore=y' -it should ignore all the errors that would arise as a result of object existence, and get on with the job of doing a whole bunch of insert statements.

Regards
HJR
> Fenton
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Aug 26 2000 - 16:46:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US