APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 12.1.0.2 [Release 9.2 to 12.1]
Information in this document applies to any platform.
***Checked for relevance on 26-Sep-2012*** 
***Checked for relevance on 8-Jul-2015***

SYMPTOMS

Adding a Tablespace / Datafile in Primary Database causes the MRP in Physical Standby Database to terminate with the Error below. STANDBY_FILE_MANAGEMENT = MANUAL is set on the Standby Database.

MRP0: Background Media Recovery terminated with error 1274 
ORA-01274: cannot add datafile '...dbf' - file could not be created

In Unix Environment you will get the below Message when try to restart the MRP

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

BEST Practice,

Keep the STANDBY_FILE_MANAGEMENT in AUTO.

CAUSE

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.

The Redo Log generated from Primary will have Information about the Tablespace / Datafile added however it could not be created successfully in Physical Standby Database due to the standby_file_management = MANUAL
or is not able to find the specified Folder due to a missing / incorrect Filename Conversion. 
The File Entry is added to Standby Controlfile as "UNNAMED0000n" in /dbs or /database 
folder depends on the Operating System and eventually the MRP terminates.

Alert Log in Standby Shows MRP is terminated with below error 
================================================================= 
File #5 added to control file as 'UNNAMED00005' 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 
Thu Sep 25 19:02:35 2008 
Errors in file c:\oracle\product\10.2.0\admin\mystd\bdump\mystd_mrp0_3436.trc: 
ORA-01274: cannot add datafile 'D:\ORADATA\PRIM\SALES01.DBF' - file could not be created

By default it is AUTO by broker.

SOLUTION

Perform all mentioned Steps on the Standby Database:

For version < 12c

Step 1: Ensure the standby_file_management = 'MANUAL.

NOTE : For the parameter db_file_name_convert change if the Data Guard Broker is enabled then edit the Parameters using the Broker

DGMGRL>edit database '<standby>' set property DbFileNameConvert='<>','<>';
DGMGRL>edit database '<standby>' set property StandbyFileManagement=manual;

By default StandbyFileManagement is AUTO by broker.

Step 2: Identify the File which is "unnamedn"

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

Step 3: Rename/create the Datafile to the correct Filename

SQL> alter database create datafile 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005' as 'D:\oradata\mystd\sales01.dbf';

If the standby is in ASM + OMF then use the below command,

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;

Step 4: Verify the Filename is correct

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

Step 5: Change the STANDBY_FILE_MANAGMENT to AUTO

SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both;

Step 6: Start the MRP (this is using Real Time Apply)

SQL> alter database recover managed standby database using current logfile disconnect;

Database altered.

Step 7: Verify the MRP is running as expected

SQL> select process, status , sequence# from v$managed_standby;
PROCESS STATUS SEQUENCE# 
--------- ------------ ---------- 
ARCH CLOSING 99 
ARCH CLOSING 103 
MRP0 APPLYING_LOG 104 
RFS IDLE 0 
RFS IDLE 0 
RFS IDLE 104

For 12c Database with PDBs :-

Step 1: Ensure the standby_file_management = 'MANUAL'

NOTE : For the parameter db_file_name_convert change if the Data Guard Broker is enabled then edit the Parameters using the Broker,
DGMGRL>edit database '<standby>' set property DbFileNameConvert='<>','<>';
DGMGRL>edit database '<standby>' set property StandbyFileManagement=manual;

Step 2:- Identify the Pdb with datafile name UNNAMED

column name format a50

column pdb_name format a8

select a.file#,a.name,a.con_id,b.pdb_id,b.pdb_name from v$datafile a,dba_pdbs b where a.con_id=b.con_id and a.name like '%UNNAM%';

Step 3:-  Set the container to that pdb

In Below example assuming pdb1 is the container

SQL> alter session set container = pdb1;

Session altered.

FILE# NAME CON_ID PDB_ID PDB_NAME
--------- -------------------------------------------------- ---------- ---------- --------
5 D:\ORADATA\MYSTD\UNNAMED00005 3 3 PDB1

SQL> alter pluggable database pdb1 CREATE DATAFILE 'D:\ORADATA\MYSTD\UNNAMED00005' as 'D:\ORADATA\MYSTD\SP385343393_ess.dbf';

Pluggable database altered.

Step 4-7 are same as listed for version < 12c

Background Media Recovery terminated with ORA-1274 after adding a Datafile (Doc ID 739618.1)的更多相关文章

  1. 诊断:MRP0: Background Media Recovery terminated with error 1111

    表现: 灾备环境,无法继续应用日志. 日志: MRP0: Background Media Recovery terminated with error 1111 Fri Jan 18 15:55:2 ...

  2. 诊断:MRP0: Background Media Recovery process shutdown with error ORA-19909

    oracle12c data guard,从库无法应用日志,检查alert日至发现 2019-10-21T14:55:40.087819+08:00 MRP0: Background Media Re ...

  3. Performing User-Managed Database-18.7、Performing Complete User-Managed Media Recovery

    18.7.Performing Complete User-Managed Media Recovery 完毕一致性备份,把数据库恢复到当前的scn是最好的结果.能够恢复整个数据库.恢复单个表空间.或 ...

  4. ORA-01113: file xxxx needs media recovery

    由于规范存储位置以及存储空间调整缘故需要移动表空间MRP_INDEX2的数据文件,如下所示,首先将表空间MRP_INDEX2脱机; 然后复制数据文件:接着重命名数据文件,最后将表空间MRP_INDEX ...

  5. ORA-10456:cannot open standby database;media recovery session may be in process

    http://neeraj-dba.blogspot.com/2011/10/ora-10456-cannot-open-standby-database.html   Once while star ...

  6. 关闭归档提示:ORA-38774: cannot disable media recovery - flashback database is enabled

    SQL> select * from v$version; Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit P ...

  7. Basic Concepts of Block Media Recovery

    Basic Concepts of Block Media Recovery Whenever block corruption has been automatically detected, yo ...

  8. 物理DG主备库切换时遇到ORA-16139: media recovery required错误

    在物理DG主备库切换时遇到ORA-16139: media recovery required错误 SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRI ...

  9. 11G新特性 -- 块介质恢复性能增强(block media recovery)

    块介质恢复性能增强(block media recovery) :只是恢复受损的块.不需要将受损的数据文件offline.针对受损的数据块,使用备份中好的数据块进行restore和recover,避免 ...

随机推荐

  1. Codeforces Round #317 (div 2)

    Problem A Arrays 思路:水一水. #include<bits/stdc++.h> using namespace std; ; int n1,n2,k,m,a[N],b[N ...

  2. Linux 僵尸进程的筛选和查杀

    一.筛选 ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' 二.查杀 ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' ...

  3. Docker 注意事项

    一.Dockerfile名字不能是大写. 二.Docker-compares 引用自:https://www.cnblogs.com/wj5633/p/6707012.html 引用自:https:/ ...

  4. Python 枚举【一】

    1. 枚举的定义 首先,定义枚举要导入enum模块. 枚举定义用class关键字,继承Enum类. 用于定义枚举的class和定义类的class是有区别[下一篇博文继续分享]. 示例代码: from ...

  5. AngularJS获取项目中定义的json文件

    项目结构: 文件夹js位于根路径下 $http.get('js/app/contact/contacts.json').then(function (res) { /*下面就是获取到的数据*/ $sc ...

  6. [CodeForces-1036E] Covered Points 暴力 GCD 求交点

    题意: 在二维平面上给出n条不共线的线段,问这些线段总共覆盖到了多少个整数点 解法: 用GCD可求得一条线段覆盖了多少整数点,然后暴力枚举线段,求交点,对于相应的 整数交点,结果-1即可 #inclu ...

  7. Linux学习之挂载光盘和U盘(六)

    Linux下挂载光盘和U盘 挂载 linux下硬盘.U盘.软盘.移动硬盘都必须挂载后才能使用,不过硬盘的挂载是系统自动进行的. linux中每一个硬件都有一个设备文件名,就是将U盘什么的设备文件名与挂 ...

  8. 为什么要使用getter/setter

    变量私有化的好处 1. 在setter中可以加入合法性检查,比如设置颜色的函数中,对于RGB颜色要判断其值在0~255之间. 2. 更新与被设置变量相关的其它变量的值,比如在一个潜水艇模拟系统中,改变 ...

  9. 初识Style和Theme

    初识Style和Theme 学习自 http://www.jcodecraeer.com/a/basictutorial/2016/0812/6533.html 认识Style 大家还记得如何设置一个 ...

  10. 关于Git的总结

    首先我们先看一张图: 首先我们必须要先理解这几个概念:暂存区,本地仓库,远程仓库 暂存区:这个是我们每一次进行代码修改的地方,例如我们ieda的所编译的代码就是缓存区 本地仓库:是我们每一次pull, ...