首页 > Linux操作系统 > Linux操作系统 > Oracle bbed 五个 实用示例

Oracle bbed 五个 实用示例

原创 Linux操作系统 作者:vcdog 时间:2011-08-27 05:31:07 0 删除 编辑


在之前的blog 里介绍了BBED 工具的语法部分。 参考:

       Oracle BBED 工具 说明


在这篇主要看一下BBED 工具的几个使用示例。


       Althoughbbed can modify data in the data files of an open Oracle database, it isadvisable to shut down the database before making any changes. This avoids thecheckpoint process overwriting the changes made with bbed from the Oracle blockcache. It also avoids Oracle reading the block before the modifications arecomplete and declaring the block corrupt.

       虽然bbed 可以在db open 状态来进行修改,但是建议在做任何修改操作之前先shutdown db。 这样避免checkpoint 进程重写bbed 对block 的修改。 也避免oracle 在bbed 修改完成之前读block 或者申明block 为corrupt。


       Important:Using bbed to modify the contents of an Oracle data block renders the dataun-supported by Oracle. These examples should be used for educational purposesonly. If they are used on real production databases they should only be used asa last resort and once the immediate problem has been resolved, all retrievabledata should be exported and a new database created.

       bbed工具不受Oracle 的技术支持。


       Althoughbbed can be used to open a database that would otherwise be beyond salvaging,the DBA must bear in mind that the internal tables such as OBJ$, UET$ and FET$may no longer match the contents of the data blocks. The behavior. of thedatabase will therefore be unpredictable and ORA-600 errors are likely.


一. 示例: 修改Data 内容

 1.1 连接bbed

[oracle@db2 ~]$ bbed parfile=/u01/bbed.par



BBED: Release - LimitedProduction on Fri Aug 12 18:26:46 2011


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


************* !!! For Oracle Internal Useonly !!! ***************




1.2 查看要修改的内容

SYS@dave2(db2)> select * from dvd;




Dave is DBA!

Dave like Oracle!

注意: bbed 的修改仅仅是对原有位置内容的一个替换。


对应block 的信息如下:

SYS@dave2(db2)> select

  2   rowid,

 3 dbms_rowid.rowid_relative_fno(rowid)rel_fno,

 4 dbms_rowid.rowid_block_number(rowid)blockno,

 5 dbms_rowid.rowid_row_number(rowid) rowno

 6  from dvd;


ROWID                 REL_FNO    BLOCKNO     ROWNO

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

AAAN9VAABAAAcKiAAA          1    115362          0

AAAN9VAABAAAcKiAAB          1    115362          1




1.3 查找关键字Dave,确定其在block中的偏移量offset。


BBED> set dba 1,115362 offset 0

       DBA             0x0041c2a2(4309666 1,115362)

       OFFSET          0


BBED> find /c Dave

 File:/u01/app/oracle/oradata/dave2/system01.dbf (1)

 Block: 115362           Offsets: 8176 to 8191           Dba:0x0041c2a2


 44617665 20697320 44424121 020616b3




dump 查看具体内容:

BBED> dump /v dba 1,115362 offset 8176count 128

 File: /u01/app/oracle/oradata/dave2/system01.dbf(1)

 Block: 115362 Offsets: 8176 to 8191 Dba:0x0041c2a2


 44617665 20697320 44424121 020616b3 l Dave isDBA!...

Link URL:

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量