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: backwards inferring scripts?

Re: backwards inferring scripts?

From: David Fitzjarrell <fitzjarrell_at_cox.net>
Date: 5 Dec 2004 07:29:48 -0800
Message-ID: <9711ade0.0412050729.41744a60@posting.google.com>


"IANAL_VISTA" <IANAL_Vista_at_hotmail.com> wrote in message news:<Xns95B4B59685C6FSunnySD_at_68.6.19.6>...
> laredotornado_at_zipmail.com (D. Alvarado) wrote in
> news:9fe1f2ad.0412031203.5b6a12db_at_posting.google.com:
>
> > Hello,
> > We are running Oracle 8.1.7 for Solaris and have an old set of
> > tables in our db. Unfortunately, we don't have the original SQL
> > scripts that created these tables. Is there some way in Oracle that
> > you can export a script with all the "CREATE TABLE" statements already
> > built? The tables we wish to do this for are
> >
> > COMPONENTS
> > PROGRAMS
> >
> > Much thanks, - Dave
>
> Alternatively, export with ROWS=N & then import into a 9i DB
> and use DBMS_METADATA to obtain the raw SQL.

Why go through all of that work when a simple imp indexfile=... will lay bare the DDL for the tables and the associated indexes? Having to create a 9i instance to use DBMS_METADATA is silly, really, when exp/imp can provide the information directly. As an example:

exp myuser/mypass file=oldtables.dmp tables=(components,programs) rows=n

imp myuser/mypass file-oldtables.dmp full=y indexfile=oldtables.sql

oldtables.sql will be created and will contain the create table statemetns (which will be REMarked) and the create index statements. It is the simplest way to generate such a script in the absence of any GUI tools and does not require a 9i database.

David Fitzjarrell Received on Sun Dec 05 2004 - 09:29:48 CST

Original text of this message

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