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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Generate DDL from a Schema

Re: Generate DDL from a Schema

From: <fitzjarrell_at_cox.net>
Date: Fri, 21 Sep 2007 12:35:10 -0700
Message-ID: <1190403310.864357.209690@19g2000hsx.googlegroups.com>


On Sep 21, 12:45 am, nickli2..._at_gmail.com wrote:
> Hi,
>
> I am trying to generate DDL scripts for each table, view and other
> indexes under a schema. I tested using DBMS_METADATA package and its
> get_ddl procedure. However, I can only output the create table (view,
> indexes) statements for all the tables in a schema in one script, not
> in each separation script, such as create table table_1.script, create
> table table_2.script, etc.
> I have hundreds of tables, views, indexes, types and other objects
> under one schema. I would appreciate your advice on the issue.
>
> Thanks in advance.
>
> Nick Li

This is why one scripts object creation and saves those very scripts for later use. Did you not save these scripts? Or did you create objects 'on the fly'?

Using exp/imp can produce a script of DDL to recreate the entire schema if you choose the show=y and log=<somefilename here> options to the imp utility. You could then 'slice and dice' the one large script into smaller, table-sized pieces.

I still say you should have had these scripts at hand so you could use them again at a later date. Why you don't possess them is a mystery.

David Fitzjarrell Received on Fri Sep 21 2007 - 14:35:10 CDT

Original text of this message

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