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

Home -> Community -> Usenet -> c.d.o.server -> Re: exporting a database schema?

Re: exporting a database schema?

From: Howard J. Rogers <howardjr_at_www.com>
Date: Sat, 19 Aug 2000 22:25:30 +1000
Message-ID: <399e7c9b@news.iprimus.com.au>

<snowc_at_hugh-snow.com> wrote in message news:8njpra$8ap$1_at_nnrp1.deja.com...
> I have inherited two Oracle 8 databases: a production database and a
> test database. I would like to compare the differences between the
> databases. In SQL server I would output a complete SQL script for both
> and then compare the difference using a utility such as 'diff'. Is
> there a way that I can export the complete SQL for an Oracle database?
>

There is a clunky sort of way to do it using nothing more than Import, actually.

When you import, you can specify a parameter called 'Indexfile=...'. You set it to the path and filename you want to generate -that will produce a text file that contains the entire SQL recipe for reconstructing whatever it was you were importing. In other words, if you do this when doing a full database import, the text file will contain every SQL statement required to recreate the whole database.

Why it is called an 'Indexfile'? -just that Import comments out all the statements about creating Users and tables and so on. The only lines in the script that are actually functional from the word go are the 'create index' lines.

Off the top of my head, I think you have to also set the "Index" parameter to be 'N' for the index file to be generated, but couldn't swear to that.

Of course, for any of this to work, you have to have a database available into which you can perform the import in the first place. On the other hand, you can set 'Rows=N' to prevent actual data being imported.

Hope that helps
HJR
> Thanks in advance.
>
> Chris Snow
>
>
> Can replies please be sent to:
> snowc_at_hugh-snow.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Aug 19 2000 - 07:25:30 CDT

Original text of this message

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