ORA-01113: file xxxx needs media recovery

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

在操作过后,最后一步将表空间MRP_INDEX2联机上线时,出现了意外错误信息,如下所示:

SQL> ALTER TABLESPACE MRP_INDEX2 OFFLINE NORMAL;
 
Tablespace altered.
 
SQL> !cp /u03/flash_recovery_area/oradata/epps/mrp_index2_x01.dbf  /u04/epps/oradata/mrp_index2_x01.dbf
SQL> !cp /u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf  /u04/epps/oradata/mrp_index2_x02.dbf
 
SQL> ALTER DATABASE RENAME FILE ‘/u03/flash_recovery_area/oradata/epps/mrp_index2_x01.dbf‘ TO ‘/u04/epps/oradata/mrp_index2_x01.dbf‘;
 
 
Database altered.

如下所示,在重命名文件时,其中一个文件路径‘u04/epps/oradata/mrp_index2_x02.dbf‘弄错了,当时一直没有留意到这个错误,怕耽搁Tablespace的联机上线时间。于是先将表空间MRP_INDEX2联机上线

SQL> ALTER DATABASE RENAME FILE ‘/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf‘ TO ‘u04/epps/oradata/mrp_index2_x02.dbf‘
 
*
 
ERROR at line 1:
 
ORA-01511: error in renaming log/data files
 
ORA-01141: error renaming data file 86 - new file
 
‘u04/epps/oradata/mrp_index2_x02.dbf‘ not found
 
ORA-01110: data file 86:
 
‘/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf‘
 
ORA-27037: unable to obtain file status
 
Linux Error: 2: No such file or directory
 
Additional information: 3
 
SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;
 
Tablespace altered.
 

检查过后发现了上面脚本错误,于是接着处理,但是将表空间MRP_INDEX2脱机后,没有重新拷贝数据文件过去,直接重命名数据文件(SCN已经改变,导致下面ORA-01113错误),然后表空间联机上线时,出现了下面错误

SQL> ALTER TABLESPACE MRP_INDEX2 OFFLINE NORMAL;
 
Tablespace altered.
 
SQL> ALTER DATABASE RENAME FILE ‘/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf‘ TO ‘/u04/epps/oradata/mrp_index2_x02.dbf‘;
 
Database altered.
 
SQL> 
 
SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;
 
ALTER TABLESPACE MRP_INDEX2 ONLINE
 
*
 
ERROR at line 1:
 
ORA-01113: file 86 needs media recovery
 
ORA-01110: data file 86: ‘/u04/epps/oradata/mrp_index2_x02.dbf‘

解决方法:

1:首先将对应报错的数据文件脱机

SQL> alter database datafile ‘/u04/epps/oradata/mrp_index2_x02.dbf‘ offline;
 
Database altered.

2:其次recover这个数据文件

SQL> alter database recover datafile ‘/u04/epps/oradata/mrp_index2_x02.dbf‘;
 
Database altered.
 

3:然后将该数据文件联机上线

SQL> alter database datafile ‘/u04/epps/oradata/mrp_index2_x02.dbf‘ online;
 
Database altered.

4:最后将该表空间MRP_INDEX2联机上线。

SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;

当然也可以使用RMAN还原,这里感觉使用SQL命令还原要简单方便一点,最后删除拷贝前的文件

rm /u03/flash_recovery_area/oradata/epps/mrp_index2_x01.dbf 
 
rm /u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf 
时间: 2024-10-22 20:55:43

ORA-01113: file xxxx needs media recovery的相关文章

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

18.7.Performing Complete User-Managed Media Recovery 完毕一致性备份,把数据库恢复到当前的scn是最好的结果.能够恢复整个数据库.恢复单个表空间.或恢复数据文件.一致性恢复不须要resetlogs打开数据库,非一致性恢复须要resetlogs打开数据库.Backup and Recovery Basics提供了关于介质恢复的信息. 18.7.1.Performing Closed Database Recovery 能够在一个操作中恢复全部损坏

ORA-00328 ORA-00334 MRP0: Background Media Recovery terminated with error 328

环境介绍:前几天搭建了一套 二节点单实例的 linux+oracle11.2.0.3+dataguard   maximize availability 的环境. 故障现象:今天发现不能同步了,在trace文件alert_orcl.log里发现有报错信息MRP进程启不来 MRP0: Background Media Recovery terminated with error 328 ORA-00328: 8386238 , 8972415ORA-00334: '/opt/oracle/fast

Performing User-Managed Database-18.6、About User-Managed Media Recovery

18.6.About User-Managed Media Recovery 为了完成恢复,oracle建议使用recover语句.也可以使用alter database recover语句,但是recover语句更简单. 18.6.1.Preconditions of Performing User-Managed Recovery 开始任何一种介质恢复,必须遵循以下限制: (1)必须有管理员权限 (2)所有恢复会话必须协调 (3)一个会话完成非一致性介质恢复时,另外一个会话不能启动一致性介质

Basic Concepts of Block Media Recovery

Basic Concepts of Block Media Recovery Whenever block corruption has been automatically detected, you can perform block media recovery manually with the RECOVER ... BLOCK command. By default, RMAN first searches for good blocks in the real-time query

(转)RMAN-06054: media recovery requesting unknown archived log for thread...

转自:http://blog.itpub.net/29800581/viewspace-1307267/ 使用rman执行recover database 的时候出现RMAN-06054的错误提示: RMAN> recover database; Starting recover at 21-OCT-14 using channel ORA_DISK_1 starting media recovery archived log for thread 1 with sequence 1 is al

Oracle非归档模式Media Recovery错误之--ORA-26040

Oracle非归档模式Media Recovery错误之--ORA-26040 系统环境: 操作系统:Linux RH55 Oracle:  Oracle 11gR2 模拟案例: 1.查看数据库模式 18:12:36 [email protected] prod>archive log list; Database log mode              No Archive Mode Automatic archival             Disabled Archive desti

Block Media Recovery, BMR

ocp 053: 399.Which of the following is not an advantage of block media recovery (BMR)? A. Reduced MTTR. B. Datafiles remain offline while corrupt blocks are repaired. C. Datafiles remain online while corrupt blocks are repaired. D. A and C Answer: B

ORA-01153 an incompatible media recovery is active

ORA-01153错误处理 问题描述: 主备在做Switchover切换时,在切换后的备库报如下错误: ORA-01153: an incompatible media recovery is active 解决办法: 对standby database 进行手动应用archive log SQL> recover managed standby database cancel; SQL> recover automatic standby database ; SQL> RECOVER

网页提示[Not allowed to load local resource: file://XXXX]错误

网页通过http 访问时, 点击打开文件的link.在Chrome 中会报 Not allowed to load local resource: file// XXXX 的错误 <!--Add by oscar999--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document <