RMAN point in time restore

Rman point in time restore:

rman
connect target /
connect catalog  user/password@catalog_database
run {
shutdown immediate
! now take an OS copy of current control file and current online redo logs in case need to regress
startup mount
set until time "to_date('Mon 04-Nov-2013 09:00:00','Dy DD-Mon-YYYY HH24:MI:SS')" ;
restore database preview ;  -- optional, to check if you need to restore any missing rman backup files from tape
restore database validate ;  -- another optional check
restore database ;
recover database ;
alter database open resetlogs ;
}

The “run” block is superfluous in later versions of Oracle (but I was at 10.2.0.5 where it is still needed).

“Restore database preview” failed to correctly list all the backup files I needed at that version, so I had to instead work that out manually.

Flashback database is another option if that is enabled at database level, which it is not by default. Check with “select flashback_on from v$database ;”

Flashback query is an even better option if is just one table or so that needs restored back, and that is enabled by default.

Posted in Rman

Leave a Reply

Your email address will not be published. Required fields are marked *

*