湖北佛 发表于 2013-9-9 08:45:21

BBED delete恢复

sys@OMREP> delete from srain where rownum=1;

sys@OMREP> commit;

sys@OMREP> select * from srain;

JOB
----------------------------------------------------------------------------------------------------
Srain like oracle!

block_row_dump:
tab 0, row 0, @0x1f8f
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x1f79
tl: 22 fb: --H-FL-- lb: 0x0cc: 1
col0: 53 72 61 69 6e 20 6c 69 6b 65 20 6f 72 61 63 6c 65 21
end_of_block_dump

fb: --H-FL--含义:
(1)Head of Row Piece
(2)First Data Piece
(3)Last Data Piece
如果一个row 没有被删除,那么它就具有上面的3个属性,即Flag 表示为:--H-FL--. 这里的字母分别代表属性的首字母。其对应的值:32 + 8 + 4 =44 or 0x2c.
如果一个row 被delete了,那么row flag 就会更新,bitmask 里的deleted 被设置为16. 此时row flag 为: 32 + 16 + 8 + 4 = 60 or 0x3c.

BBED> p *kdbr
rowdata
-----------
ub1 rowdata                           @8171   0x3c

BBED> d /v offset 8171
File: /u01/app/oracle/oradata/omrep/system01.dbf (1)
Block: 33145   Offsets: 8171 to 8191Dba:0x00408179
-------------------------------------------------------
3c02010d 53726169 6e206973 20646261 l <...Srain is dba
21020659 8b                         l !..Y.

<16 bytes per line>
**************************************************************************************************************
BBED> modify /x 2c offset 8171
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/app/oracle/oradata/omrep/system01.dbf (1)
Block: 33145            Offsets: 8171 to 8191         Dba:0x00408179
------------------------------------------------------------------------
2c02010d 53726169 6e206973 20646261 21020659 8b

<32 bytes per line>

BBED> d /v offset 8171
File: /u01/app/oracle/oradata/omrep/system01.dbf (1)
Block: 33145   Offsets: 8171 to 8191Dba:0x00408179
-------------------------------------------------------
2c02010d 53726169 6e206973 20646261 l ,...Srain is dba
21020659 8b                         l !..Y.

<16 bytes per line>

BBED> sum apply
Check value for File 1, Block 33145:
current = 0x8169, required = 0x8169

*****************************************************************************************************************
sys@OMREP> alter system flush buffer_cache;

System altered.

sys@OMREP> select * from srain;

JOB
----------------------------------------------------------------------------------------------------
Srain is dba!
Srain like oracle!

页: [1]
查看完整版本: BBED delete恢复