Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

5

积分

0

好友

3

主题
1#
发表于 2013-5-8 17:13:29 | 查看: 7482| 回复: 5
OS:CentOS5.7 x64
DB:Oracle 10.2.0.5.6 单实例 ASM

近期alert.log多次出现以下错误提示:
  1. Wed May 08 05:04:55 CST 2013
  2. Hex dump of (file 13, block 1842961) in trace file /u01/app/oracle/admin/misora/udump/misora_ora_6957.trc
  3. Corrupt block relative dba: 0x035c1f11 (file 13, block 1842961)
  4. Bad check value found during backing up datafile
  5. Data in bad block:
  6. type: 6 format: 2 rdba: 0x035c1f11
  7. last change scn: 0x0000.7c70ce9e seq: 0x1 flg: 0x06
  8. spare1: 0x0 spare2: 0x0 spare3: 0x0
  9. consistency value in tail: 0xce9e0601
  10. check value in block header: 0xe123
  11. computed block checksum: 0xb13d
  12. Trying mirror side DATA1.
  13. Reread of blocknum=1842961, file=+DATA/misora/datafile/mis_index4.dbf. found same corrupt data
  14. Reread of blocknum=1842961, file=+DATA/misora/datafile/mis_index4.dbf. found valid data
复制代码
在使用dbv进行坏块检测时,检测输出:
  1. dbv file=+DATA/misora/datafile/mis_index4.dbf userid=system/sys

  2. DBVERIFY: Release 10.2.0.5.0 - Production on Wed May 8 16:40:30 2013

  3. Copyright (c) 1982, 2007, Oracle.  All rights reserved.

  4. DBVERIFY - Verification starting : FILE = +DATA/misora/datafile/mis_index4.dbf
  5. Page 1842961 is marked corrupt
  6. Corrupt block relative dba: 0x035c1f11 (file 13, block 1842961)
  7. Bad check value found during dbv:
  8. Data in bad block:
  9. type: 6 format: 2 rdba: 0x035c1f11
  10. last change scn: 0x0000.7c70ce9e seq: 0x1 flg: 0x06
  11. spare1: 0x0 spare2: 0x0 spare3: 0x0
  12. consistency value in tail: 0xce9e0601
  13. check value in block header: 0xe123
  14. computed block checksum: 0xb13d



  15. DBVERIFY - Verification complete

  16. Total Pages Examined         : 2621440
  17. Total Pages Processed (Data) : 0
  18. Total Pages Failing   (Data) : 0
  19. Total Pages Processed (Index): 2387917
  20. Total Pages Failing   (Index): 0
  21. Total Pages Processed (Other): 18474
  22. Total Pages Processed (Seg)  : 0
  23. Total Pages Failing   (Seg)  : 0
  24. Total Pages Empty            : 215048
  25. Total Pages Marked Corrupt   : 1
  26. Total Pages Influx           : 0
  27. Highest block SCN            : 0 (0.0)
复制代码
请问该如何解决修复?

misora_ora_6957.zip

8.03 KB, 下载次数: 1629

trace文件

2#
发表于 2013-5-8 19:59:18
定位这个 块属于什么段


SELECT tablespace_name, segment_type, owner, segment_name
FROM dba_extents
WHERE file_id = &fileid
and &blockid between block_id AND block_id + blocks - 1;

回复 只看该作者 道具 举报

3#
发表于 2013-5-9 10:27:52
本帖最后由 foxbei 于 2013-5-9 11:10 编辑

谢谢Maclean,SEGMENT_TYPE是INDEX
  1. SELECT tablespace_name, segment_type, owner, segment_name
  2. FROM dba_extents
  3. WHERE file_id = 13
  4. and 1842961 between block_id AND block_id + blocks - 1;

  5. TABLESPACE_NAME SEGMENT_TYPE    OWNER      SEGMENT_NAME
  6. --------------- --------------- ---------- ------------------------------
  7. MIS_INDEX       INDEX           YD         PK_ACC_DAY_OPERATION_HIS
