oracle 数据文件损坏修复 --转帖

http://www.ixdba.net/article/f9/277.html
现场情况:
    1、数据库没有作归档,
    2、数据都存放在system表空间
    3、没有备份
状况:
    操作系统由于磁盘原因出现宕机,用户强行按电源关闭系统,数据库无法启动。
处理:
   
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-12801: error signaled in parallel query server P002
ORA-10562: Error occurred while applying redo to data block (file# 1, block#4568)
ORA-10564: tablespace SYSTEM
ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576
ORA-00600: internal error code, arguments: [6101]
   

检查日志信息如下:
Mon Nov 19 15:38:50 2007
ALTER DATABASE RECOVER  database  
Mon Nov 19 15:38:50 2007
Media Recovery Start
 parallel recovery started with 3 processes
Mon Nov 19 15:38:50 2007
Recovery of Online Redo Log: Thread 1 Group 3 Seq 16 Reading mem 0
  Mem# 0 errs 0: /opt/oracle/oradata/orcl/redo03.log
Mon Nov 19 15:38:50 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:
ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []
Mon Nov 19 15:38:50 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:
ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []
ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)
ORA-10564: tablespace UNDOTBS1
ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'
ORA-10560: block type 'KTU UNDO BLOCK'
Mon Nov 19 15:38:51 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:
ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []
ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)
ORA-10564: tablespace UNDOTBS1
ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'
ORA-10560: block type 'KTU UNDO BLOCK'
Mon Nov 19 15:38:51 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:
ORA-10562: Error occurred while applying redo to data block (file# 1, block# 4568)
ORA-10564: tablespace SYSTEM
ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576
ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []
Mon Nov 19 15:38:54 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:
ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []
Mon Nov 19 15:38:54 2007
Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:
ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)
ORA-10564: tablespace SYSTEM
ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'
ORA-10561: block type 'TRANSACTION MANAGED DATA BLOCK', data object# 237
ORA-00607: Internal error occurred while making a change to a data block
ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []
Mon Nov 19 15:38:54 2007
Media Recovery failed with error 12801
ORA-283 signalled during: ALTER DATABASE RECOVER  database  ...

从上面信息中抓取了一个信息:
ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)

针对这个错误解决如下:

ORA-10562: Error occurred while applying redo to data block (file# string, block# string)
Cause: See other errors on error stack.
Action: Investigate why the error occurred and how important is the data block. Media and standby database recovery usually can continue if user allows recovery to corrupt this data block。

从日志信息可以基本判断问题如下:
当前在线日志损坏,导致undo回滚段出现问题,又由于系统突然掉电,系统表空间在重启实例后要进行实例恢复,当前在线日志损坏,系统表空间无法进行recover,因而出现了上面的错误。
找到了问题,解决访问就有了。
由于没有备份,数据库也运行在非归档模式下,所以恢复如下步骤:

SQL>startup mount
SQL>recover database using backup controlfile until cancel;
SQL>alter database open resetlogs;
SQL> startup mount
SQL> alter system set “_allow_resetlogs_corruption”=true scope=spfile;
SQL>shutdown immediate
SQL> startup mount
SQL> alter database open resetlogs;
SQL> startup

基本恢复步骤:
SQL>startup mount
SQL>recover database using backup controlfile until cancel;
Cancel
SQL>alter database open resetlogs;
#此时会提示system表空间需要恢复,但是由于当前日志损坏,无法进行恢复,所以需要加入#隐含参数,oracle才不会监测scn的一致性,才能打开数据库。
#重启数据库加入隐含参数
SQL> startup mount
SQL> alter system set “_allow_resetlogs_corruption”=true scope=spfile;
SQL> shutdown immediate
SQL> startup mount
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
#不管这些,再次登录sqlplus起动数据库
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 16 08:03:43 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>startup

数据库正常打开,exp备份需要的数据,然后重新建库,导入数据。
----------------------------------------------------------------------
    通过这次操作,我得到一个经验,在处理Oracle问题时,切忌慌乱,对于出现的问题,通过看Oracle的alert.log以及trace文件,分析出现问题的错误,逐步定位,然后就是在网上搜索或者请教高人。  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值