首页 > 代码库 > bbed安装
bbed安装
1.bbed 简介
bbed (Block Browerand EDitor Tool):是oracle内存使用的一个工具,能直接查看和修改文件数据。但不受oracle支持,在一些复杂及极端的环境下使用。
对深入了解数据块结构能起到很好的帮助作用。
2.bbed安装过程
第一步:
oracle 11g中缺bbed包,oracle11g bbed install and example
上传(sbbdpt.o ssbbded.o bbedus.msb,该三个文件拷贝oracle的linux64版本的)文件
$ORACLE_HOME/rdbms/lib/ssbbded.o
$ORACLE_HOME/rdbms/lib/sbbdpt.o
$ORACLE_HOME/rdbms/mesg/bbedus.msb
第二步:
执行以下命令进行编译:
cd $ORACLE_HOME/rdbms/lib
make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
第三步:
BBED是Oracle 内部使用的命令,所以Oracle 不提供技术支持。 为了安全,BBED设置了口令保护,默认密码为blockedit。进入bbed
[oracle@localhost ~]$ bbedPassword: BBED: Release 2.0.0.0.0 - Limited Production on Fri Nov 21 20:40:12 2014Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.************* !!! For Oracle Internal Use only !!! ***************BBED>
第四步: 配置bbed默认环境
创建parameter file文件
[oracle@localhost tmp]$ vi bbedpar.txt然后插入blocksize=8192listfile=/tmp/filelist.txtmode=edit
创建filelist.txt
执行select file#||chr(9)||name||chr(9)||bytes from v$datafile;
SQL> select file#||chr(9)||name||chr(9)||bytes from v$datafile;FILE#||CHR(9)||NAME||CHR(9)||BYTES--------------------------------------------------------------------------------1 /app/oracle/oradata/orcl/system01.dbf 7549747202 /app/oracle/oradata/orcl/sysaux01.dbf 6710886403 /app/oracle/oradata/orcl/undotbs01.dbf 996147204 /app/oracle/oradata/orcl/users01.dbf 7169638405 /app/oracle/product/11g/db_1/dbs/D:OracleAdministratororadatayftestRES.DBF 5242880006 /tmp/user01.dbf 419430406 rows selected.
把查询的内容插入到filelist.txt中
第五步:
可以测试:
[oracle@localhost tmp]$ bbed parfile = /tmp/bbedpar.txtPassword: BBED: Release 2.0.0.0.0 - Limited Production on Fri Nov 21 20:46:30 2014Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.************* !!! For Oracle Internal Use only !!! ***************BBED>
成功
3.bbed命名
使用help all 查看bbed的基本命令
BBED> help allSET DBA [ dba | file#, block# ]SET FILENAME ‘filename‘SET FILE file#SET BLOCK [+/-]block#SET OFFSET [ [+/-]byte offset | symbol | *symbol ]SET BLOCKSIZE bytesSET LIST[FILE] ‘filename‘SET WIDTH character_countSET COUNT bytes_to_displaySET IBASE [ HEX | OCT | DEC ]SET OBASE [ HEX | OCT | DEC ]SET MODE [ BROWSE | EDIT ]SET SPOOL [ Y | N ]SHOW [ <SET parameter> | ALL ]INFOMAP[/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 ]</Nuf>: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 rowf - 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 rowidFIND[/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] <target spec>=<source spec><target spec> : [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]<source spec> : [ value | <target spec options> ]SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ]PUSH [ DBA | FILE | FILENAME | BLOCK | OFFSET ]POP [ALL]REVERT [ DBA | FILE | FILENAME | BLOCK ]UNDOHELP [ <bbed command> | ALL ]VERIFY [ DBA | FILE | FILENAME | BLOCK ]CORRUPT [ DBA | FILE | FILENAME | BLOCK ]
截取一些常用命令的说明
SET DBA [ dba | file#, block# ] -----设置(data block address file#+block#)SET FILENAME ‘filename‘ -----设置哪个文件的名称SET FILE file# -----设置文件号SET BLOCK [+/-]block# -----设置块号SET OFFSET [ [+/-]byte offset | symbol | *symbol ] -----设置偏移量,字节为单位SET BLOCKSIZE bytes -----设置块的大小(8192)SET LIST[FILE] ‘filename‘ -----设置文件列表SET WIDTH character_count -----设置显示宽度SET COUNT bytes_to_display -----设置显示的字节bytes数SET IBASE [ HEX | OCT | DEC ] ---设置进制的模式SET OBASE [ HEX | OCT | DEC ] -----SET MODE [ BROWSE | EDIT ] ---设置操作模式,查看还是编辑SET SPOOL [ Y | N ] -----是否保存操作日志
安装等都很简单,命令也很少,但使用时需要对oracle 数据块等很了解才能发挥出它的作用。
希望自己能好好加油!!
bbed安装