一、安装BBED
BBED这是Oracle一款内部工具,可以直接修改Oracle数据文件块的内容,在一些极端恢复场景下比较有用。使用起来也很方便,当然该工具不受Oracle支持,所以默认是没有生成可执行文件的,在使用前需要重新连接。
在9i/10g中连接生成bbed:
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed
具体操作步骤如下:
oracle@localhost.localdomain:/opt/oracle/10.2.0/orcl/rdbms/lib>make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed
Linking BBED utility (bbed)
rm -f /opt/oracle/10.2.0/orcl/rdbms/lib/bbed
gcc -o /opt/oracle/10.2.0/orcl/rdbms/lib/bbed -L/opt/oracle/10.2.0/orcl/rdbms/lib/ -L/opt/oracle/10.2.0/orcl/lib/ -L/opt/oracle/10.2.0/orcl/lib/stubs/ /opt/oracle/10.2.0/orcl/lib/s0main.o /opt/oracle/10.2.0/orcl/rdbms/lib/ssbbded.o /opt/oracle/10.2.0/orcl/rdbms/lib/sbbdpt.o `cat /opt/oracle/10.2.0/orcl/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 /opt/oracle/10.2.0/orcl/rdbms/lib/defopt.o -ldbtools10 -lclntsh `cat /opt/oracle/10.2.0/orcl/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /opt/oracle/10.2.0/orcl/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /opt/oracle/10.2.0/orcl/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /opt/oracle/10.2.0/orcl/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /opt/oracle/10.2.0/orcl/lib/sysliblist` -Wl,-rpath,/opt/oracle/10.2.0/orcl/lib -lm `cat /opt/oracle/10.2.0/orcl/lib/sysliblist` -ldl -lm -L/opt/oracle/10.2.0/orcl/lib
第一次执行bbed的时候遇到如下情况
oracle@localhost.localdomain:/opt/oracle/10.2.0/orcl/rdbms/lib>bbed
-bash: bbed: command not found
oracle@localhost.localdomain:/opt/oracle/10.2.0/orcl/rdbms/lib>ls -al bbed
-rwxr-xr-x 1 oracle oinstall 541134 08-06 16:58 bbed
需要以./bbed的方式才能够执行bbed
oracle@localhost.localdomain:/opt/oracle/10.2.0/orcl/rdbms/lib>./bbed
Password:blockedit –密码
BBED: Release 2.0.0.0.0 – Limited Production on Sat Aug 6 17:24:43 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
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的配置状态
BBED>show
FILE# 0
BLOCK# 1
OFFSET 0
DBA 0×00000000 (0 0,1)
FILENAME
BIFILE bifile.bbd
LISTFILE
BLOCKSIZE 8192
MODE Browse
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No

Trackback

no comment untill now

Add your comment now

切换到手机版