I was recently contacted by a friend who had an emergency: her standby database had stopped synchronizing. Reviewing the alert.log file she found the error ORA-01274, and concluded that a datafile had been added to the primary database, and when trying to replicate the change to the standby, this datafile had not been created due to lack of disk space.
Last night on the Oracle Technet forum, someone reported a similar situation, but in that case the source of the error was less clear, the result was the same: the creation of one or more datafiles was not replicated. What to do in a situation like this?
In situations like this, where Oracle fails to create a datafile in the standby database, the datafile is registered in the controlfile with a name similar to UNNAMED0000 and synchronization is aborted with the error ORA-1274: cannot add datafile.
The steps to follow to overcome the impasse are as follows:
1. Disable automatic standby file management
SQL> alter system set standby_file_management = manual scope=memory;
2. Identify the datafile which is “unnamed”
SQL> select name from v$datafile where name like '%UNNAMED%';
NAME
--------------------------------------------------------
/oracle/product/10.2.0/database/UNNAMED00033
3. Create the datafile to the correct filename
SQL> alter database create datafile
'/oracle/product/10.2.0/database/UNNAMED00033' as '/oradata/orcl/dat04.dbf';
4. Enable automatic standby file management
SQL> alter system set standby_file_management = auto scope=memory;
Now you can restart the recovery, problem solved!