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

Home -> Community -> Usenet -> c.d.o.tools -> Re: generating scripts

Re: generating scripts

From: <ddf_dba_at_my-deja.com>
Date: 2000/06/30
Message-ID: <8jipn2$lnt$1@nnrp1.deja.com>#1/1

In article <N7165.1187$c5.4515_at_newsfeeds.bigpond.com>,   "The Siebrands" <siebrand_at_bigpond.com> wrote:
> Try using the exp / imp functions:
>
> 1) Firstly export the database:
> exp / file=<schema.dmp> \
> rows=n constraints=y indexes=y grants=y \
> direct=y owner=<schema>
>
> 2) Import the file using the indexfile option
> imp / file=<schema.dmp> \
> contraints=y grants=y indexes=y \
> indexfile=<schema.out>
>
> 3) Edit the s<schema.out> file, this has all of the indexes, grants,
 create
> table, crea views, stored procedure, etc
>
> SP <spant1_at_aol.com> wrote in message
> news:ZXS55.415$0x.13764_at_nuq-read.news.verio.net...
> > How can I generate scripts of all or any of the objects in a
 database?
> >
> >
>
>

This is a nice thought but it is not correct. The 'indexfile' parameter to imp will provide the create table and create index statements for the schema in question, with the 'CREATE TABLE' statements remarked, but no other objects can be created. This option is designed to list create index statements for a schema. This is, by the way, an excellent method for migrating indexes from one tablespace to another. A better alternative is to use imp in this way:

     imp / file=<schema.dmp> full=y show=y > <schema>.sql 2>&1

The 'show' parameter to imp will list grants, procedures, views, tables, indexes, packages and sequences; basically the compete schema is at your fingertips in a SQL*Plus/Server Manager script.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 30 2000 - 00:00:00 CDT

Original text of this message

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