修复损坏的数据块

 

bbed就是英文block browse block edit的缩写,用来直接查看和修改数据文件数据的一个工具

在windows上提供工具dbv,在linux上面有,需要编译:
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed
然后把$ORACLE_HOME/rdbms/lib加到环境变量的PATH里面,就可以直接在命令中bbed了。
编译好了就可以使用了,不过有个默认的口令blockedit。
运行bbed之前先要自己写几个配置文件:
这里有2个 a.txt par.bbd
[oracle@vm1 oracle]$ ls
a.txt bifile.bbd Desktop log.bbd par.bbd
[oracle@vm1 oracle]$ more a.txt
6 /u01/oracle/oradata/test/users01.dbf 26222592
2 /u01/oracle/oradata/test/users01.dbf.bak 26222592
[oracle@vm1 oracle]$ more par.bbd
blocksize=8192
listfile=a.txt
mode=edit

编好了就可以运行bbed了
[oracle@vm1 oracle]$ bbed parfile=par.bbd
Password: --这里的密码 blockedit
BBED: Release 2.0.0.0.0 - Limited Production on Wed Sep 14 16:18:31 200
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************

BBED>
先看看帮助,有那些命令:

BBED> help
HELP [ | ALL ]
BBED> help ALL
SET DBA [ dba | file#, block# ]
SET FILENAME 'filename'
SET FILE file#
SET BLOCK [+/-]block#
SET OFFSET [ [+/-]byte offset | symbol | *symbol ]
SET BLOCKSIZE bytes
SET LIST[FILE] 'filename'
SET WIDTH character_count
SET COUNT bytes_to_display
SET IBASE [ HEX | OCT | DEC ]
SET OBASE [ HEX | OCT | DEC ]
SET MODE [ BROWSE | EDIT ]
SET SPOOL [ Y | N ]
SHOW [ | ALL ]
INFO
MAP[/v] [ DBA | FILENAME | FILE | BLOCK ]
DUMP[/v] [ DBA | FILENAME | FILE | BLOCK | OFFSET | COUNT ]
PRINT[/x|d|u|o|c] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
EXAMINE[/Nuf] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
:
N - a number which specifies a repeat count.
u - a letter which specifies a unit size:
b - b1, ub1 (byte)
h - b2, ub2 (half-word)
w - b4, ub4(word)
r - Oracle table/index row
f - a letter which specifies a display format:
x - hexadecimal
d - decimal
u - unsigned decimal
o - octal
c - character (native)
n - Oracle number
t - Oracle date
i - Oracle rowid

FIND[/x|d|u|o|c] numeric/character string [ TOP | CURR ]
COPY [ DBA | FILE | FILENAME | BLOCK ] TO [ DBA | FILE | FILENAME | BLOCK ]
MODIFY[/x|d|u|o|c] numeric/character string
[ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
ASSIGN[/x|d|u|o] =
: [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
: [ value | ]
SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ]
PUSH [ DBA | FILE | FILENAME | BLOCK | OFFSET ]
POP [ALL]
REVERT [ DBA | FILE | FILENAME | BLOCK ]
UNDO
HELP [ | ALL ]
VERIFY [ DBA | FILE | FILENAME | BLOCK ]
CORRUPT [ DBA | FILE | FILENAME | BLOCK ]
BBED>

还真不少,下面是几个常用的:

set 设定当前的环境。
show 查看当前的环境参数,跟sqlplus的同名命令类似。
dump 列出指定block的内容
find 在指定的block中查找指定的字符串,结果是显示出字符串,及其偏移量--offset,偏移量就是在block中的字节数
modify 修改指定block的指定偏移量的值,可以在线修改。
copy 把一个block的内容copy到另一个block中
verify 检查当前环境是否有坏块
sum 计算block的checksum,modify之后block就被标识为坏块,current checksum与reqired checksum不一致,sum命令可以计算出新的checksum并应用到当前块。
undo 回滚当前的修改操作,如果手误做错了,undo一下就ok了,回到原来的状态。
revert 回滚所有之前的修改操作,意思就是 undo all

下面做些实验:

先建个表,插入1条数据。
[oracle@vm1 oracle]$ sqlplus
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Sep 14 16:46:15 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter user-name: / as sysdba
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
Wit the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> create table haocp ( a varchar2(10)) tablespace users;
Table created.
SQL> insert into haocp values('a');
1 row created.
SQL> commit;
Commit complete.
SQL> select segment_name,file_id,block_id,blocks from dba_extents where segment_name = 'HAOCP';
SEGMENT_NAME        FILE_ID BLOCK_ID BLOCKS
----------------  ---------- ---------- ----------
HAOCP                 6       33       8

表存放在file 6 block 33 - 33+8 上面,这时先关闭数据库,对users数据文件作个cp。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[oracle@vm1 oracle]$
[oracle@vm1 test]$ pwd
/u01/oracle/oradata/test
[oracle@vm1 test]$ cp users01.dbf users01.dbf.bak
[oracle@vm1 test]$ sqlplus
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Sep 14 16:56:30 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter user-name: / as sysdba
Connected to an idle instance.
SQL> startup

ORACLE instance started.
Total System Global Area 185668648 bytes
Fixed Size 451624 bytes
Variable Size 117440512 bytes
Database Buffers 67108864 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>

重新启动完数据库,进入bbed
[oracle@vm1 oracle]$ ls

a.txt bifile.bbd Desktop log.bbd par.bbd
[oracle@vm1 oracle]$ pwd
/home/oracle
[oracle@vm1 oracle]$ bbed parfile=par.bbd
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Wed Sep 14 17:06:24 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set file 6
FILE# 6
BBED> show  FILE# 6  BLOCK# 1  OFFSET 0
DBA 0x01800001 (25165825 6,1)
FILENAME /u01/oracle/oradata/test/users01.dbf
BIFILE bifile.bbd
LISTFILE a.txt
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED>
刚才创建的haocp表在file 6 blcok 33 - 33+8上面,用bbed看看36的内容
BBED> dump file 6 block 36
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 0 to 511 Dba:0x01800024
------------------------------------------------------------------------
06020000 24008001 9dcc0300 00000106 d3aa0000 01000000 4f190000 9bcc0300
00000000 02003200 21008001 07000a00 54000000 84238000 17000b00 01200000
9dcc0300 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00010100 ffff1400 931f7b1f 7b1f0000 0100931f 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 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

BBED>
offset 偏移量 从 0 到 511 单位是字节,数据块是8k的,想看完全就要扩大offset的范围
BBED> dump file 6 block 36 count 8200
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 0 to 8191 Dba:0x01800024
------------------------------------------------------------------------
06020000 24008001 9dcc0300 00000106 d3aa0000 01000000 4f190000 9bcc0300
00000000 02003200 21008001 07000a00 54000000 84238000 17000b00 01200000
9dcc0300 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00010100 ffff1400 931f7b1f 7b1f0000 0100931f 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 0000002c 01010161 01069dcc

BBED>
Offsets: 0 to 8191 1024 * 8 = 8192个字节,正好8K。注意最后的几个字节中,有个61,这个就是表中的那条数据,验证一下。
SQL> select * from haocp;
A
----------
a

SQL> select dump(a,1016) from haocp;

DUMP(A,1016)
--------------------------------------------------------------------------------
Typ=1 Len=1 CharacterSet=ZHS16GBK: 61
字符a对应的16进制编码是61。如果数据量大的话,可以用find命令查找
BBED> help find
FIND[/x|d|u|o|c] numeric/character string [ TOP | CURR ]
BBED> set file 6
FILE# 6
BBED> set block 36  BLOCK# 36
BBED> find 97 curr
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6101069d cc

BBED> find /x 61 curr
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
-----------------------------------------------------------------------
6101069d cc

在find之前先设置想要查找的 file 和 block,默认是十进制的ascii编码,/x 表示16进制,find的结果显示出offset,即字符出现的位置。
下面试试修改他,把a改成b。
BBED> help modify
MODIFY[/x|d|u|o|c] numeric/character string
[ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
BBED> modify 98 file 6 block 36 offset 8187
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
----------------------------------------------------------------------
6201069d cc

修改完了以后,由61变成62了,不过这时数据块是损坏状态,试一下。
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/oracle/oradata/test/users01.dbf
BLOCK = 36
Block 36 is corrupt
***
Corrupt block relative dba: 0x01800024 (file 0, block 36)
Bad check value found during verification
Data in bad block -
type: 6 format: 2 rdba: 0x01800024
last change scn: 0x0000.0003cc9d seq: 0x1 flg: 0x06
consistency value in tail: 0xcc9d0601
check value in block header: 0xaad3, computed block checksum: 0x300
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
Total Blocks Marked Corrupt : 1
有1个块被标识为损坏,从刚才备份的那个文件覆盖它。
BBED> copy file 2 block 36 to file 6 block 36
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 0 to 511 Dba:0x01800024
------------------------------------------------------------------------
06020000 24008001 9dcc0300 00000106 d3aa0000 01000000 4f190000 9bcc0300
00000000 02003200 21008001 07000a00 54000000 84238000 17000b00 01200000
9dcc0300 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00010100 ffff1400 931f7b1f 7b1f0000 0100931f 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 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

从刚才关闭数据库时cp的文件中复制第36个块来覆盖当前的块,覆盖完了再检查一下。
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/oracle/oradata/test/users01.dbf
BLOCK = 36
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
好了,看看8187的情况
BBED> dump file 6 block 36 offset 8187
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6101069d cc

是原来的61,也就是字符 a 。再次改过来,试试回滚的命令。
BBED> modify /x 62 file 6 block 36 offset 8187
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
----------------------------------------------------------------------
6201069d cc

BBED> undo
BBED> modify /x 61 filename '/u01/oracle/oradata/test/users01.dbf' block 36. offset 8187.
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024------------------------------------
6101069d cc

undo就相当于sqlplus里面的 rollback 不过是回滚上一步,而不是所有操作。
下面试试revert,不过要重新登陆,因为revert是回滚这次登陆以来所有的操作。
BBED> dump file 6 block 36 offset 8187
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6101069d cc

BBED> modify /x 62 file 6 block 36 offset 8187
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6201069d cc

BBED> revert
All changes made in this session will be rolled back. Proceed? (Y/N) y
Reverted file '/u01/oracle/oradata/test/users01.dbf', block 36
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
BBED> dump file 6 block 36 offset 8187
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6101069d cc

个人感觉bbed主要用在数据库恢复的时候,比如由于误操作把数据库的字典表的信息改错了,导致数据库不能启动了,此时用bbed在脱机的情况下把字典表的值再改回来。使数据库open。
用modify改完数据之后,block处于corrupt状态,所以要通过sum命令计算并应用checksum值,使block状态恢复正常。
SQL> select * from haocp;
A
----------
a
BBED> dump file 6 block 36 offset 8187
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6101069d cc
32 bytes per line>
BBED> modify /x 62 file 6 block 36 offset 8187
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/oracle/oradata/test/users01.dbf (6)
Block: 36 Offsets: 8187 to 8191 Dba:0x01800024
------------------------------------------------------------------------
6201069d cc

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/oracle/oradata/test/users01.dbf
BLOCK = 36
Block 36 is corrupt
***
Corrupt block relative dba: 0x01800024 (file 0, block 36)
Bad check value found during verification
Data in bad block -
type: 6 format: 2 rdba: 0x01800024
last change scn: 0x0000.0003cc9d seq: 0x1 flg: 0x06
consistency value in tail: 0xcc9d0601
check value in block header: 0xaad3, computed block checksum: 0x300
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
修改完之后block的状态是corrupt的。用sum命令使之有效。
BBED> help sum
SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ]
BBED> sum file 6 block 36
Check value for File 6, Block 36:
current = 0xaad3, required = 0xa9d3
此时 current checksum 是0xaad3,required checksum 是 0xa9d3
BBED> sum file 6 block 36 apply
Check value for File 6, Block 36:
current = 0xa9d3, required = 0xa9d3
加上apply参数,使checksum一致。此时block状态恢复正常。
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/oracle/oradata/test/users01.dbf
BLOCK = 36
DBVERIFY - Verification complet
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
看看数据库的数据
SQL> select * from haocp;
A
----------
a

还是 a ,重启一下。

SQL> startup force
ORACLE instance started.
Total System Global Area 185668648 bytes
Fixed Size 451624 bytes
Variable Size 117440512 bytes
Database Buffers 67108864 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> select * from haocp;
A
----------
b

 

时间: 2024-09-17 07:56:13

修复损坏的数据块的相关文章

oracle 01578 数据块损坏 怎么忽略

问题描述 oracle 01578 数据块损坏 怎么忽略 windows 2008 oracle 11 非归档模式 数据库启动时没有错误提示.写入数据时会提示01578,这个数据文件在一个大的空间里(有很多数据文件).我把它offline drop 后,查询它的状态是available.再写入数据时会提示01110错误,用recover 不成功,因为没有归档的日志. 请问:我能否在offline前把这个坏块的错误忽略掉?或者我在offline后不让数据库再去访问这个数据文件呢? 解决方案 在 e

如何修复损坏数据库中的数据表

在使用MySQL过程中,各种意外会导致数据库表的损坏,而且这些数据往往是最新的数据,通常不可能在备份数据中找到.在使用阿里云数据库RDS产品中,RDS是如何修复损坏数据库中的数据表的呢?在传统数据库中,又是如何对其进行修复的呢?接下来,我们将做一个比较: 阿里云数据库RDS 阿里云提供的关系型数据库(Relational Database Service,简称 RDS)是一种稳定可靠.可弹性伸缩的在线数据库服务.基于飞天分布式系统和高性能存储,RDS 支持 MySQL.SQL Server.Po

HDFS源码分析数据块汇报之损坏数据块检测checkReplicaCorrupt()

        无论是第一次,还是之后的每次数据块汇报,名字名字节点都会对汇报上来的数据块进行检测,看看其是否为损坏的数据块.那么,损坏数据块是如何被检测的呢?本文,我们将研究下损坏数据块检测的checkReplicaCorrupt()方法.         关于数据块及其副本的状态,请阅读<HDFS源码分析之数据块及副本状态BlockUCState.ReplicaState>一文.         checkReplicaCorrupt()方法专门用于损坏数据块检测,代码如下: /** *

Oracle数据块恢复(dbv、BMR)

Oracle数据块恢复(dbv.BMR) 物理坏块和逻辑坏块 Oracle数据文件的坏块可以分为物理坏块和逻辑坏块.物理坏块指的是块格式本身已经损坏,块内的数据没有任何意义.而逻辑坏块,指的是块内的数据在逻辑上存在问题,比如说索引块的索引值没有按从小到大排列导致的逻辑坏块.物理坏块一般是由于内存问题.OS问题.I/O子系统问题或硬件引起的,逻辑坏块一般是有Oracle bug等原因引起的. 各种各样的块损坏通常是通过Oracle的ORA-1578错误报告出来的,详细的损坏描述会在告警日志中打印出

hadoop之HDFS:数据块恢复与文件上传测试

问题导读 1.块恢复操作主要受哪些影响? 2.数据块恢复测试场景需要什么? 3.通过对Client与DataNode通信性能分析,读写小文件和性能有什么关系? 1.数据块恢复 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;   当某台机器上的一个DataNode进程down掉,HDFS为了保证文件的副本满足设定的副本数,会进行数据块的恢复操作.块恢复操作主要受两个参数影响:     a)dfs.namenode.

Oracle中模拟及修复数据块损坏

在Oracle数据库中,我们可能遭遇很多数据损坏的情况,在面对这些情况时如何进行数据恢复是非常重要的.在很多情况下,恢复是极其复杂的,而且需要谨慎,轻率的操作和尝试可能导致数据库的永久损坏. 所以我建议在恢复尝试前应当先进行数据备份. 对于重要的数据库,如果不能确定恢复步骤和操作后果,建议最好先向专业人士进行咨询,以避免不必要的数据损失. 本文通过试验模拟和解决数据块损坏问题,是对一类数据库损坏的恢复探讨 1.插入数据 E:\Oracle\ora92\bin>sqlplus "/ as s

[20160531]windows下bbed修复corrupt数据块

[20160531]windows下bbed修复corrupt数据块.txt --昨天别人的问题,使用windows下的bbed修复corrupt数据块报错.我自己也重复测试看看: --bbed在windows的安装看: http://blog.itpub.net/267265/viewspace-2109019/ 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER --------

Oracle数据块损坏恢复总结

Oracle数据块损坏恢复总结 在恢复前使用DBV命令检查数据文件是否存在坏块 dbv file=d:\oracle\oradata\mydb\RONLY.DBF blocksize=8192 查看数据坏块所在数据文件号及块号可以对表进行一次全表扫描,如: select count(*) from tablename; 1.    没有备份的情况下: 1.1.使用exp/imp恢复   在这种情况下肯定会造成数据的丢失,在这种情况下应采取将数据导出然后重建表再进行导入的方法,来尽量恢复损坏数据块

hadoop hbase集群断电数据块被破坏无法启动

集群机器意外断电重启,导致hbase 无法正常启动,抛出reflect invocation异常,可能是正在执行的插入或合并等操作进行到一半时中断,导致部分数据文件不完整格式不正确或在hdfs上block块不完整. 在网上查了一下相关资料,怀疑有可能是关闭前一些未提交的修改所存放的log文件数据写入一半文件不完整,故把hbase.hlog.split.skip.errors改成true进行尝试. 关于这个参数作用的解释: 当服务器奔溃,重启的时候,会有个回放的过程,把/hbase/WAL/下面记