Recover Oracle database after drive loss Interview Question

Posted on

Question :

How would you answer this as an interview question?

The database crashed and you lost a
drive containing one of your control
files and another drive containing an
entire redo log group. You have a
level 0 backup from yesterday morning,
a differential backup from yesterday
evening, and a cumulative backup from
this morning. In addition three days
of redo logs are on disk. You backed
up the control file to trace just an
hour before the crash. How do you
recover the database?

Answer :

The very first thing I’d try is copying the surviving control file then restarting the DB – the loss of the controlfile is what caused the DB to crash, and if the redo log group happened to be INACTIVE at the time, then I’m pretty much OK. I’d find this out from the alert log. So long as there is a disk in the right place, I can issue CLEAR LOGFILE and they will just be recreated.

If not then we have a problem – the SCN in the controlfile is ahead of the DBFs and we’ve no way to get there. We have no choice but to perform a point-in-time-recovery, and we have to discard those DBFs as well. In RMAN, restore database (assuming controlfile autobackup), recover until the highest SCN in the archived redo logs, then OPEN RESETLOGS. Since I have the cumulative incremental, I don’t need the differential incremental (I’m not sure why you’d mix the two types? Also why if we had several disks for redo why we’d put an entire group on one disk rather than multiplexing all groups).

(There is probably a much better answer involving flashback, but I have to confess that I have only used explicitly created flash restore points so far, never run through a DR scenario).

Leave a Reply

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