Steps to rename datafile using RMAN.

Please execute the below in rman.

run
{
sql ‘alter database datafile 12 offline’;
COPY DATAFILE 12 TO ‘/u01/oracle/oradata/USERS04.DBF’;
set newname for datafile 12 to ‘/u01/oracle/oradata/USERS04.DBF’;
switch datafile 12;
recover datafile 12;
sql ‘alter database datafile 12 online’;
}

select FILE_NAME,FILE_ID,TABLESPACE_NAME,status from dba_data_files where FILE_NAME=’/u01/oracle/oradata/USERS04.DBF’;

select file#,name,enabled from v$datafile where name=’/u01/oracle/oradata/USERS04.DBF’;

  • March 19, 2016 | 16 views
  • Comments