有人在Google新聞組上提出了一個問題:“How can I get the BBED passWord?”,繼而引發了一場很有意思的討論。 后來Pete Finnigan也在他的Blog寫了一篇文章"An interesting thread on Oracle-l about BBED"描述這次有意思的探討。 在討論中,有一個有趣的觀點提到,假如這個工具被廣泛傳播,那么可能有些人不是用BBED來修復數據,意外的破壞可能更為多見。最終的后果可能是Oracle徹底把這個工具移除。BBED是Block Browser/Editor的縮寫,是Oracle的一個內部工具,不對外發布文檔及支持。BBED隨軟件發布,但是我們需要進行簡單的relink才能使用,relink請參考:How to compile Oracle10g BBED tools. 雖然BBED工具的使用存在很多風險,但是假如利用得當,可以以之解決很多棘手的問題。本文簡單介紹一下如何用BBED模擬壞塊,以練習壞塊修復等技術,此前我曾經介紹過另外一種方法,請參考:Oracle中模擬及修復數據塊損壞 1.創建測試表
[oracle@jumper conner]$ sqlplus "/ as sysdba"SQL*Plus: Release 9.2.0.4.0 - PRodUCtion on Sun Sep 11 19:59:27 2005Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Connected to:Oracle9i Enterprise Edition Release 9.2.0.4.0 - ProductionWith the Partitioning optionJServer Release 9.2.0.4.0 - ProductionSQL> create table bbed tablespace users as select * from dba_tables;Table created.SQL> select count(*) from bbed;COUNT(*)523SQL> col segment_name for a10SQL> select segment_name,file_id,block_id from dba_extents where segment_name='BBED';SEGMENT_NA FILE_ID BLOCK_ID---------- ---------- ----------BBED 3 9BBED 3 17BBED 3 25SQL> select count(*) from bbed;COUNT(*)523
2.創建BBED參數文件等。
[oracle@jumper conner]$ more filelist.txt1 /opt/oracle/oradata/conner/system01.dbf 4404019202 /opt/oracle/oradata/conner/undotbs01.dbf 1048576003 /opt/oracle/oradata/conner/users01.dbf 27262976[oracle@jumper conner]$ more par.bbdblocksize=8192listfile=filelist.txtmode=edit
3.使用BBED
[oracle@jumper conner]$ bbed parfile=par.bbdPassword:BBED: Release 2.0.0.0.0 - Limited Production on Sun Sep 11 20:01:01 2005 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED> set file 3 FILE# 3 BBED> show FILE# 3 BLOCK# 1 OFFSET 0 DBA 0x00c00001 (12582913 3,1) FILENAME /opt/oracle/oradata/conner/users01.dbf BIFILE bifile.bbd LISTFILE filelist.txt BLOCKSIZE 8192 MODE Edit EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL No