Oracle Linux - Proper Method to Move a Data File

Moving a datafile from mount point /disk2 to /disk1 on an Oracle 10g database that is up and running


/* take the tablespace offline */
ALTER TABLESPACE TP6_TS_TABLES OFFLINE NORMAL;

# make sure you have the right data files, prevent unhappy accidents
ls -lh /disk1/oradata/datafiles/emspri.dbf 
ls -lh /disk2/oradata/datafiles/emspri.dbf 

# copy the file in the OS
cp /disk2/oradata/datafiles/emspri.dbf /disk1/oradata/datafiles/emspri.dbf 

-- let Oracle know the file is moved
ALTER DATABASE RENAME FILE '/disk2/oradata/datafiles/emspri.dbf' to '/disk1/oradata/datafiles/emspri.dbf';

-- put the tablespace back online
ALTER TABLESPACE TP6_TS_TABLES ONLINE;


After you move the file

clean up tasks -- delete the old data file to free up disk space
backup the control files