ITPUB??ì3
新一届的微软MVP评选已经开始,欢迎各位推荐!
ITPUB论坛 » Oracle专题深入讨论 » 解决坏块后怎么dbv检查还有坏块

标题: 解决坏块后怎么dbv检查还有坏块
离线 xcsars
初级会员



精华贴数 0
个人空间 0
技术积分 223 (8568)
社区积分 7 (13458)
注册日期 2007-9-28
论坛徽章:0
      
      

发表于 2008-7-9 22:09 
解决坏块后怎么dbv检查还有坏块

实验步骤.TXT (1.75 KB)



tt用户下 有七张表,

t4 表出现了坏块,其他六张能过正常访问

SQL> select count(*) from t4;
select count(*) from t4
*
ERROR 位于第 1 行:
ORA-01578: ORACLE 数据块损坏(文件号11,块号853)
ORA-01110: 数据文件 11: 'D:OPTORA9ORADATAORA9TT.DBF'

下面是我坏块的恢复步骤

1、
SQL> conn /as sysdba
已连接。
SQL> Execute DBMS_REPAIR.SKIP_CORRUPT_BLOCKS('TT','T4');

PL/SQL 过程已成功完成。

SQL>

2、
倒出t4表

exp tt/tt file=d:        4.dmp tables=t4

3、

SQL> conn tt/tt
已连接。
SQL> drop table t4;

表已丢弃。

4、
导入刚才倒出的数据

imp tt/tt file=d:        4.dmp

导入后t4表能正常访问

5、dbv检查

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

Dptora9BIN>dbv file=Dptora9oradataora9TT.DBF blocksize=8192

DBVERIFY: Release 9.2.0.1.0 - Production on 星期三 7月 9 21:50:12 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

DBVERIFY - 验证正在开始 : FILE = Dptora9oradataora9TT.DBF
标记为损坏的页853
***
Corrupt block relative dba: 0x02c00355 (file 11, block 853)
Bad check value found during dbv:
Data in bad block -
type: 6 format: 2 rdba: 0x02c00355
last change scn: 0x0000.00136465 seq: 0x1 flg: 0x04
consistency value in tail: 0x64650601
check value in block header: 0x1acf, computed block checksum: 0xf358
spare1: 0x0, spare2: 0x0, spare3: 0x0
***



DBVERIFY - 验证完成

检查的页总数         :2560
处理的页总数(数据):1860
失败的页总数(数据):0
处理的页总数(索引):0
失败的页总数(索引):0
处理的页总数(其它):10
处理的总页数 (段)  : 0
失败的总页数 (段)  : 0
空的页总数            :689
标记为损坏的总页数:1
汇入的页总数           :0

Dptora9BIN>


还报出 页853 损坏,为啥呢? 以上的操作时在Windows 下9.2.0.1的库进行的

[ 本帖最后由 xcsars 于 2008-7-10 13:39 编辑 ]




xcsars 上传了这个附件:
2008-7-10 13:38
  下载次数: 7
badblockstill.TXT (1.75 KB)
 
只看该作者    顶部
在线/呼叫 cc59
Love oracle



精华贴数 0
个人空间 326
技术积分 10889 (108)
社区积分 13746 (106)
注册日期 2004-8-13
论坛徽章:68
现任管理团队成员奥运纪念徽章2008北京奥运纪念徽章:帆船2008北京奥运纪念徽章:游泳  
      

发表于 2008-7-10 09:23 
物理损坏与逻辑损坏是有区别的.


__________________
My blog: tuning rac and using parallel


msn:liuyi8903@hotmail.com
只看该作者    顶部
离线 xcsars
初级会员



精华贴数 0
个人空间 0
技术积分 223 (8568)
社区积分 7 (13458)
注册日期 2007-9-28
论坛徽章:0
      
      

发表于 2008-7-10 10:20 
回复 #2 cc59 的帖子

哪里能找到物理损坏与逻辑损坏的概念?


只看该作者    顶部
离线 Yong Huang
版主



精华贴数 2
个人空间 0
技术积分 4168 (339)
社区积分 129 (3000)
注册日期 2001-10-9
论坛徽章:6
现任管理团队成员ITPUB元老管理团队2006纪念徽章会员2006贡献徽章授权会员2008年新春纪念徽章
      

发表于 2008-7-10 10:26 
Make sure you turn off the stupid smilies.

I think the reason you still have bad blocks is because dbv checks all blocks inside the datafile, including the blocks that are not known to the data dictionary. It finds some blocks that *were* once used by a table and does some block checking and finds them corrupted. But if you find the segment and extent corresponding to the bad blocks from dba_extents, there's no more segment or extent mapped to it, because dba_extents is a data dictionary view.

You either just ignore it, or try to use the currently bad blocks by, perhaps, creating a lot of tables or one table but you keep allocating extents, and you keep checking to see the blocks are used or covered. Once they're used, drop the tables. If you don't want to do this, just move all segments in the datafile to another file and shrink this file to very small.

Does that make sense?

Yong Huang


只看该作者    顶部
离线 xcsars
初级会员



精华贴数 0
个人空间 0
技术积分 223 (8568)
社区积分 7 (13458)
注册日期 2007-9-28
论坛徽章:0
      
      

发表于 2008-7-10 13:41 
回复 #4 Yong Huang 的帖子

根据版主的要求 我已经将实验步骤当作附件贴出来了,麻烦版主帮我检查一下


只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问