Forum Stats

  • 3,759,046 Users
  • 2,251,494 Discussions
  • 7,870,477 Comments

Discussions

RMAN Backup

user12274353
user12274353 Member Posts: 1 Blue Ribbon
edited Sep 24, 2021 10:16PM in Recovery Manager (RMAN)

Can we run a RMAN disk backup to a directory which is different from the DB_RECOVERY_FILE_DEST. When I run a disk backup using the following script, backupset (the one containing the datafiles backup) always go to the DB_RECOVERY_FILE_DEST while the archivelog and controlfile backups go to the directory specified in the script. Is there a way, I can backup everything to the directory specified in the backup script?

#/bin/bash

export BKP_DIR=/DUMPDIR/PRODDB1

$ORACLE_HOME/bin/rman target=/ << EOF  

set echo on

show all;

backup 

 as compressed backupset

 database plus archivelog

 format '$BKP_DIR/%I_%d_%Y%M%D_%u';

exit;

EOF

Answers

  • EdStevens
    EdStevens Member Posts: 28,467 Gold Crown
    edited Sep 26, 2021 1:39AM

    Did you take a look at the documentation? The syntax chart for the BACKUP command shows that the BACKUP DATABASE and the PLUS ARCHIVELOG each have their own FORMAT options.

    ---- Edit to add comment, several hours after original

    In other words, you specified FORMAT for the PLUS ARCHIVE LOG, thus overriding FRA spec, but you did not supply a FORMAT for the basic BACKUP DATABASE, thus causing that to default to the FRA.