Introduction
In an Oracle Data Guard environment, maintaining synchronization between the primary and standby databases is critical for ensuring high availability and disaster recovery. However, after adding a new datafile to the primary database, you may encounter an UNNAMED datafile on the standby database, causing the Managed Recovery Process (MRP) to stop and disrupting redo apply.
This issue is commonly associated with errors such as:
ORA-01111: name for data file 9 is unknown - rename to correct file
ORA-01110: data file 9: '/home/app/oracle/product/19.3.0/db_1/dbs/UNNAMED00009'
ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
Although the solution may appear straightforward, understanding why Oracle creates an UNNAMED datafile, how the Managed Recovery Process (MRP) handles datafile creation, and what configuration issues lead to this problem is essential for every Oracle DBA.
In this article, we'll take a deep dive into the root cause, diagnostic approach, step-by-step resolution, and best practices to prevent UNNAMED datafile issues in Oracle Data Guard. The guide covers all common deployment scenarios, including Single Instance databases on a file system, Single Instance databases using ASM (Non-OMF), Oracle RAC standby databases using ASM (Non-OMF), and Oracle Managed Files (OMF) environments for both Single Instance and RAC. Whether you're managing a production Oracle Data Guard environment or troubleshooting a standby synchronization issue, this comprehensive guide will help you understand not only how to resolve the issue but also why it occurs and how to prevent it in future Data Guard deployments.
Understanding the UNNAMED Datafile Issue
- What is an UNNAMED datafile?
An UNNAMED datafile is a placeholder created by Oracle on a Data Guard standby database when it cannot automatically create a new datafile during redo apply. Instead of creating the actual datafile, Oracle registers it as UNNAMED000xx in the standby control file and stops the Managed Recovery Process (MRP) until the issue is resolved.
This issue commonly occurs due to incorrect DB_FILE_NAME_CONVERT, STANDBY_FILE_MANAGEMENT settings, missing storage paths, or Oracle Managed Files (OMF) configuration problems.
An UNNAMED datafile indicates that the standby database has received redo information about a new datafile from the primary database but was unable to create the corresponding physical datafile. As a result, Oracle creates a placeholder (UNNAMED000xx) and stops the Managed Recovery Process (MRP) to maintain data consistency.
- Why does Oracle create it?
Oracle creates an UNNAMED datafile when the Managed Recovery Process (MRP) on the standby database cannot automatically create a new datafile added on the primary database. This typically happens due to incorrect DB_FILE_NAME_CONVERT settings, STANDBY_FILE_MANAGEMENT configuration, missing storage paths, or Oracle Managed Files (OMF) configuration issues.
Instead of failing silently, Oracle creates an UNNAMED000xx placeholder in the standby control file and stops redo apply, allowing the DBA to identify and resolve the issue while maintaining data consistency.
Step-by-Step Resolution
Step 1: Identify the UNNAMED Datafile on the Standby Database
First, identify the UNNAMED datafile created by Oracle on the standby database. This helps determine the affected FILE#, which is required to map it to the corresponding datafile on the primary database.
SQL> SELECT FILE#, NAME, STATUS FROM V$DATAFILE WHERE NAME LIKE '%UNNAMED%';
FILE# NAME STATUS
---------- ------------------------------------------------------------ -------
9 /home/app/oracle/product/19.3.0/db_1/dbs/UNNAMED00009 RECOVER
Step 2: Verify the Corresponding Datafile on the Primary Database
Using the FILE# identified in the previous step, verify the original datafile on the primary database. This allows you to determine the correct file name and location that should exist on the standby.
SQL> SELECT NAME, STATUS FROM V$DATAFILE WHERE FILE#=9;
NAME STATUS
------------------------------------------------------------ -------
/home/app/oracle/oradata/ORCL/users03.dbf ONLINE
Step 3: Verify the Managed Recovery Process (MRP) Status
Before making any changes, check whether the Managed Recovery Process (MRP) is running. In most UNNAMED datafile scenarios, MRP stops automatically when it encounters the missing datafile.
SQL> SELECT PROCESS, STATUS, THREAD#, SEQUENCE# FROM V$MANAGED_STANDBY WHERE PROCESS LIKE 'MRP%';
no rows selected
Note: The no rows selected output confirms that MRP has already stopped, so there is no need to cancel managed recovery before proceeding.
Step 4: Create the Missing Standby Datafile
Create the missing standby datafile by mapping the UNNAMED placeholder to the correct physical location. This updates the standby control file and creates the required datafile.
SQL> ALTER DATABASE CREATE DATAFILE '/home/app/oracle/product/19.3.0/db_1/dbs/UNNAMED00009' AS '/home/app/oracle/oradata/ORCLDR/users03.dbf';
Database altered.
Step 4A: If the Standby Uses ASM (Non-OMF)
Create the missing standby datafile in the appropriate ASM disk group by mapping the UNNAMED placeholder to the desired ASM file location. This updates the standby control file and creates the required datafile in ASM.
SQL> ALTER DATABASE CREATE DATAFILE '+DATA/ORCL/UNNAMED00009' AS '+DATA/ORCL/DATAFILE/users03.dbf';
Step 4B: If the Standby Database is Oracle RAC Using ASM (Non-OMF)
In an Oracle RAC standby database using ASM, create the missing standby datafile from any one RAC instance by mapping the UNNAMED placeholder to the correct ASM location. Since the control file and ASM storage are shared, the datafile is created only once and becomes available to all RAC instances.
SQL> ALTER DATABASE CREATE DATAFILE '+DATA/ORCL/UNNAMED00009' AS '+DATA/ORCL/DATAFILE/users03.dbf';
Note: Execute this command only once from any RAC instance. There is no need to repeat it on each node.Step 4C: If the Standby Database Uses Oracle Managed Files (OMF)
If the standby database uses Oracle Managed Files (OMF), create the missing standby datafile using the AS NEW clause. Oracle automatically generates the appropriate datafile name and stores it in the location specified by the DB_CREATE_FILE_DEST parameter.
SQL> ALTER DATABASE CREATE DATAFILE '+DATA/ORCL/UNNAMED00009' AS NEW;
Note: This method applies to both Single Instance and Oracle RAC databases configured with Oracle Managed Files (OMF). Oracle automatically manages the file naming and placement.
Step 5: Start the Managed Recovery Process (MRP)
After successfully creating the standby datafile, restart the Managed Recovery Process (MRP) so that redo apply can continue and the standby database can synchronize with the primary database.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
Step 6: Verify the Datafile Status
Finally, verify that the newly created standby datafile is online. This confirms that Oracle has successfully replaced the UNNAMED placeholder with the correct datafile.
SQL> SELECT NAME, STATUS FROM V$DATAFILE WHERE FILE#=9;
NAME STATUS
------------------------------------------------------------ -------
/home/app/oracle/oradata/ORCLDR/users03.dbf ONLINE
Best Practices
Follow these best practices to minimize the chances of encountering UNNAMED datafile issues in an Oracle Data Guard environment:
- Keep STANDBY_FILE_MANAGEMENT set to AUTO to allow Oracle to automatically manage standby datafiles.
- Verify DB_FILE_NAME_CONVERT after any storage or directory structure changes to ensure correct file name conversion between the primary and standby databases.
- Use Oracle Managed Files (OMF) wherever possible to simplify standby datafile creation and reduce manual configuration.
- Maintain consistent storage layouts between the primary and standby databases, especially in file system-based environments.
- Monitor the Managed Recovery Process (MRP) after adding new datafiles on the primary database to ensure redo apply continues without interruption.
- Review the standby alert log regularly for warnings or errors related to datafile creation and redo apply.
- Validate Data Guard synchronization after any structural database changes, such as adding tablespaces or datafiles.
Conclusion
An UNNAMED datafile issue in Oracle Data Guard occurs when the standby database cannot automatically create a newly added datafile during redo apply. As a protective mechanism, Oracle creates an UNNAMED000xx placeholder and pauses the Managed Recovery Process (MRP) to maintain database consistency.
By identifying the UNNAMED datafile, verifying its corresponding datafile on the primary database, creating the missing standby datafile, and restarting MRP, the standby database can resume redo apply and return to a synchronized state.
Understanding why this issue occurs is just as important as knowing how to resolve it. Regularly validating Data Guard configuration parameters, monitoring redo apply, and following Oracle best practices can help prevent UNNAMED datafile issues and ensure a reliable disaster recovery environment.