How to Resolve ORA-01537: cannot add file

  • by

ORA-01537

Tried to add a data file to a permanent tablespace, but it failed with ORA-01537.

SQL> alter tablespace example add datafile '/u01/app/oracle/oradata/ORCL/example01.dbf' size 10m autoextend on next 10m maxsize unlimited;
alter tablespace example add datafile '/u01/app/oracle/oradata/ORCL/example01.dbf' size 10m autoextend on next 10m maxsize unlimited
*
ERROR at line 1:
ORA-01537: cannot add file '/u01/app/oracle/oradata/ORCL/example01.dbf' - file already part of database

ORA-01537 means that the data file you want to add to the tablespace is already in the directory you specified.

Solution

To solve ORA-01537, you should either use:

  • Different file name or
  • Different directory

in the statement.

In practice, we recommend to use a different file name.

SQL> alter tablespace example add datafile '/u01/app/oracle/oradata/ORCL/example02.dbf' size 10m autoextend on next 10m maxsize unlimited;

Tablespace altered.

We solved it.

Leave a Reply

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