Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

ORA-19504/ORA-17502/ORA-15005 – RMAN Backup Failed to create the file in +ORADATA

Posted by Mir Sayeed Hassan on May 14th, 2018

ORA-19504/ORA-17502/ORA-15005 – RMAN Backup Failed to create the file in +ORADATA

The below scenario occur in one of my RAC Production database.
We would like to take the backup of the full database/incremental database by using the user defined location in +ORADATA
[oracle(af2db2)@afcdb2]$ . oraenv
ORACLE_SID = [afcdb2] ? +ASM2
The Oracle base remains unchanged with value /u01/oracle
[oracle(+ASM2)@afcdb2 scripts]$ asmcmd
ASMCMD> ls

CLUSTERDG/
ORADATA/
ASMCMD> cd ORADATA/
ASMCMD> mkdir DB_BKP/
ASMCMD> cd  DB_BKP/
ASMCMD> mkdir RMAN_BKP    -- We would like to place the backup in this location

Below are my crontab & RMAN Scripts I /home/oracle/scripts location

[oracle(afcdb2)@afcdb2 ~]$ crontab -e
47 17 * * * /home/oracle/scripts/friday

RMAN Scripts:

[oracle(afcdb2)@afcdb2 ~]$ cat friday
export ORACLE_SID=afcdb2
export ORACLE_HOME=/u01/oracle/ora11gr2
/u01/oracle/ora11gr2/bin/rman target / nocatalog@/home/oracle/scripts/friday.rcv > /home/oracle/scripts/friday_level_0/rman`date +%F`.log
[oracle(afcdb2)@afcdb2 ~]$ pwd
/home/oracle/scripts
[oracle(afcdb2)@afcdb2 ~]$ cat friday.rcv
run {
CROSSCHECK ARCHIVELOG ALL;
CROSSCHECK BACKUP;
CROSSCHECK COPY;
backup as compressed backupset incremental level 0 database tag friday_level_0 format '+ORADATA/DB_BKP/RMAN_BKP’;
backup as compressed backupset archivelog all format '+ORADATA/DB_BKP/RMAN_BKP' delete input;
backup spfile format '+ORADATA/DB_BKP/RMAN_BKP';
backup current controlfile format '+ORADATA/DB_BKP/RMAN_BKP’;
#delete noprompt expired backup;
#delete noprompt obsolete;
}
exit;
Error log:
input datafile file number=00089 name=+ORADATA/afcdb/datafile/afc_tbl.282.790252211
------------------------ ------------------- ----------------------
channel c20: starting piece 1 at 13-MAY-18
RMAN-03009: failure of backup command on c19 channel at 05/13/2018 17:16:28
ORA-19504: failed to create file "+ORADATA/ DB_BKP/RMAN_BKP"
ORA-17502: ksfdcre: 4 Failed to create file +ORADATA/DB_BKP/RMAN_BKP’
ORA-15005: name "DB_BKP/RMAN_BKP" is already used by an existing alias
Channel c19 disabled, job failed on it will be run on another channel
Reason:

The above backup failed due to invalid format specified in RMAN backup script as shown above is not correct because backup pieces will not create with unique name using format as you have given in your RMAN BACKUP Script.

To resolve this problem you need to add ‘%U’ with the user defined format to guarantee generate unique file name for your backup pieces as shown below:
[oracle(afcdb2)@afcdb2 ~]$ vi friday.rcv
run {
CROSSCHECK ARCHIVELOG ALL;
CROSSCHECK BACKUP;
CROSSCHECK COPY;
backup as compressed backupset incremental level 0 database tag friday_level_0 format '+ORADATA/DB_BKP/RMAN_BKP/%d_%t_L0_%D_%M_%Y_%U';
backup as compressed backupset archivelog all format '+ORADATA/DB_BKP/RMAN_BKP/%d_%t_L0_%D_%M_%Y_%U' delete input;
backup spfile format '+ORADATA/DB_BKP/RMAN_BKP/%d_%t_L0_%D_%M_%Y_%U';
backup current controlfile format '+ORADATA/DB_BKP/RMAN_BKP/%d_%t_L0_%D_%M_%Y_%U';
#delete noprompt expired backup;
#delete noprompt obsolete;
}

exit;

%U – Specifies a system-generated unique file name (default).

More information about the RMAN Backup format as shown below & also refers to the Oracle documents.

The format used in RMAN Backup is “%d_%c_%t_%p” — etc

Where:

%d – It specifies the name of the database

%c – It specifies the copy number of the backup piece within a set of duplexed backup pieces.

%t – It specifies the backup set time stamp

%p – It specifies the piece number within the backup set

Hence the RMAN backup scripts works fine & backup of the database taken successfully.