We can move or rename oracle data file while the data file is online/offline using the ALTER DATABASE MOVE DATAFILE command.
Examples:
- Renaming an online data file:
SQL> alter database move datafile '/u01/dbfile/ora12/users01.dbf' to '/u01/dbfile/ora12/users.dbf';
- Moving a data file to a new mount point:
SQL> alter database move datafile '/u01/dbfile/ora12/users.dbf' to '/u02/dbfile/ora12/users.dbf';
- You can also specify the data file number when renaming or moving a data file:
SQL> alter database move datafile 3 to '/u01/dbfile/ora12/users.dbf';
- If you want to keep a copy of the original file, you can use the KEEP option:
SQL> alter database move datafile 4 to '/u01/dbfile/ora12/users.dbf' keep;
Ezana Answered question 29/11/2022