Tag Archives: Relocate data file online

Renaming and Relocating Online Data Files in Oracle 12c

Renaming and Relocating Online Data Files in Oracle 12c

In Oracle 12c, New feature is given from moving the datafiles from one location to another without downtime of the environment.
It increase the great flexibility of the Oracle Database moving datafiles to one location to other without downtime like move datafiles which is less needed to low cost storage or Move datafile to ASM Storage online without downtime.

Renaming an Online Data File

--renames the data file user1.dbf to user01.dbf while keeping the data file in the same location
ALTER DATABASE MOVE DATAFILE '/u02/oradata/ORCL/user1.dbf' TO '/u02/oradata/ORCL/user01.dbf';

Relocating or Move the online Data file

-- Move the datafile from one location to anther online.
ALTER DATABASE MOVE DATAFILE '/u02/oradata/ORCL/user01.dbf' TO '/u03/ORADATA/ORCL/user01.dbf';

Copying an Online Data File
KEEP keyword is used to keep the old file as its and copy file to new location

-- Copy the datafile from one location to anther without removing the old location file.
ALTER DATABASE MOVE DATAFILE '/u02/oradata/ORCL/user01.dbf' TO '/u03/ORADATA/ORCL/user01.dbf' keep;

Relocating or Move an Online Data File and Overwriting an Existing File
REUSE Keyword is used to overwrite the existing file with same name present in Destination folder

ALTER DATABASE MOVE DATAFILE '/u02/oradata/ORCL/user01.dbf' TO '/u03/ORADATA/ORCL/user01.dbf' REUSE;

Move or Relocate an online data file to ASM

ALTER DATABASE MOVE DATAFILE '/u02/oradata/ORCL/user01.dbf' TO '+dg01/data/orcl/datafile/user01.dbf';

Advertisements