Re: sql script to recreate all database objects
Date: Tue, 29 Sep 1998 09:09:05 +1000
Message-ID: <36101710.F55135DB_at_somerset.com.au>
I was hoping that there was a "well known" SQL script or tool to create the database DDL. For example, Informix has the DBSchema utility.
Export then import with show=y is better than nothing. Here is a quick and dirty perl script to clean up the output a little:
LINE: while (<STDIN>) {
s/^ //g; # get rid of first space on line s/\"//g; # get rid of all the quotes s/\n//g; # get rid of the new line chars s/\) /\)\n/g; # add some new lines in more or less the right places s/STORAGE/\nSTORAGE/g; s/CREATE/\n\nCREATE/g; s/ALTER/\n\nALTER/g; print $_;
}
Joel Garry wrote:
> On Mon, 28 Sep 1998 13:28:34 +1000, shayne nee-salvador <shaynen_at_somerset.com.au> wrote:
> >How do you get Oracle to produce a script to create all the objects in
> >the database?
> >
>
> One way is to use the exp program with full=y and rows=N, then the imp program
> with show=Y, redirect the output.
>
> I habitually do an exp in development or new-to-me environments, then grep
> for whatever I need (often empirically determined sizing for tables or
> indices).
>
> jg
> --
> These opinions are my own and not necessarily those of Information Quest or
> Pebble In The Sky http://www.informationquest.com mailto:jgarry_at_nospameiq.com
> http://ourworld.compuserve.com/homepages/joel_garry Remove nospam to reply.
> mailto:joel_garry_at_compuserve.nospam.com "See your DBA?" I AM the @#%*& DBA!
Received on Tue Sep 29 1998 - 01:09:05 CEST