Re: what is the fastest way to restore a db
Date: Fri, 19 Sep 2008 17:14:39 -0700 (PDT)
Message-ID: <2811ebaa-f8d8-47bf-8690-8af0dbcf939a@25g2000prz.googlegroups.com>
On Sep 18, 11:37 pm, 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
>
> 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
>
> I've never used rman to do backup/restore. Is it faster than expdp/
> impdp?
>
> In db2 the restore is about 2 or 3 minutes long. In oracle the restore
> is about 30 minutes long. I mean, the hardware is the same.
>
> So, what should I do?
>
> Regards
>
> Marco Strullato
Also check out seed databases http://68.142.116.68/docs/cd/B19306_01/server.102/b14196/install003.htm#sthref99
To slightly argue with David, since splitting hairs is a hallowed DBA tradition, RMAN makes a physical backup, while export makes a logical backup. For production (and some people consider development and testing databases production for those types of users), physical backups are considered far superior, and necessary when transactional recovery is required. Exports are more for moving data between incompatible databases or being able to grab a small part of a database.
Note that rman can restore particular tablespaces, so if you allocate your schemata to particular tablespaces, it becomes easy to restore. In fact, Oracle DBA work requires the ability to recover transactions, it's really the ONE THING you need to be able to get right, so it becomes worth it to do it that way just to become comfortable with recovery.
But flashback is cool, too.
jg
-- @home.com is bogus. I managed to not talk like a pirate in this post!Received on Fri Sep 19 2008 - 19:14:39 CDT