Resolving UNNAMED datafile errors:
-----------------------------------
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: ' /u01/app/oracle2/product/11.2.0/dbhome_1/dbs/
UNNAMED00010'
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
Now we'll see how to resolve an UNNAMED datafile issue in a Data Guard configuration:
1. Check for the datafile number that needs to be recovered from the standby
database:
SQL> SELECT * FROM V$RECOVER_FILE WHERE ERROR LIKE '%MISSING%';
FILE# ONLINE ONLINE_ ERROR CHANGE# TIME
---------- ------- ------- ----------------- ---------- ----------
10 ONLINE ONLINE FILE MISSING 0
2. Identify datafile 10 in the primary database:
SQL> SELECT FILE#,NAME FROM V$DATAFILE WHERE FILE#=10;
FILE# NAME
---------- -----------------------------------------------
536 /u01/app/oracle2/datafile/ORCL/users03.dbf
3. Identify the dummy filename created in the standby database:
SQL> SELECT FILE#,NAME FROM V$DATAFILE WHERE FILE#=10;
FILE# NAME
---------- -------------------------------------------------------
536 /u01/app/oracle2/product/11.2.0/dbhome_1/dbs/
UNNAMED00010
4. If the reason for the creation of the UNNAMED file is disk capacity or a nonexistent
path, fix the issue by creating the datafile in its original place.
5. Set STANDBY_FILE_MANAGEMENT to MANUAL:
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
System altered.
6. Create the datafile in its original place with the ALTER DATABASE CREATE
DATAFILE statement:
SQL> ALTER DATABASE CREATE DATAFILE '/u01/app/oracle2/
product/11.2.0/dbhome_1/dbs/UNNAMED00010' AS '/u01/app/oracle2/
datafile/ORCL/users03.dbf';
Database altered.
If OMF is being used, we won't be allowed to create the datafile with the preceding
statement. We'll come across the following error:
SQL> ALTER DATABASE CREATE DATAFILE '/u01/app/oracle2/
product/11.2.0/dbhome_1/dbs/UNNAMED00010' AS '/u01/app/oracle2/
datafile/ORCL/users03.dbf';
*
ERROR at line 1:
ORA-01276: Cannot add file
/u01/app/oracle2/datafile/ORCL/users03.dbf. File has an Oracle
Managed Files file name.
In order to avoid the error, run the following command:
SQL> ALTER DATABASE CREATE DATAFILE '/u01/app/oracle2/
product/11.2.0/dbhome_1/dbs/UNNAMED00010' AS NEW;
Database altered.
7. Set STANDBY_FILE_MANAGEMENT to AUTO and start Redo Apply:
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO SCOPE=BOTH;
System altered.
SQL> SHOW PARAMETER STANDBY_FILE_MANAGEMENT
NAME TYPE VALUE
----------------------------------- ----------- ------------------
standby_file_management string AUTO
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT
LOGFILE DISCONNECT FROM SESSION;
Database altered.
8. Check the standby database's processes, or the alert log file, to monitor Redo Apply:
SQL> SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS
FROM V$MANAGED_STANDBY;