ITPub博客

首页 > Linux操作系统 > Linux操作系统 > bbed实验二 recovering deleted row

bbed实验二 recovering deleted row

原创 Linux操作系统 作者:v_fantasy 时间:2009-04-03 23:24:03 0 删除 编辑

首先看表里的数据

SQL> select * from test;

         A B
---------- ----------
         1 ysatnaf
         2 daily
         3 lovely
删除第一条数据,并提交

SQL> delete test where a=1;

1 row deleted.

SQL> commit;

Commit complete.

进入bbed进行修改

HHL-690-1:/oracle/bbed$bbed parfile=par.bbd
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Fri Apr 3 23:37:58 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

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

BBED> set file 2
        FILE#           2

BBED> set block 61
        BLOCK#          61

BBED>
BBED>
BBED> p *kdbr[0]
rowdata[25]
-----------
ub1 rowdata[25]                             @8174     0x3c

BBED> dump /v 8174 count 20
BBED-00202: invalid parameter (8174)


BBED> dump /v offset 8174 count 20
 File: /dev/rzz_01_lv (2)
 Block: 61      Offsets: 8174 to 8191  Dba:0x0080003d
-------------------------------------------------------
 3c020202 c1020779 7361746e 61667699 l <......ysatnafv.
 0602                                l ..

 <16 bytes per line>

BBED> modify /x 2c
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /dev/rzz_01_lv (2)
 Block: 61               Offsets: 8174 to 8191           Dba:0x0080003d
------------------------------------------------------------------------
 2c020202 c1020779 7361746e 61667699 0602

 <32 bytes per line>

BBED> dump /v 8174
BBED-00202: invalid parameter (8174)


BBED> dump /v offset 8174
 File: /dev/rzz_01_lv (2)
 Block: 61      Offsets: 8174 to 8191  Dba:0x0080003d
-------------------------------------------------------
 2c020202 c1020779 7361746e 61667699 l ,......ysatnafv.
 0602                                l ..

 <16 bytes per line>

BBED> sum apply
Check value for File 2, Block 61:
current = 0x24e7, required = 0x24e7

 

在看看表数据

SQL> select * from test;

         A B
---------- ----------
         2 daily
         3 lovely

SQL>
SQL>
SQL> select * from test;

         A B
---------- ----------
         2 daily
         3 lovely

SQL>               
SQL> /

         A B
---------- ----------
         2 daily
         3 lovely

SQL> alter system flush buffer_cache;

System altered.

SQL> select * from test;

         A B
---------- ----------
         1 ysatnaf
         2 daily
         3 lovely

由于db_buffer中存在此块的副本,所以前两次查到得数据不是实际的数据,flush之后重新读物理值,删除的数据便回来了:)

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16158219/viewspace-584617/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-10-07

  • 博文量
    98
  • 访问量
    179493