复制代码
重建索引
  1. SQL> conn yd/******

  2. SQL> alter index PK_ACC_DAY_OPERATION_HIS rebuild online tablespace MIS_INDEX;
  3. Index altered
复制代码
但再次使用DBV仍出现Corrupt block relative dba
  1. $ dbv file=+DATA/misora/datafile/mis_index4.dbf userid=system/sys

  2. DBVERIFY: Release 10.2.0.5.0 - Production on Thu May 9 10:55:55 2013

  3. Copyright (c) 1982, 2007, Oracle.  All rights reserved.

  4. DBVERIFY - Verification starting : FILE = +DATA/misora/datafile/mis_index4.dbf
  5. Page 1842961 is marked corrupt
  6. Corrupt block relative dba: 0x035c1f11 (file 13, block 1842961)
  7. Bad check value found during dbv:
  8. Data in bad block:
  9. type: 6 format: 2 rdba: 0x035c1f11
  10. last change scn: 0x0000.7c70ce9e seq: 0x1 flg: 0x06
  11. spare1: 0x0 spare2: 0x0 spare3: 0x0
  12. consistency value in tail: 0xce9e0601
  13. check value in block header: 0xe123
  14. computed block checksum: 0xb13d



  15. DBVERIFY - Verification complete

  16. Total Pages Examined         : 2621440
  17. Total Pages Processed (Data) : 0
  18. Total Pages Failing   (Data) : 0
  19. Total Pages Processed (Index): 2434391
  20. Total Pages Failing   (Index): 0
  21. Total Pages Processed (Other): 18592
  22. Total Pages Processed (Seg)  : 0
  23. Total Pages Failing   (Seg)  : 0
  24. Total Pages Empty            : 168456
  25. Total Pages Marked Corrupt   : 1
  26. Total Pages Influx           : 0
  27. Highest block SCN            : 0 (0.0)
复制代码
再次定位这个块
  1. SQL> SELECT tablespace_name, segment_type, owner, segment_name
  2.   2  FROM dba_extents
  3.   3  WHERE file_id = 13
  4.   4  and 1842961 between block_id AND block_id + blocks - 1;

  5. no rows selected
复制代码
请问这种情况,是出现了物理坏块吗?

回复 只看该作者 道具 举报

4#
发表于 2013-5-9 11:14:19
游离块 ,  建个大的空表覆盖掉就好了

回复 只看该作者 道具 举报

5#
发表于 2013-5-9 11:14:22
游离块 ,  建个大的空表覆盖掉就好了

回复 只看该作者 道具 举报

6#
发表于 2013-5-9 15:43:51
问题解决了,非常感谢Maclean。简单记录一下我的解决步骤:

首先,考虑了Maclean给出的方法:建个大的空表覆盖掉,但没有找到可以在指定datafile的block上create table的方法(虽然可以指定tablespace,但这个tablespace下的datafile较多,这种方法不知得建多大才可以覆盖掉)。

然后,考虑使用RMAN的blockrecover来修复坏块。

使用RMAN备份数据文件
  1. RMAN> backup datafile 13;

  2. Starting backup at 09-MAY-13
  3. using target database control file instead of recovery catalog
  4. allocated channel: ORA_DISK_1
  5. channel ORA_DISK_1: sid=294 devtype=DISK
  6. channel ORA_DISK_1: starting full datafile backupset
  7. channel ORA_DISK_1: specifying datafile(s) in backupset
  8. input datafile fno=00013 name=+DATA/misora/datafile/mis_index4.dbf
  9. channel ORA_DISK_1: starting piece 1 at 09-MAY-13
  10. channel ORA_DISK_1: finished piece 1 at 09-MAY-13
  11. piece handle=+DATA/misora/backupset/2013_05_09/nnndf0_tag20130509t140941_0.297.814975783 tag=TAG20130509T140941 comment=NONE
  12. channel ORA_DISK_1: backup set complete, elapsed time: 00:08:05
  13. Finished backup at 09-MAY-13
复制代码
使用RMAN检查坏块
  1. RMAN> backup validate datafile 13;

  2. Starting backup at 09-MAY-13
  3. using channel ORA_DISK_1
  4. channel ORA_DISK_1: starting full datafile backupset
  5. channel ORA_DISK_1: specifying datafile(s) in backupset
  6. input datafile fno=00013 name=+DATA/misora/datafile/mis_index4.dbf
  7. channel ORA_DISK_1: backup set complete, elapsed time: 00:03:45
  8. Finished backup at 09-MAY-13


  9. SQL> select * from v$database_block_corruption;     

  10. no rows selected
复制代码
可以看出,用RMAN备份后并没有出现坏块(跟DBV检测不相符呀)

使用RMAN的blockrecover修复
  1. RMAN> blockrecover datafile 13 block 1842961 from backupset;

  2. Starting blockrecover at 09-MAY-13
  3. allocated channel: ORA_DISK_1
  4. channel ORA_DISK_1: sid=427 devtype=DISK

  5. channel ORA_DISK_1: restoring block(s)
  6. channel ORA_DISK_1: specifying block(s) to restore from backup set
  7. restoring blocks of datafile 00013
  8. channel ORA_DISK_1: reading from backup piece +DATA/misora/backupset/2013_05_09/nnndf0_tag20130509t140941_0.297.814975783
  9. channel ORA_DISK_1: restored block(s) from backup piece 1
  10. piece handle=+DATA/misora/backupset/2013_05_09/nnndf0_tag20130509t140941_0.297.814975783 tag=TAG20130509T140941
  11. channel ORA_DISK_1: block restore complete, elapsed time: 00:04:55

  12. starting media recovery
  13. media recovery complete, elapsed time: 00:00:03

  14. Finished blockrecover at 09-MAY-13
复制代码
再次使用DBV检查
  1. $ dbv file=+DATA/misora/datafile/mis_index4.dbf userid=system/sys

  2. DBVERIFY: Release 10.2.0.5.0 - Production on Thu May 9 15:08:27 2013

  3. Copyright (c) 1982, 2007, Oracle.  All rights reserved.

  4. DBVERIFY - Verification starting : FILE = +DATA/misora/datafile/mis_index4.dbf


  5. DBVERIFY - Verification complete

  6. Total Pages Examined         : 2621440
  7. Total Pages Processed (Data) : 0
  8. Total Pages Failing   (Data) : 0
  9. Total Pages Processed (Index): 2434391
  10. Total Pages Failing   (Index): 0
  11. Total Pages Processed (Other): 18593
  12. Total Pages Processed (Seg)  : 0
  13. Total Pages Failing   (Seg)  : 0
  14. Total Pages Empty            : 168456
  15. Total Pages Marked Corrupt   : 0
  16. Total Pages Influx           : 0
  17. Highest block SCN            : 0 (0.0)
复制代码
至此故障解决。

但还有几个小疑问:
1、什么情况下会出现游离块?
2、游离块和游离坏块是一个概念吗?
3、使DBV和RMAN检测坏块的结果不一样的原因是什么?

有知道的希望能指点迷津 =333=
已有 1 人评分威望 理由
Maclean Liu(刘相兵 + 5 结贴有奖

总评分: 威望 + 5   查看全部评分

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-16 14:35 , Processed in 0.052690 second(s), 24 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569