分享
 
 
 

如何使用BBED修复损坏的BLOCK

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

前面我已经介绍了如何使用BBED模拟坏块,本文简要介绍如何使用BBED修复损坏的BLOCK。

1.备份数据文件

要想恢复损坏的文件,需要存在一个良好文件,本文简单冷备份一下文件.

[Oracle@jumper conner]$ cp users01.dbf users01.dbf.bak

2.修改BBED参数文件

加入备份文件

[oracle@jumper conner]$ vi filelist.txt

1 /opt/oracle/oradata/conner/system01.dbf 440401920

2 /opt/oracle/oradata/conner/undotbs01.dbf104857600

3 /opt/oracle/oradata/conner/users01.dbf27262976

4 /opt/oracle/oradata/conner/users01.dbf.bak27262976

~

~

~

"filelist.txt" 4L, 259C written

3.破坏数据块

[oracle@jumper conner]$ bbed parfile=par.bbd

PassWord:

BBED: Release 2.0.0.0.0 - Limited ProdUCtion on Sun Sep 11 22:30:11 2005

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

************* !!! For Oracle Internal Use only !!! ***************

BBED set file 3

FILE# 3

BBED modify 1000 file 3 block 17

Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y

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

Block: 17 Offsets:0 to511 Dba:0x00c00011

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

03e80000 1100c000 75b5a320 00000104 06300000 01000000 611e0000 72b5a320

00000000 03003201 0900c000 ffff0000 00000000 00000000 00000000 00800000

72b5a320 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00012600

ffff5e00 d5037703 77030000 2600c21e 101e581d a91cf61b 471b941a dd192819

6218b417 06175216 9715dd14 26146c13 b4120712 44118310 bc0ffa0e 380e790d

b60cf40b 350b790a c0090409 45088b07 cc060e06 57059804 d5030000 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

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 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes per line

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 header found during verification

Data in bad block -

type: 3 format: 0 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: 0xea05

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

4.从备份文件中copy良好数据块进行恢复

[oracle@jumper conner]$ bbed parfile=par.bbd

Password:

BBED: Release 2.0.0.0.0 - Limited Production on Sun Sep 11 22:33:55 2005

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

************* !!! For Oracle Internal Use only !!! ***************

BBED set file 4

FILE# 4

BBED show

FILE# 4

BLOCK#1

OFFSET0

DBA 0x01000001 (16777217 4,1)

FILENAME/opt/oracle/oradata/conner/users01.dbf.bak

BIFILEbifile.bbd

LISTFILEfilelist.txt

BLOCKSIZE 8192

MODEEdit

EDITUnrecoverable

IBASE Dec

OBASE Dec

WIDTH 80

COUNT 512

LOGFILE log.bbd

SPOOL No

BBED copy file 4 block 17 to file 3 block 17;

Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y

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

Block: 17 Offsets:0 to511 Dba:0x00c00011

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

06020000 1100c000 75b5a320 00000104 06300000 01000000 611e0000 72b5a320

00000000 03003201 0900c000 ffff0000 00000000 00000000 00000000 00800000

72b5a320 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00012600

ffff5e00 d5037703 77030000 2600c21e 101e581d a91cf61b 471b941a dd192819

6218b417 06175216 9715dd14 26146c13 b4120712 44118310 bc0ffa0e 380e790d

b60cf40b 350b790a c0090409 45088b07 cc060e06 57059804 d5030000 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

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 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes per line

BBED verify

DBVERIFY - Verification starting

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

BLOCK = 17

DBVERIFY - Verification complete

Total Blocks Examined : 1

Total Blocks Processed (Data) : 1

Total Blocks Failing (Data) : 0

Total Blocks Processed (Index): 0

Total Blocks Failing (Index): 0

Total Blocks Empty: 0

Total Blocks Marked Corrupt : 0

Total Blocks Influx : 0

BBED

至此恢复完成。

5.数据库验证

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 alter tablespace users offline;

Tablespace altered.

SQL alter tablespace users online;

Tablespace altered.

SQL select count(*) from bbed;

COUNT(*)

----------

523

善用BBED可以从很多棘手的问题中拯救我们的数据库。本案例仅供参考。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有