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: Restore & Recovery

Re: Restore & Recovery

From: Howard J. Rogers <howardjr2000_at_yahoo.com.au>
Date: Sun, 08 Sep 2002 08:24:16 +1000
Message-ID: <3d7a7c50@dnews.tpgi.com.au>

y wrote:

> ORACLE 8i EE
>
> I have two questions about "Restore and Recovery":
>
> Q1. I create a database with ARCHIVELOG mode. When I lost one of my
> data file (Users tablespace). During recovery phase, I have to:
> SQL> startup mount
> SQL> recovery database
> SQL> alter database open
> How does it means the whole database is available during recovery
> process? During recovery phase, I can't open the database.

Not sure what you're really asking here, but if you mean 'how can I perform a recovery of a datafile whilst the rest of the database is open for business as usual', then the answer is: at the mount stage, offline the datafile that is causing the problem; open what's left of the database, and then recover the problematic tablespace.

For example:

SQL> alter database datafile 6 offline;
SQL> alter database open;
SQL> host cp /backup/data06.dbf /true/location/data06.dbf
SQL> recover datafile 6;
SQL> alter tablespace BLAH online;

The same approach can be taken when the loss of the datafile does not cause the database as a whole to crash. Hence, you can offline the relevant tablespace, and then recover it in the same way.

>
> Q2). Using RMAN
> Why when I need to restore and recover a tablespace, I have to take
> the tablespace "OFFLINE TEMPORARY".

Because RMAN is about to restore a datafile on top of a potentially still-existing (though obviously unusable) datafile. If Oracle hasn't 'let go' of it by taking it offline, copying the backup version on top of it is going to be problematic at best.

As to why 'offline TEMPORARY' -well, the 'temporary' keyword controls whether and what sort of checkpoint is issued. A standard 'offline' would attempt to checkpoint the datafile -but since we presumably know something's wrong with it (otherwise we wouldn't be attempting to recover it), why bother?

> And when I need to restore and recover a datafile, I need only to
> take the tablespace "OFFLINE IMMEDIATE"?
>

Immediate doesn't attempt a checkpoint at all. Temporary checkpoints if it can, but doesn't get upset if it can't. It doesn't make a whole heap of difference, actually.

Regards
HJR  
> Thanks in advance,
  Received on Sat Sep 07 2002 - 17:24:16 CDT

Original text of this message

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