Oracle Solution for Error ora-01182

Solution for Oracle Error ORA-01182

ORA-01182: cannot create database file string - file is in use or recovery

What triggered the Error:

Attempted to use ALTER DATABASE CREATE DATAFILE to recreate a datafile that is online in an open instance or is being recovered.

What should we do to fix it:

Close database in all instances and end all recovery sessions