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: How create a test-system from a dump easily?

Re: How create a test-system from a dump easily?

From: Howard J. Rogers <dba_at_hjrdba.com>
Date: Sun, 9 Dec 2001 09:18:38 +1100
Message-ID: <3c12928c$0$19078$afc38c87@news.optusnet.com.au>


Open up a dump file in something like Wordpad and have a look at what it contains (it's not a text file, though, so for Heaven's sake don't try and save it from there, otherwise you'll lose the dump file).

You'll see it has a lot of 'create table xxx' statements, followed by a lot of 'insert into xxx...' statements.

Knowing that, think logically, and you'll be able to answer your own questions!

The first time you run import, it will create all your tables. The next time you run import with a new dump file, the tables it wants to create already exist (they were created in the first import run, of course). Ordinarily, that would cause import to crash out with errors. But if you run the second and subsequent imports with the parameter IGNORE=Y, then it skips over the table creation errors, and just gets on with the insert statements.

But then, what is it inserting? Exports only ever export the *entire* set of rows from a table, not particular ones (unless you use the 8i QUERY parameter). That means the second and subsequent dump files will contain ALL the rows for the table -including the ones which were imported from the first dump file. If you've got primary key or unique key constraints on the tables, fair enough: you'll get one hell of a list of violation errors, but it will then end up successfully importing the new rows which were added to the source tables after your first export. If you haven't got such constraints, then you'll simply end up duplicating every row which was already in the table following the first import.

And this scenario mounts up ...the 10th import will be violating uniqueness of every row imported by the previous 9, or duplicating every row included in the previous 9. The thing is going to get slower and slower, and worse and worse.

On the other hand, if you have a script which truncates every table in the relevant schema before running the new import, you'll be fine (provided you remember the IGNORE=Y parameter). Whether that is feasible or not, only you can say.

Regards
HJR

--
----------------------------------------------
Resources for Oracle: http://www.hjrdba.com
===============================


"Captain Blight" <cptnblght_at_compuserve.de> wrote in message
news:3c125181$0$545$8252f6af_at_news.compuserve.de...

> Hi,
>
> Given a clean win2000 server and a dump (full=Y). How can I create a
> testsystem for experiments?
> Is it possible, to update the test-system every now and then by simply
> importing a fresh dump? (The relevant data are contained in only one
> schema).
> Can I spare some drive-space, since the test-server is not as big as the
> productive-server?
>
> Thanks for your help
>
>
Received on Sat Dec 08 2001 - 16:18:38 CST

Original text of this message

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