Skip to content
Home » Oracle » How to Resolve ORA-01523: cannot rename data file to

How to Resolve ORA-01523: cannot rename data file to

ORA-01523

Tried to rename a data file, but it failed with ORA-01523.

SQL> alter database rename file '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/data_file_02.dbf' to '/oradata/ORCLCDB/ORCLPDB/data_file_01.dbf';
alter database rename file '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/data_file_02.dbf' to '/oradata/ORCLCDB/ORCLPDB/data_file_01.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01523: cannot rename data file to '/oradata/ORCLCDB/ORCLPDB/data_file_01.dbf' - file already part of database

ORA-01523 means that the target file location is already in the file list of control file, there's no way to overwrite the existing file.

It could be your misunderstanding or misspelling. Most likely, you have moved some files previously. Thus, you should make sure that the statement is correct, especially the target file name.

In this case, we misspelled the target file name which we have already moved and renamed it previously. So we correct the target file name and issue it again.

SQL> alter database rename file '/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/data_file_02.dbf' to '/oradata/ORCLCDB/ORCLPDB/data_file_02.dbf';

Database altered.

Leave a Reply

Your email address will not be published. Required fields are marked *