Skip to Main Content
  • Questions
  • Force RMAN to look at a different directory for backup files

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Pete.

Asked: February 01, 2010 - 10:00 am UTC

Last updated: February 02, 2010 - 2:21 pm UTC

Version: 10.2.4

Viewed 1000+ times

You Asked

Hello Tom,
I have an RMAN question. Note that in this scenario I am NOT using a recovery catalog.

Scenario:
I have copied my production database (SID=eprod) RMAN backups to a dev server and I need to recover the database to the dev server. The eprod database RMAN backups are created in directory /u05/ora_backup/ePROD on the prod server. When I run the recovery on the dev server RMAN looks for the backup files in directory /u05/ora_backup/ePROD. In order to perform the recovery I had to create directory /u05/ora_backup/ePROD on the dev server and place the eprod RMAN backups there. To keep the story short it wasn't easy to have the /u05/ora_backup/ePROD directory created and I would have preferred not to have done it.

Queston:
In this scenario is there a way to tell RMAN to look in another directory for the eprod database backups?

Thanks.

and Tom said...

I just just mv'ed my backup from /home/ora10gr2/bkup to /home/ora10gr2/test

and then used the catalog command (new in 10g, not going to work in 9i) to point to the new backup pieces:

RMAN> <b>catalog backuppiece '/home/ora10gr2/test/0tl4uenk_1_1';
</b>
cataloged backuppiece
backup piece handle=/home/ora10gr2/test/0tl4uenk_1_1 recid=19 stamp=709836002

RMAN> restore tablespace users;

Starting restore at 01-FEB-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=289 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /home/ora10gr2/oradata/ora10gr2/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/ora10gr2/bkup/0tl4uenk_1_1
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/home/ora10gr2/test/0tl4uenk_1_1 tag=TAG20100201T163147
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 01-FEB-10



You can see it "failing over" to the new location.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

You can also catalog the whole dir

Harel Safra, February 02, 2010 - 1:07 pm UTC

You can also catalog all the contents of a directory using:

catalog start with '/path/to/directory/';

Faster than manually going over all the backup pieces.

Harel Safra
Tom Kyte
February 02, 2010 - 2:21 pm UTC

sure, I would sort of hope that someone would actually go read about what they could do with it - I would sort of hope ;) .....

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.