Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RMAN and point-in-time recovery 1

Status
Not open for further replies.

KenCunningham

Technical User
Mar 20, 2001
8,475
0
0
GB
Hi folks,

I'm trying to use rman and our flash recovery area to restore a database to a point-in-time in late January. a restore database validate comes up with no problems, but when I issue a restore database until time ... etc, all seems to go well, but on completion, trying to alter database open results in the lovely 'File 1 needs media recovery' so beloved of us all. It was my understanding that RMAN is supposed to take care of this when doing the backup? Any comments/advice welcome. Thanks.

The internet - allowing those who don't know what they're talking about to have their say.
 
The "restore database" command only restores datafiles from backup. It does not do any forward recovery. You will need to add a "recover database until time ..." to get all of the datafiles to a consistent point in time.

If you were restoring from a cold backup, the datafiles would already all be at the same SCN and you wouldn't need the recovery step. But you apparently are restoring from an online backup.
 
Thanks karluk, so restore database of itself won't apply changes even with an 'until time "to_date(etc etc' addition? This is the command I have been using:

restore database
until time "to_date('01/27/10' 17:00:00','MM/DD/RR HH24:MI:SS')";

As you say the backup is being doen from a so-called flash recovery area.

The internet - allowing those who don't know what they're talking about to have their say.
 
I'm reasonably sure that both the "restore" and "recover" commands are necessary, and your personal experience confirms this. My understanding is that the "until time" clause in the restore command just lets rman know that it needs to restore from a backup that was taken before the specified time. The forward recovery is still a separate step.

The examples in the Oracle 10g rman documentation also reflect the need for both a restore and recover. For example, here is a snippet from the 10g Backup and Recovery Advanced User's Guide, which shows how to recover to through a specific archived log sequence number. Both the restore and recover command are used, and they both need to specify the desired log sequence number.

Code:
# uses automatic channels configured in restored control file
RESTORE DATABASE UNTIL SEQUENCE 13243;
RECOVER DATABASE UNTIL SEQUENCE 13243; # recovers to latest archived log
 
many thanks again, Karluk, that makes it rather more clear than I had it in my head!

The internet - allowing those who don't know what they're talking about to have their say.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top