Oracle数据文件损坏修复

复制代码
请手工删除之前所有的归档日志和备份文件,并对现在的数据库做一个全备
RMAN> backup database; // 全库备份

模拟故障:将该文件清空
echo ‘’ > /u01/app/oracle/oradata/orcltest/tbs01.dbf // tbs01是一个普通表空间数据文件

现象:查询该数据文件上的对象报错
SQL> select * from scott.t01; // t01表在tbs01.dbf文件上

select * from scott.t01
                    *
ERROR at line 1:
ORA-01115: IO error reading block from file  (block # )
ORA-01110: data file 6: '/u01/app/oracle/oradata/orcltest/tbs01.dbf'
ORA-27072: File I/O error
Additional information: 4
Additional information: 130
修复:先对数据文件offline,然后使用rman还原恢复,最后online
SQL> alter database datafile 6 offline;
RMAN> restore datafile 6;
RMAN> recover datafile 6;
SQL> alter database datafile 6 online;
复制代码

 

posted on   数据库那些事儿  阅读(4)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示