Resolve ORA-15126 while performing RMAN image copy backup to ASM device with format ‘%U’

Resolve ORA-15126 while performing RMAN image copy backup to ASM device with format ‘%U’

While performing incrementally updated backup on a RAC database with the script below :

rman target "'name/password as SYSBACKUP'" 
 run {
  allocate channel c01 device type disk connect='name/password@RACDB1 as SYSBACKUP';
  allocate channel c02 device type disk connect='name/password@RACDB2 as SYSBACKUP';
  
  backup incremental level 1 for recover of copy with tag 'INCR_RACDB_UPDATE' datafilecopy 
  format '+BACKUP/RACDB/%U' database;
   recover copy of database with tag 'INCR_RACDB_UPDATE';

  release channel c01;
  release channel c02;
}

I got this error :

ORA-19504: failed to create file "+BACKUP/RACDB/data_d-racdb_i-1627042229_ts-sysaux_fno-3_b737ea8t"
ORA-17502: ksfdcre:4 Failed to create file +BACKUP/RACDB/data_d-racdb_i-1627042229_ts-sysaux_fno-3_b737ea8t
ORA-15126: component within ASM file name 'data_d-racdb_i-1627042229_ts-sysaux_fno-3_b737ea8t' exceeds maximum length
channel c05 disabled, job failed on it will be run on another channel

SOLUTION

Don’t use %U while taking the image copy backup to ASM. For other fileystem it will work fine . Currently its a limitation in ASM that filename can not be more than 30 characters length. Use some other format like %u_%p_%c
for the datafile image backup. (Doc ID 387678.1)

Correction to the script:

rman target "'name/password as SYSBACKUP'" 
 run {
  allocate channel c01 device type disk connect='name/password@RACDB1 as SYSBACKUP';
  allocate channel c02 device type disk connect='name/password@RACDB2 as SYSBACKUP';
  
  backup incremental level 1 for recover of copy with tag 'INCR_RACDB_UPDATE' datafilecopy 
  format '+BACKUP/RACDB/%u_%p_%c' database;
   recover copy of database with tag 'INCR_RACDB_UPDATE';

  release channel c01;
  release channel c02;
}

NB. RACDB1 and RACDB2 are tnsnames.ora entries to point to each RAC node.