Rename/move a data file in Oracle

Rename/move a data file in Oracle

For oracle 12c, move or rename of datafile can be done online with one line

alter database move datafile 'E:\oradata\hello.dbf' to 'F:\oradata\hello1.dbf';

Make the tablespace offline:

alter database datafile 'E:\oradata\hello.dbf' offline;

Move the file physically to a new location.

mv E:\oradata\test.dbf F:\oradata\produce01.dbf

Rename at DB level

alter database rename file 'E:\oradata\test.dbf' to 'F:\oradata\producing01.dbf';

Make the datafile online:

alter database datafile 'E:\oradata\test.dbf' online;
This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply