Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->数据库应用 ->Oracle ->正文

Oracle内部工具Block Corruption介绍

来源:赛迪网技术社区  作者:Webmaster 时间:2007-04-17 点击: [收藏] [投稿]

5.改写数据块

模拟坏块:

BBED> modify 1000 file 3 block 17

 File: /opt/oracle/oradata/conner/users01.dbf (3)

 Block: 17               Offsets: 1000 to 1511           Dba:0x00c00011

------------------------------------------------------------------------

 03e80000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 00000000 00000000 002c002f 03535953 18415050 4c59245f 434f4e46 5f48444c

 525f434f 4c554d4e 53065359 5354454d ffff02c1 0b02c129 02c10203 c2033804

 c3073825 ff02c102 06c51630 31252eff 02c10202 c1020359 4553014e ffffffff

 ffffffff 0a202020 20202020 2020310a 20202020 20202020 20310520 2020204e

 07454e41 424c4544 ffff024e 4fff014e 014e024e 4f074445 4641554c 54084449

 5341424c 4544024e 4f024e4f ff084449 5341424c 4544024e 4fff0844 49534142

 4c454408 44495341 424c4544 2c002f03 53595314 4150504c 59245f45 52524f52

 5f48414e 444c4552 06535953 54454dff ff02c10b 02c12902 c10203c2 033804c3

 073825ff 02c10206 c5163031 252eff02 c10202c1 02035945 53014eff ffffffff

 ffffff0a 20202020 20202020 20310a20 20202020 20202020 31052020 20204e07

 454e4142 4c4544ff ff024e4f ff014e01 4e024e4f 07444546 41554c54 08444953

 41424c45 44024e4f 024e4fff 08444953 41424c45 44024e4f ff084449 5341424c

 45440844 49534142 4c45442c 002f0353 59530c41 50504c59 245f4552 524f5206

 

 <32 bytes per line>

6.检查数据块损坏

使用verify命令,可以发现刚才修改的file 3 block 17已经被标记为损坏。

BBED> verify

DBVERIFY - Verification starting

FILE = /opt/oracle/oradata/conner/users01.dbf

BLOCK = 17

 

Block 17 is corrupt

***

Corrupt block relative dba: 0x00c00011 (file 0, block 17)

Bad check value found during verification

Data in bad block -

 type: 6 format: 2 rdba: 0x00c00011

 last change scn: 0x0000.20a3b575 seq: 0x1 flg: 0x04

 consistency value in tail: 0xb5750601

 check value in block header: 0x3006, computed block checksum: 0xe803

 spare1: 0x0, spare2: 0x0, spare3: 0x0

***

 

DBVERIFY - Verification complete

 

Total Blocks Examined         : 1

Total Blocks Processed (Data) : 0

Total Blocks Failing   (Data) : 0

Total Blocks Processed (Index): 0

Total Blocks Failing   (Index): 0

Total Blocks Empty            : 0

Total Blocks Marked Corrupt   : 1

Total Blocks Influx           : 0

 

BBED> quit

7.使用DBV检查

[oracle@jumper conner]$ dbv file=users01.dbf blocksize=8192

 

DBVERIFY: Release 9.2.0.4.0 - Production on Sun Sep 11 20:13:23 2005

 

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

 

DBVERIFY - Verification starting : FILE = users01.dbf

Page 17 is marked corrupt

***

Corrupt block relative dba: 0x00c00011 (file 3, block 17)

Bad check value found during dbv:

Data in bad block -

 type: 6 format: 2 rdba: 0x00c00011

 last change scn: 0x0000.20a3b575 seq: 0x1 flg: 0x04

 consistency value in tail: 0xb5750601

 check value in block header: 0x3006, computed block checksum: 0xe803

 spare1: 0x0, spare2: 0x0, spare3: 0x0

***

 

DBVERIFY - Verification complete

 

Total Pages Examined         : 128

Total Pages Processed (Data) : 107

Total Pages Failing   (Data) : 0

Total Pages Processed (Index): 0

Total Pages Failing   (Index): 0

Total Pages Processed (Other): 20

Total Pages Processed (Seg)  : 0

Total Pages Failing   (Seg)  : 0

Total Pages Empty            : 0

Total Pages Marked Corrupt   : 1

Total Pages Influx           : 0

8.全表扫描此时出现ORA-01578错误

重新启动数据库以后,执行全表扫描,此时错误出现:



 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:Oracle数据库的完整性约束规则详解   下一篇:Oracle中安全可靠的复制问题的说明

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
SQL> startup force;

ORACLE instance started.

 

Total System Global Area  101782828 bytes

Fixed Size                   451884 bytes

Variable Size              37748736 bytes

Database Buffers           62914560 bytes

Redo Buffers                 667648 bytes

Database mounted.

Database opened.

SQL> select count(*) from bbed;

select count(*) from bbed

                     *

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 3, block # 17)

ORA-01110: data file 3: '/opt/oracle/oradata/conner/users01.dbf'

 
SQL>