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: <oratune_at_aol.com>
Date: Thu, 31 Aug 2000 21:09:42 GMT
Message-ID: <8omhi4$frj$1@nnrp1.deja.com>

In article <39a83aa6_at_news.iprimus.com.au>,   "Howard J. Rogers" <howardjr_at_www.com> wrote:
>
> <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.
>
>

The indexfile parameter to imp will only generate the CREATE TABLE and CREATE INDEX statements, nothing more. To truly achieve a workable script to reconstruct a schema or entire database use the show=y and log=<some filename> parameters to imp, NOT the indexfile parameter. The show=y will show everything that is being done by imp to create objects in the database. The log=<some filename> will capture the output from the show=y to a file you can edit later.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Aug 31 2000 - 16:09:42 CDT

Original text of this message

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