Skip to content

How to Resolve ORA-15005: name is already used by an existing alias

  • by

ORA-15005

ORA-15005 means that there's already a file with the same name existing in the same path. Therefore, Oracle cannot create the file for you.

Usually, it's a misspelling or typing issue, but if you intend to do that, you should handle it carefully. In this post, we have 2 cases for you.

Let's see those error patterns.

1. Add DataFile

Tried to add a datafile to a tablespace, but it failed with ORA-15005.

SQL> alter tablespace example add datafile '+DATA/ORCLCDB/ORCLPDB/example02.dbf' size 10m autoextend on next 10m maxsize unlimited;
alter tablespace example add datafile '+DATA/ORCLCDB/ORCLPDB/example02.dbf' size 10m autoextend on next 10m maxsize unlimited
*
ERROR at line 1:
ORA-01119: error in creating database file '+DATA/ORCLCDB/ORCLPDB/example02.dbf'
ORA-17502: ksfdcre:4 Failed to create file +DATA/ORCLCDB/ORCLPDB/example02.dbf
ORA-15005: name "ORCLCDB/ORCLPDB/example02.dbf" is already used by an existing alias

2. Add LogFile

Tried to add a redo logfile to the database, but it failed with ORA-15005.

SQL> alter database add logfile thread 1 group 7 '+DATA/ORCLCDB/redo07a.log' size 2048m;
alter database add logfile thread 1 group 7 '+DATA/ORCLCDB/redo07a.log' size 2048m
*
ERROR at line 1:
ORA-00301: error in adding log file '+DATA/ORCLCDB/redo07a.log' - file cannot be created
ORA-17502: ksfdcre:4 Failed to create file +DATA/ORCLCDB/redo07a.log
ORA-15005: name "ORCLCDB/redo07a.log" is already used by an existing alias

Solution

Please check your statement for any typing or spelling issue, you might use the old file name for this statement. If the file was used before and is no longer used, you can REUSE it.

1. Add DataFile

For an existing datafile, you can reuse it like this.

SQL> alter tablespace example add datafile '+DATA/ORCLCDB/ORCLPDB/example02.dbf' size 10m reuse autoextend on next 10m maxsize unlimited;

Tablespace altered.

We put REUSE modifier right after SIZE clause.

2. Add LogFile

For an existing logfile, you can reuse it like this.

SQL> alter database add logfile thread 1 group 7 '+DATA/ORCLCDB/redo07a.log' size 2048m reuse;

Database altered.

We appended REUSE modifier to the statement.

As you can see, a REUSE modifier was added to the statement, which enable us to reuse the existing file.

Leave a Reply

Your email address will not be published.