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: How to get DDL from data dictionary?

Re: How to get DDL from data dictionary?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 26 Mar 2003 07:25:48 -0800
Message-ID: <2687bb95.0303260725.6ab6f4a6@posting.google.com>


"Ana C. Dent" <anacedent_at_hotmail.com> wrote in message news:<uh7ga.2436$w%4.1057_at_fed1read02>...
> John wrote:
> > Hello Sir/Miss,
> >
> > Could you tell me how can I get a DDL statement for example "create
> > table..." in data dictionary for a user table? For example, I have a
> > employee table, I need to know the create table statement for this
> > table.
> >
> > Thank you very much for you help.
> >
> > John
> > nt_friends_at_yahoo.com.cn
>
> RTFM WRT DBMS_METADATA
Oracle provided package dbms_metadata only exists with version 9 and higher. For versions lower than this and still available with 9+ the imp utility includes two options that can be used to capture DDL: show and indexfile. See the Utilities manual for details.

But what many shops have done prior to dbms_metadata (and because the way it writes the code may not be most desirable may still do) is write SQL or Pl/SQL that reads dba_tables, dba_tab_columns, dba_indexes, dba_ind_columns, and dba_constraints plus a few other dictionary tables to generate the DDL. Several DDL generation scripts have been posted in the past and you might want to search the achives.

HTH -- Mark D Powell -- Received on Wed Mar 26 2003 - 09:25:48 CST

Original text of this message

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