Re: Can you DESCRIBE or print a schema?

From: <jl34778_at_corp02.d51.lilly.com>
Date: 25 Apr 94 14:23:01 EST
Message-ID: <1994Apr25.142301.1_at_corp02.d51.lilly.com>


In article <39013046_at_f573.n115.z1.fidonet.org>, Michael.Stowe_at_f573.n115.z1.fidonet.org (Michael Stowe) writes:
> *** Quoting Patel_at_Purccvm.Bitnet to All dated 04-21-94 ***

>> Is there a way to get the create table, create index, .. statements
>> from my database?

>
> The export utility can create an export file containing SQL statements
> necessary to create everything in the database, including or excluding data.
> The resultant file can only be used by the import utility, but it is fast and
> requires almost no effort, aside from obtaining the proper username/password.
>
> If you need the statements in ASCII, you can get everything you need from the
> data dictionary, but you'll have to write it yourself in SQL, or locate a tool
> that is capable of this, such as Oracle CASE, which can read the data
> dictionary and generate DDL statements.

Actually, you can use imp with the INDEXFILE option to extract the DDL from the export file into a text file. The SQL won't be real pretty. The CREATE TABLE statements will be 'REM'ed out, but it is workable.

        $ imp / file=dump.file indexfile=mystuff.sql

When you use indexfile, imp will not import any rows or object definitions.

-- 
Bob Swisshelm                | swisshelm_at_Lilly.com     | 317 276 5472
Eli Lilly and Company        | Lilly Corporate Center  | Indianapolis, IN 46285
Received on Mon Apr 25 1994 - 21:23:01 CEST

Original text of this message