Oracke RMAN: Recover DB when backup folder has changed

oraclerestorerman

Scenario:

  • RMAN backp where made in this folder: /xxx/yyyy
  • Database was accidentally erased.
  • For weird reason, backup pieces are no longer in /xxx/yyyy, they are now in /aaa/bbb
  • I do an startup nomount, restore controlfile from new location /aaa/bbb
  • I put the DB in mount mode.
  • When I try to restore the BD it fails because backup pieces and not found (restored controlfile says backup pieces should be in /xxx/yyyy )
  • I try so set CHANNEL DEVICE TYPE DISK FORMAT to the new location (/aaaa/bbb) hoping that RMAN is smart enough to find the backup pieces, but that cannot be done with a backup controlfile.

How can I restore in this scenario where I do have all my backups in another folder than originally backed up to?

Best Answer

The entries of backup pieces are still pointing to /xxx/yyyy in the controlfile.

After you reach MOUNT stage, catalog the backup pieces from their new location. In RMAN:

catalog start with '/aaa/bbb';

After this, continue as you normally would.

Update:

For 9i, the above is not possible, there is no such option in 9i, you can not catalog backup pieces, this feature was added in 10g. The solution is in the below note:

how to restore or clone a 9i database to different host when backup location is different (Doc ID 1451140.1)

It suggests mounting the database (controlfile) with a 10g software, use the above catalog command, then shut down the instance, and continue with the 9i software.

I think it is easier to create a symlink /xxx/yyyy pointing to /aaa/bbb.