Showing posts with label MRP process down with ORA-10458 ORA-01157 ORA-01111 in Standby Database. Show all posts
Showing posts with label MRP process down with ORA-10458 ORA-01157 ORA-01111 in Standby Database. Show all posts

Monday 14 October 2019

MRP process down with ORA-10458 ORA-01157 ORA-01111 in Standby Database

idle@SYS> alter database open;
alter database open
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01157: cannot identify/lock data file 274 - see DBWR trace file
ORA-01111: name for data file 274 is unknown - rename to correct file
ORA-01110: data file 274:
'/d01/app/oracle/product/12.1.0/db_1/dbs/UNNAMED00274'

Reason: 

This Error occurs if we add a Datafile OR Tablespace in PRIMARY Database and that could not be translated to the Standby Database due to these Reasons:
  • Standby_file_management is set to MANUAL
  • Primary & Physical Standby are having different file structures and DB_FILE_NAME_CONVERT is not set according to the Directory Structures in Primary and Standby
  • Insufficient Space or wrong Permissions on the Standby Database to create the Datafile
  • If standby_file_management is set to Auto ,but directory path of Primary and standby are different , db_file_name_convert is not set ,but db_create_file_dest has been set to wrong value on standby
Solution:

Step 1: set standby database file management parameter from AUTO to MANUAL.  (Standby Database)
BACDB@CDB$ROOT@SYS> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL; 

Step 2:  conn as sysdba and set pdb

SQL> alter session set container=;

Step 3: Create datafile as new

Alter database create datafile '/d01/app/oracle/product/12.1.0/db_1/dbs/UNNAMED00274' as '+DATA/bacdb/emob/image36.dbf' size 30G;

Step 4:  set standby database file management parameter from  MANUAL to AUTO (Standby Database)
BACDB@CDB$ROOT@SYS> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO; 

Step 5: Verify the Filename is correct

SQL> select name from v$datafile;

Step 6: Start the MRP (this is using Real Time Apply)
SQL> alter database recover managed standby database using current logfile disconnect;