DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Sunday, March 20, 2016

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';

No comments: