After a database restore, set newname is attempted but the RMAN-06015 is reported. We can manually import the catalog in, in set newname.
See the following test cases:
-- 1. Pure set newname is acceptable
RMAN> run {
2> set newname for datafile 6 to '/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222 ';
3>}
Executing command: SET NEWNAME
-- 2. But after the switch, No. This is because the information of this file (the file on asm) cannot be found in your current control file.
RMAN> run {
2> set newname for datafile 6 to '/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222 ';
3> switch datafile 6;
4>}
Executing command: SET NEWNAME
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of switch command at 11/12/2014 10:36:09
RMAN-20230: datafile copy not found in the repository
RMAN-06015: error while looking up datafile copy name:/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222
-- 3. Use this file as datafilecopy and catalog to the control file:
RMAN> catalog datafilecopy '/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222 ';
Cataloged datafile copy
Datafile copy file name =/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222 RECID = 1 STAMP = 863433432
-- 4. Then you can set newname and switch.
RMAN> run {
2> set newname for datafile 6 to '/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222 ';
3> switch datafile 6;
4>}
Executing command: SET NEWNAME
Datafile 6 switched to datafile copy
Input datafile copy RECID = 1 STAMP = 863433432 file name =/u01/oracle11gR2/oracle/oradata/ora11g/U_NOLOB2.dbf222