
While restoring a database, we might often face RMAN-06085 as an Oracle DBA. Today we will discuss how to resolve RMAN-06085 in Oracle. Let’s go through the steps :
Table of Contents
Step 1: Check the datafile Location on the database :
select name from v$datafile;
Output :

Step 2: Generate set newname command for the datafiles issuing the below command :
select 'set newname for datafile ' ||FILE#|| ' to '||'''/u01/app/oracle/oradata/TEST/'|| substr(name,instr(name,'/',-1)+1, instr(substr(name,instr(name,'/',-1)+1),'.')-1 ) ||'.dbf'' ;' file_name from v$datafile;
Output :

Step 3: Issue the below command to restore datafile and generate script with set newname command
run
{
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH3 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH4 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH5 DEVICE TYPE DISK;
select 'set newname for datafile ' ||FILE#|| ' to '||'''/u01/app/oracle/oradata/TEST/'|| substr(name,instr(name,'/',-1)+1, instr(substr(name,instr(name,'/',-1)+1),'.')-1 ) ||'.dbf'' ;
select 'set newname for tempfile ' ||FILE#|| ' to '||'''/u01/app/oracle/oradata/TEST/'|| substr(name,instr(name,'/',-1)+1, instr(substr(name,instr(name,'/',-1)+1),'.')-1 ) ||'.dbf'' ;' file_name from v$tempfile;
restore database;
switch datafile all;
switch tempfile all;
recover database;
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
RELEASE CHANNEL CH3;
RELEASE CHANNEL CH4;
}
So, here are the steps that you can follow to resolve RMAN-06085 and generate restoration script with set newname command. Hop this helps!! Also, you can get more information from the below Oracle Doc as well :
RMAN-06085 – Database Error Messages
Other Oracle Related Articles :
- How to check Rman backup status in Oracle
- RMAN-04006: error from auxiliary database – Easy Step-by-Step Guide