How to resolve RMAN-06085 in Oracle : Easy Step by step Guide

RMAN-06085
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 :

Step 1: Check the datafile Location on the database :

select name from v$datafile;

Output :

How to resolve RMAN-06085 in Oracle : Easy Step by step Guide

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 :

How to resolve RMAN-06085 in Oracle : Easy Step by step Guide

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 :

Leave a Reply