I am trying with RMAN duplicate database using offline backup in 12c R1 (12.1.0.2) with below command
connect auxiliary /
run {
set newname for database to '/logs/datafiles/%b%f%i';
DUPLICATE TARGET DATABASE TO db12cr1
SPFILE
set CONTROL_FILES='/logs/orcl12cr1.ctl'
set LOG_ARCHIVE_FORMAT ='orc12cr1g_%t_%s_%r'
LOGFILE
GROUP 1 ('/logs/redo01a.log',
'/logs/redo01b.log') SIZE 100M REUSE,
GROUP 2 ('/logs/redo02a.log',
'/logs/redo02b.log') SIZE 100M REUSE
BACKUP LOCATION '/home/oracle/backup/12cr1/' NOFILENAMECHECK ;
}
EOF
In 11g R2 and 12c R2 datafiles created in given location with original name with parameter %b but in 12c R1 (12.1.0.2) need to give extract parameter either %I or %f with %b.