Re: Duplicating Oracle DB w/o Schema or Scripts

From: Steve Phelan <stevep_at_toneline.demon.co.uk>
Date: 1997/07/30
Message-ID: <870247352.13403.0.nnrp-5.c2de712e_at_news.demon.co.uk>#1/1


Tom Patton wrote in article <01bc9c87$de327ce0$be3c2299_at_tomremote>...

>Hi,
>
>Does anyone know of a method to generate a sql script or schema
>to create the tables, views, etc, of an Oracle/7 database?
>I am thinking about just massaging query output from the
>USER_* data dictionary tables using Sql*Plus, perl, and
>a bunch of elbow grease, but it seems like there should
>be an easier way (yeah-i know-like maintaining the schema
>definitions in a script from the beginning).
>
>Any suggestions are appreciated (especially via e-mail since
>I don't browse here all the time)
>
>-tom
>Tom-n-Tracy_at_msn.com

What you can do is:

  1. Export the database.
  2. Use the UNIX 'strings' command on the export file to extract the sql.
  3. Edit the output directly or run a perl (or C) script over it to clean it up.

As an alternative, have a look around some of the Oracle WEB sites, as I've seen scripts which can extract this info. Be careful about how much these scripts extract (i.e., do they get everything - tablespace assignments for objects, storage settings, etc.)

Steve Phelan. Received on Wed Jul 30 1997 - 00:00:00 CEST

Original text of this message