How to Resolve the UNNAMED Datafile Issue in Oracle Data Guard

How to Resolve the UNNAMED Datafile Issue in Oracle Data Guard

How to Resolve the UNNAMED Datafile Issue in Oracle Data Guard

Oracle Data Guard helps organizations maintain high availability and disaster recovery by maintaining synchronized standby databases. However, problems can occur when a datafile created on the primary database is not correctly created or identified on the physical standby database.

One common issue is the UNNAMED datafile error, which can interrupt Redo Apply and prevent the standby database from completing recovery.

This issue is commonly associated with Oracle errors such as:

  • ORA-01111: Name for data file is unknown – rename to correct file.
  • ORA-01110: Data file identification details.
  • ORA-01157: Cannot identify or lock data file.
  • ORA-16004: Backup database requires recovery.

In this guide, we will explain why Oracle Data Guard creates UNNAMED datafile entries, how to identify the affected datafile, and how to resolve the issue on a physical standby database.

What Is the UNNAMED Datafile Issue in Oracle Data Guard?

An UNNAMED datafile issue occurs when Oracle Data Guard cannot correctly create or locate a corresponding datafile on the physical standby database after a datafile has been added to the primary database.

Oracle maintains information about database files in its control file. When a new datafile is created on the primary database, the corresponding operation must also be handled on the standby database.

The STANDBY_FILE_MANAGEMENT initialization parameter controls whether datafile additions and deletions are automatically managed on a physical standby database.

When this parameter is set to MANUAL, the DBA must manually handle new datafiles. If the required file is not copied and named correctly before the standby applies the corresponding redo, Oracle can create a control file entry with an UNNAMED filename.

For example:

ORA-01111: name for data file 46 is unknown – rename to correct file

ORA-01110: data file 46:

‘/u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00046’

ORA-01157: cannot identify/lock data file 46

The actual file number and path will vary depending on the database environment.

The presence of an UNNAMED entry indicates that Oracle needs the correct datafile mapping or file creation to continue recovery.

Why Does the UNNAMED Datafile Error Occur?

The following are common reasons for this issue:

1. STANDBY_FILE_MANAGEMENT Is Set to MANUAL

When STANDBY_FILE_MANAGEMENT is set to MANUAL, Oracle does not automatically create corresponding datafiles on the physical standby database.

If a new tablespace or datafile is created on the primary database, the DBA must ensure that the corresponding file is available on the standby.

If this is not completed before the relevant redo is applied, an UNNAMED entry may appear.

2. Incorrect DB_FILE_NAME_CONVERT Configuration

The DB_FILE_NAME_CONVERT parameter maps primary database datafile paths to corresponding standby database paths.

If the primary and standby databases use different directory structures, incorrect or missing conversion mappings can prevent Oracle from determining the correct standby datafile location.

3. Datafile Added Without Proper Standby Preparation

When a new datafile is added to the primary database, the standby must be able to create or locate its corresponding file.

If the file is unavailable, incorrectly named or mapped to an invalid location, managed recovery may stop.

4. Different Storage Configurations

Primary and standby databases may use different storage configurations, such as:

  • Filesystem storage.
  • Automatic Storage Management (ASM).
  • Oracle Managed Files (OMF).
  • Different disk groups or directory structures.

These differences must be considered when configuring datafile name conversion and creating standby datafiles.

Step 1: Identify the UNNAMED Datafile on the Standby Database

Connect to the physical standby database using an account with the required administrative privileges.

Execute the following SQL query to identify the datafiles:

SELECT FILE#, NAME, STATUS

FROM V$DATAFILE

ORDER BY FILE#;

Check the output for entries containing UNNAMED.

Example:

FILE#    NAME

——   ————————————————

1        +DATA/STBY/DATAFILE/system.257.123456789

2        +DATA/STBY/DATAFILE/sysaux.258.123456789

46       /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00046

In this example, datafile number 46 has an UNNAMED entry.

You can also check whether Oracle reports recoverable file errors:

SELECT *

FROM V$RECOVER_FILE;

Review the output to identify the affected file number and any reported recovery errors.

Step 2: Identify the Corresponding Datafile on the Primary Database

Connect to the primary database and identify the actual filename associated with the affected file number.

Execute:

SELECT FILE#, NAME, BYTES / 1024 / 1024 AS SIZE_MB

FROM V$DATAFILE

WHERE FILE# = 46;

Replace 46 with the actual file number identified on the standby database.

Example output:

FILE#    NAME                                      SIZE_MB

——   —————————————-  ——-

46       +DATA/PRIM/DATAFILE/USERDATA.456.123456   100

