Re: what is the fastest way to restore a db

From: <fitzjarrell_at_cox.net>
Date: Fri, 19 Sep 2008 05:54:15 -0700 (PDT)
Message-ID: <f5118276-f307-4cc8-9885-cba1987113fe@2g2000hsn.googlegroups.com>


On Sep 19, 1:37 am, Marco <marco.strull..._at_gmail.com> wrote:
> Hi, thanks for answers!
>
> So, I'm tuning performances of web applications so I have to do very
> often database restore to back to the original state of applications
> after making it "smoking".
> Before now I've ever used db2 as database and this is the first time
> I'm using oracle as database: I don't have much experience on oracle
> so please excuse me if I say something obvious.
>
> The command I used to back up the original database is exactly this:
> expdp fx/password_at_teng schemas=fx directory=dump dumpfile=fx_dump.dmp
> logfile=fx_dump.log
>

That is not a backup, it is a schema export. A backup copies datafiles, an export copies out definitions of database objects and the associated data. They are not the same.

> and the command I'm using to restore the db is exactly
> impdp fx2/password_at_teng REMAP_TABLESPACE='FXTS':'FX2TS' directory=dump
> PARALLEL=2 dumpfile=fx_dump.dmp REMAP_SCHEMA=fx:fx2 NOLOGFILE=Y
> TABLE_EXISTS_ACTION=replace
>

Which 'imports' the schema objects and data into the same or a different database.

> I've never used rman to do backup/restore. Is it faster than expdp/
> impdp?
>

It's different, as it's an actual backup, not an export of object definitions and data.

> In db2 the restore is about 2 or 3 minutes long.

And what, exactly, is DB2 doing during this 'restore'?

> In oracle the restore
> is about 30 minutes long. I mean, the hardware is the same.
>

And the processes are different, using different resources. You're comparing apples to prunes.

> So, what should I do?
>

One option is to use RMAN to take a cold backup of your database prior to any 'modifications'. When you've finished with your adjustments then restore the database from that cold backup; it should be much faster, but it still won't be in the 2 to 3 minute range.

> Regards
>
> Marco Strullato

David Fitzjarrell Received on Fri Sep 19 2008 - 07:54:15 CDT

Original text of this message