You may hit this error on your standby database. I have 12c standalone database with dataguard setup.

We got ORA-01111, ORA-01110, ORA-01157 errors on standby database and apply has been stoped.

There are many reasons for a file being created as UNNAMED or MISSING in the standby database, including insufficient disk space on standby site (or) Improper parameter settings related to file management.

On standby by site If Automatic standby file management is enabled, operating system file additions and deletions on the primary database are replicated on the standby database.

Errors From Alert Log file on standby database:

Errors in file /XXX/bdump/cc_mrp0_22294.trc:
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’
ORA-01157: cannot identify/lock data file 588 – see DBWR trace file
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’

On standby Trace File:-

MRP0: Background Media Recovery terminated with error 1111
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’
ORA-01157: cannot identify/lock data file 588 – see DBWR trace file
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’
ORA-01157: cannot identify/lock data file 588 – see DBWR trace file
ORA-01111: name for data file 588 is unknown – rename to correct file
ORA-01110: data file 588: ‘/XXX/db_1/dbs/UNNAMED00588’
ARCH: Connecting to console port…

So here is the our troubleshooting steps:

  1. On stabdby; Check for the files needs to be recovered.

SQL> select * from v$recover_file where error like ‘%FILE%’;

SQL> select * from v$recover_file where error like '%FILE%';

     FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME
---------- ------- ------- -------------------- ---------- --------------------
       588 ONLINE  ONLINE  FILE MISSING                  0
  1. On Primary; Identify data file 588
     FILE# NAME
---------- ----------------------------------------------------------------------
       588 +DATA/PROD/datafile/xxx.1223.23231241
  1. On standby; Identify dummy file
  2. SQL> select file#,name from v$datafile where file#=588;
     FILE# NAME
---------- ----------------------------------------------------------------------
       588 /XXX/db_1/dbs/UNNAMED00588
  1. On stabdby;

SQL> alter system set standby_file_management=MANUAL scope=both;
System altered.

SQL> show parameter standby_file_management
NAME TYPE VALUE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      MANUAL

SQL> alter database create datafile ‘/XXX/db_1/dbs/UNNAMED00588’ as ‘+DATA/PROD/datafile/xxx.1223.23231241’;

Database altered.

If You are managing File system ASM with OMF, you are not allowed to create data file, Because it will file system names and format maintained by ASM. If you try to Create datafile as above with ASM File, You will pass with below error.

SQL> alter database create datafile ‘/u01/oracle/orahome/dbs/UNNAMED00613’ as ‘+DATA/PROD/datafile/xxx.1223.23231241’;
*
ERROR at line 1:
ORA-01276: Cannot add file
‘+DATA/PROD/datafile/xxx.1223.23231241’ File has an Oracle Managed Files file name.

So Run above command:

SQL> alter database create datafile ‘/XXX/db_1/dbs/UNNAMED00588’ as new;
Database altered.

  1. On stabdby; Enable STANDBY_FILE_MANAGEMENT to AUTO and start MRP

SQL> alter system set standby_file_management=AUTO scope=both;
System altered.

SQL> alter database recover managed standby database disconnect from session;
Database altered.