How can I change default backup location for oracle11g using RMAn?

radu florescu picture radu florescu · Feb 9, 2012 · Viewed 43.8k times · Source

I want to change to another drive due to lack of disk space.

How can I change the default location of backup files used by oracle to another drive using RMAN?

By default it's in the folder ORACLE_HOME from variables.

edit:

Found some links with problems like mine here, but they didn't help.

My script looks like this one:

run {
allocate channel d1 type disk;
allocate channel d2 type disk;
backup
format 'd:/backups/%U.bkp'
database plus archivelog;
release channel d1;
release channel d2;
}

Edit : By running the above scripts the backup will never finish

Answer

Adam Musch picture Adam Musch · Feb 9, 2012

If performing a BACKUP operation with RMAN, the location of backupsets / backup pieces / image copies / etc is determined by the ALLOCATE CHANNEL command.

run 
{
  allocate channel d1 device type disk format 'd:/backups/%U.bkp';
  backup database include current controlfile;
  release channel d1;
}

If not specifying a location for a disk channel, Oracle defaults the location to $ORACLE_HOME, as that's a path Oracle knows exists.