My physical standby failed to start and terminate MRP due to ora 01274 problem.This problem is very simple to handle, but Baidu almost took me to the pit after searching an article, so I wrote down the standard steps of MOS for your friends to refer to.
This DG environment was built two weeks ago and needs to be officially switched today.Before switching, it is customary to check the status of the primary backup.This check found that the repository has not been logged for more than a week.Since the DG setup has a checklist, it is not forgotten to turn on MRP, but there must be a problem in the middle that caused the log application to fail.Looking at the repository alert, the following errors were found:
Fri Nov 24 16:39:15 2017 File #9 added to control file as 'UNNAMED00009' because the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL The file should be manually created to continue. MRP0: Background Media Recovery terminated with error 1274 Errors in file /u01/app/oracle/diag/rdbms/dbnamestby/dbname/trace/dbname_pr00_46964.trc: ORA-01274: cannot add datafile '+DATA/dbnameprmy/datafile/datafile.491.960914347' - file could not be created Managed Standby Recovery not using Real Time Apply Recovery interrupted! Recovery stopped due to failure in applying recovery marker (opcode 17.30). Datafiles are recovered to a consistent state at change 12687535588875 but controlfile could be ahead of datafiles. Fri Nov 24 16:39:17 2017 MRP0: Background Media Recovery process shutdown (dbname)
View the error code:
01274, 0000, "cannot add datafile '%s' - file could not be created" // *Cause: Automated standby file management was disabled, so an added file // could not automatically be created on the standby. // The error from the creation attempt is displayed in another message. // The control file file entry for the file is 'UNNAMEDnnnnn'. // *Action: Use the ALTER DATABASE CREATE DATAFILE statement to create the // file, or set STANDBY_FILE_MANAGEMENT to AUTO and restart // standby recovery.
The solution is also simple: (Note: For versions below 12c.My version is 11.2.For PDB, there are additional steps on MOS)
1. standby_of the repositoryFile_Management is to be set to MANUAL state.
2. Find the name of the file that cannot be created in the repository
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- D:\ORADATA\MYSTD\SYSTEM.DBF D:\ORADATA\MYSTD\UNDO.DBF D:\ORADATA\MYSTD\SYSAUX.DBF D:\ORADATA\MYSTD\SERVICE01.DBF C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005
3. Rebuild the data file
If the backup library uses ASM+OMF, the following commands can also be used:SQL> alter database create datafile 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005' as 'D:\oradata\mystd\sales01.dbf';
SQL> alter database create datafile '/oracle/product/GSIPRDGB/dbs/UNNAMED00210' as <'+ASMDISKGROUPNAME'> size <specify the size of datafile>; or SQL>alter database create datafile '/oracle/product/GSIPRDGB/dbs/UNNAMED00210' as new;
4. Look at the new data file names and they should be consistent
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- D:\ORADATA\MYSTD\SYSTEM.DBF D:\ORADATA\MYSTD\UNDO.DBF D:\ORADATA\MYSTD\SYSAUX.DBF D:\ORADATA\MYSTD\SERVICE01.DBF D:\ORADATA\MYSTD\SALES01.DBF
5. STANDBY_FILE_The MANAGEMENT parameter is modified to AUTO in case this happens in the future.
6. Turn on MRP.
You can see redo in the log.