Record the following information:

  • Datafile number.
  • Original primary datafile name.
  • Datafile size.
  • Primary storage location.
  • Intended standby storage location.

These details are important when deciding how to create or map the standby datafile.

Step 3: Check the Standby File Management Configuration

Before modifying the affected file, check the current standby file management setting.

Execute the following command on the physical standby database:

SHOW PARAMETER STANDBY_FILE_MANAGEMENT;

You can also query:

SELECT NAME, VALUE

FROM V$PARAMETER

WHERE NAME IN (

    ‘standby_file_management’,

    ‘db_file_name_convert’

);

The STANDBY_FILE_MANAGEMENT parameter can have two values:

Value

Description

AUTO

Automatically manages eligible datafile additions and deletions on the physical standby.

MANUAL

Requires manual handling of datafile changes.

For normal Data Guard operations, Oracle recommends using AUTO with correctly configured file mappings.

Important: Do not change the parameter blindly. Before enabling automatic file management, verify the primary-to-standby path mapping and confirm that existing standby files cannot be overwritten.

Step 4: Stop Managed Recovery Before Correcting the File

If managed recovery is running and the standby requires manual intervention, cancel the recovery process before modifying the affected datafile.

Execute on the standby database:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Confirm that the managed recovery process has stopped before proceeding.

If you need to modify the file while STANDBY_FILE_MANAGEMENT is set to AUTO, Oracle’s documented restrictions must also be considered. For operations that require manual file handling, temporarily changing the parameter to MANUAL may be necessary.

For example:

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL

SCOPE=BOTH;

Use this only after confirming the appropriate configuration for your database and recovery procedure.

Step 5: Correct the UNNAMED Datafile Entry

The exact correction method depends on the standby configuration, storage type and whether the standby uses Active Data Guard.

Method A: Create the Datafile Using ALTER DATABASE CREATE DATAFILE

Oracle documents the ALTER DATABASE CREATE DATAFILE statement for resolving an UNNAMED datafile entry.

The general syntax is:

ALTER DATABASE CREATE DATAFILE

‘/path/to/UNNAMED00046’

AS ‘/path/to/correct_standby_datafile.dbf’;

For an ASM or OMF environment, an appropriate destination can be specified.

For example, where Oracle Managed Files is configured:

ALTER DATABASE CREATE DATAFILE

‘/u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00046’

AS NEW;

Oracle automatically selects an appropriate filename when OMF is enabled.

Alternatively, an explicitly selected ASM destination may be used where supported by the configuration:

ALTER DATABASE CREATE DATAFILE

‘/u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00046’

AS ‘+DATA’;

Use the actual UNNAMED filename and a valid destination for your environment.

Active Data Guard consideration: For a physical standby with the Oracle Active Data Guard option enabled, Oracle specifies creating the empty datafile through this SQL method after the UNNAMED entry has been added. The manual operating-system copy method should not be used in this case.

Method B: Manually Copy the Datafile Where Applicable

For a physical standby that does not use the Active Data Guard option, Oracle documents a manual file-copy approach when STANDBY_FILE_MANAGEMENT is set to MANUAL.

If the new datafile is copied and named correctly on the standby before Redo Apply processes the corresponding redo, no further intervention is required.

For example, an illustrative file-copy operation using a suitable transfer method could be:

scp /primary/path/userdata.dbf \

oracle@standby-server:/standby/path/userdata.dbf

The source and destination paths above are examples only.

The file must be copied from the correct primary datafile, and the standby path must match the expected file mapping.

If Redo Apply has already created an UNNAMED entry, do not assume that copying the file alone will correct the control file entry. Follow the appropriate Oracle-supported file recreation or renaming procedure for the database version and configuration.

Step 6: Verify the Datafile Configuration

After correcting the affected datafile, check the datafile information again.

Execute:

SELECT FILE#, NAME, STATUS

FROM V$DATAFILE

WHERE FILE# = 46;

Confirm that:

  • The UNNAMED filename is no longer present.
  • The datafile points to the correct standby storage location.
  • The file is available to the standby database.
  • There are no unresolved file errors.

You can also check:

SELECT *

FROM V$RECOVER_FILE;

The affected datafile should no longer appear as an unresolved recovery issue.

Step 7: Restore Automatic Standby File Management

If you temporarily changed STANDBY_FILE_MANAGEMENT to MANUAL, restore the intended configuration after completing the correction.

For an environment configured for automatic standby file management:

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO

SCOPE=BOTH;

