查询数据坏块。

数据块损坏了查询表会报错:

SQL> select * from block_test;
select * from block_test
              *
第 1 行出现错误:
ORA-01578: ORACLE 数据块损坏 (文件号 9, 块号 13)
ORA-01110: 数据文件 9: '/u01/app/oracle/oradata/orcl/blocktest.dbf'


用DBV查询具体坏块信息 :

[oracle@TESTDB ~]$ dbv file=/u01/app/oracle/oradata/orcl/blocktest.dbf blocksize=8192

DBVERIFY: Release 11.2.0.1.0 - Production on Thu Jun 6 11:48:48 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/orcl/blocktest.dbf
Page 13 is marked corrupt
Corrupt block relative dba: 0x0240000d (file 9, block 13)
Bad check value found during dbv:
Data in bad block:
 type: 6 format: 2 rdba: 0x0240000d
 last change scn: 0x0000.003ae4d6 seq: 0x1 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xe4d60601
 check value in block header: 0x6989
 computed block checksum: 0x2fca

DBVERIFY - Verification complete
Total Pages Examined         : 128
Total Pages Processed (Data) : 4
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 10
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 113
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 3859646 (0.3859646)

注意:

如果dbv报错 DBV-00107: Unknown header format

则说明数据文件头部块有问题或者损坏。


用rman检查坏块:这个也查不出数据文件头部块坏块的情况

RMAN> backup validate datafile 9;

Starting backup at 06-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=40 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/blocktest.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
9    FAILED 0              113          128             3859646   
  File Name: /u01/app/oracle/oradata/orcl/blocktest.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       1              5               
  Index      0              0               
  Other      0              10              

validate found one or more corrupt blocks
See trace file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_30507.trc for details
Finished backup at 06-JUN-13

SQL> select * from v$database_block_corruption;

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTION_TYPE
---------- ---------- ---------- ------------------ ------------------
         9         13          1                  0 CHECKSUM


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值