How to fix the Oracle error ORA-01121: cannot rename database file string – file is in use or recovery?

In this post, you’ll learn more about the Oracle ErrorORA-01121: cannot rename database file string – file is in use or recovery with the details on why you receive this error and the possible solution to fix it.

Oracle Error Description

ORA-01121: cannot rename database file string – file is in use or recovery

Reason for the Error ORA-01121: cannot rename database file string – file is in use or recovery

Attempted to use ALTER DATABASE RENAME to rename a datafile that is online in an open instance or is being recovered.

How to fix the Error ORA-01121: cannot rename database file string – file is in use or recovery ?

You can fix this error in Oracle by following the below steps

Close database in all instances and end all recovery sessions.