Before restoring AUTO, verify the DB_FILE_NAME_CONVERT settings and ensure that the primary and standby paths do not overlap in a way that could overwrite existing files.

If the original configuration was intentionally MANUAL, restore that configuration instead.

Step 8: Restart Managed Recovery

If you temporarily changed STANDBY_FILE_MANAGEMENT to MANUAL, restore the intended configuratia

Once the datafile has been corrected and verified, restart managed recovery.

For a standby configured to use real-time apply, an example command is:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE

USING CURRENT LOGFILE DISCONNECT FROM SESSION;

The appropriate recovery command can differ depending on the Oracle Database release and Data Guard configuration.

Check the recovery processes:

SELECT PROCESS, STATUS, THREAD#, SEQUENCE#

FROM V$MANAGED_STANDBY;

On releases where V$MANAGED_STANDBY is deprecated or unavailable, use the appropriate Data Guard monitoring views, such as V$DATAGUARD_PROCESS.

Also verify the database role and open mode:

SELECT DATABASE_ROLE, OPEN_MODE

FROM V$DATABASE;

Finally, confirm that the standby is applying redo and that no further datafile errors are being reported.

How to Prevent the UNNAMED Datafile Issue

The following practices can help prevent similar issues in an Oracle Data Guard environment.

1. Configure STANDBY_FILE_MANAGEMENT=AUTO

For physical standby databases, configure automatic standby file management where appropriate.

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO

SCOPE=BOTH;

This allows Oracle to automatically handle eligible datafile additions and deletions on the standby database.

2. Verify DB_FILE_NAME_CONVERT

When primary and standby databases use different file locations, verify that the DB_FILE_NAME_CONVERT parameter contains the correct source and destination mappings.

Incorrect mappings can cause file creation problems and may introduce the risk of overwriting existing files.

3. Monitor Data Guard Recovery

Regularly monitor managed recovery, archive log transport and standby database errors.

Review relevant alert logs and Data Guard monitoring views to identify problems before they affect recovery.

4. Validate Storage Availability

Ensure that the standby database has sufficient storage capacity and that its ASM disk groups or filesystem destinations are available.

5. Follow a Controlled Tablespace and Datafile Change Process

Whenever new tablespaces or datafiles are added to the primary database, verify that the standby database can accommodate the changes.

This is particularly important in environments using different storage configurations or manual file management.

on after completing the correction.

For an environment configured for automatic standby file management:

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO

SCOPE=BOTH;

Before restoring AUTO, verify the DB_FILE_NAME_CONVERT settings and ensure that the primary and standby paths do not overlap in a way that could overwrite existing files.

If the original configuration was intentionally MANUAL, restore that configuration instead.

Conclusion

The Oracle Data Guard UNNAMED datafile issue generally occurs when a datafile added to the primary database cannot be correctly created or identified on the physical standby database.

By identifying the affected file, checking STANDBY_FILE_MANAGEMENT and DB_FILE_NAME_CONVERT, correcting the file mapping and restarting managed recovery, DBAs can often restore normal standby recovery without rebuilding the entire environment.

A properly configured Data Guard environment, combined with regular recovery monitoring and controlled database changes, helps reduce the likelihood of recurring datafile management issues.

Need help with Oracle Data Guard?

Netsoftmate provides Oracle Database consulting and infrastructure services to help organizations manage database availability, performance, disaster recovery and enterprise database environments.

Contact the Netsoftmate team to discuss your Oracle Database and Data Guard requirements.

Frequently Asked Questions

1. What does UNNAMED datafile mean in Oracle Data Guard?

An UNNAMED datafile is a control file entry created on a physical standby when Oracle cannot determine or create the correct corresponding datafile after processing a primary database change.

ORA-01111 indicates that the name for a standby datafile is unknown and must be corrected. It commonly occurs when a new primary datafile cannot be properly created or mapped on the physical standby database.

Run the following query on the standby database:

SELECT FILE#, NAME, STATUS

FROM V$DATAFILE

WHERE NAME LIKE '%UNNAMED%';

This identifies datafile entries whose filenames contain UNNAMED.

It enables automatic management of eligible datafile additions and deletions on a physical standby database, reducing the need for manual file handling.

DB_FILE_NAME_CONVERT maps primary database datafile paths to standby database paths when the two environments use different directory structures.

In many cases, yes. If the underlying issue is limited to an incorrectly mapped or missing datafile, the file can be corrected using an appropriate Oracle-supported recovery procedure. Rebuilding the standby is not automatically necessary.

No. It is particularly associated with physical standby datafile management. The exact behavior and resolution depend on the standby type, file management settings, Oracle version and storage configuration.