Re: How to split a data definition SQL script file (DDL script)

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 16 Sep 2006 16:41:47 -0700
Message-ID: <1158450107.699177.178800_at_e3g2000cwe.googlegroups.com>


Martin T. wrote:
> Sybrand Bakker wrote:
> > On Sat, 16 Sep 2006 21:22:21 +0200, Seb <arx9qekubvq93e3_at_jetabe.net>
> > wrote:
> >
> > >Hello,
> > >
> > >I need to split a Oracle data definition SQL script file (DDL script) to
> > >many files, each file corresponding to one command category (table
> > >creation, constraint creation, index creation, etc).
> > >Do you know some tool to do that ?
> > >
> > >Thanks in advance for your answers !
> >
> >
> > awk, vi and sed come to mind. If you are on Windows, gvim is a vi
> > clone for Windows, www.gvim.org If you need awk and sed too you can
> > download Cygwin, which is (korn)shell clone for Windows.
> >
> > And then of course Perl could do it.
> >
> Perl! Perl! Perl! :-) (Is there anything you can't use it for?)
> But then again, not meaning to be rude to the OP, someone asking this
> question will probably not be able to make Perl do it.
>
> cheers,
> Martin
>
> p.s.: I agree that this post was not really helpful.

Seb, if you also need to know how to generate the DDL for Oracle objects see the Suppled PL/SQL Packages and Types manual or equivilent for your release of Oracle (8.1 up I believe) for the DBMS_METADATA package.

Also the indexfile parameter of imp covered in the Utilities manual may be of interest for table and index definitions. The previously mentioned Unix utilities can be used on the results of the imp Show parameter to cut out DDL from an import file.

Version 10 impdp also has some DDL extract options but I do not remember the parameter name off the top of my head and rather than open the manual I will leave that to you if you need the feature.

HTH -- Mark D Powell -- Received on Sun Sep 17 2006 - 01:41:47 CEST

Original text of this message