Sunday, January 15, 2017

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

Cause: This error will encounter when standby_file_management is set to manual and when set to auto and file path which is added to the primary database does not exist on standby site or db_file_name_convert is not define.

Solution:

SQL> startup;
ORACLE instance started.

Total System Global Area 3958439936 bytes
Fixed Size                  2259320 bytes
Variable Size            2197816968 bytes
Database Buffers         1744830464 bytes
Redo Buffers               13533184 bytes
Database mounted.
ORA-10458: standby database requires recovery
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01111: name for data file 7 is unknown - rename to correct file
ORA-01110: data file 7: '/u01/app/oracle/product/11.2.4/db_1/dbs/UNNAMED00007'

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/erpdb/datafile/system.256.910894817
+DATA/erpdb/datafile/sysaux.257.910894817
+DATA/erpdb/datafile/undotbs1.258.910894817
+DATA/erpdb/datafile/users.259.910894817
+DATA/erpdb/datafile/example.264.910894901
+DATA/erpdb/datafile/undotbs2.265.910894995
+DATA/erpdb/datafile/tbs_gg.299.930621725

7 rows selected.

SQL>

In standby side

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/erpdbdr/datafile/system.298.929218701
+DATA/erpdbdr/datafile/sysaux.300.929218693
+DATA/erpdbdr/datafile/undotbs1.302.929218687
+DATA/erpdbdr/datafile/users.299.929218693
+DATA/erpdbdr/datafile/example.297.929218701
+DATA/erpdbdr/datafile/undotbs2.301.929218687
/u01/app/oracle/product/11.2.4/db_1/dbs/UNNAMED00007

7 rows selected.

SQL>

SQL> alter system set standby_file_management='manual';

System altered.

SQL> alter database create datafile '/u01/app/oracle/product/11.2.4/db_1/dbs/UNNAMED00007' as '+DATA/erpdbdr/datafile/tbs_gg.dbf';

Database altered.

SQL> alter system set standby_file_management='auto';

System altered.

SQL>
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/erpdbdr/datafile/system.298.929218701
+DATA/erpdbdr/datafile/sysaux.300.929218693
+DATA/erpdbdr/datafile/undotbs1.302.929218687
+DATA/erpdbdr/datafile/users.299.929218693
+DATA/erpdbdr/datafile/example.297.929218701
+DATA/erpdbdr/datafile/undotbs2.301.929218687
+DATA/erpdbdr/datafile/tbs_gg.dbf

7 rows selected.

SQL>

No comments:

Post a Comment