Sample output from a 10.2.0.1 installation is
shown below. The reason for showing it is to
illustrate the difference between Oracle
versions 9 and 10 in the flags. Put another way,
there is no guarantee that one can take bbed
from one version and use it on another version,
but one is welcome to try.
[oracle@oralinux lib]$
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed
Linking BBED utility (bbed)
rm -f
/opt/oracle/product/10.2.0/db_1/rdbms/lib/bbed
gcc -o
/opt/oracle/product/10.2.0/db_1/rdbms/lib/bbed
-L/opt/oracle/product/10.2.0/db_1/rdbms/lib/
-L/opt/oracle/product/10.2.0/db_1/lib/
-L/opt/oracle/product/10.2.0/db_1/lib/stubs/
-L/usr/lib -lirc
/opt/oracle/product/10.2.0/db_1/lib/s0main.o
/opt/oracle/product/10.2.0/db_1/rdbms/lib/ssbbded.o
/opt/oracle/product/10.2.0/db_1/rdbms/lib/sbbdpt.o
`cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`
-lnsslb10 -lncrypt10 -lnsgr10
<some lines removed>
-lclient10 -lnnetd10
-lvsn10 -lcommon10 -lgeneric10
-lsnls10 -lnls10
-lcore10 -lsnls10 -lnls10 -lcore10
-lsnls10 -lnls10 -lxml10 -lcore10 -lunls10
-lsnls10 -lnls10 -lcore10 -lnls10
`cat
/opt/oracle/product/10.2.0/db_1/lib/sysliblist`
-Wl,-rpath,/opt/oracle/product/10.2.0/db_1/lib
-lm
`cat
/opt/oracle/product/10.2.0/db_1/lib/sysliblist`
-ldl -lm
-L/opt/oracle/product/10.2.0/db_1/lib
To confirm the creation, see if the bbed
executable was created. In this example, the
make command was executed in the rdbms/lib
directory. Bbed can be placed anywhere the DBA
likes. Also, change the permissions if needed.
-rwxr-xr-x
1 oracle
dba
434057 Aug 25 16:26 bbed
To confirm that the utility actually runs,
invoke it. This example uses the 10g version,
which shows release 2.0.0.0.0, and so does the
9.0.4 version. Aside from the change in the
copyright, the release does not appear to have
changed in quite some time.
[oracle@oralinux lib]$ ./bbed
Password:
BBED: Release 2.0.0.0.0 -
Limited Production on Wed Aug 27 16:17:06
2008
Copyright (c) 1982, 2005,
Oracle.
All rights reserved.
************* !!! For
Oracle Internal Use only !!! ***************
BBED>
Note that one will be prompted for a password.
Virtually all of the references to bbed via a
search on the Internet mention that if one is
motivated enough to be using bbed in the first
place, then one is clever enough to determine
the password on one’s own. The password is
blockedit. It will be seen as BLOCKEDIT in a hex
dump file of bbed. Use xxd in /usr/bin to create
a dump of bbed, and then look for “BBED>” in the
file. A few lines up is BLOCKEDIT.
The mileage may vary, but it is possible to use
BBED.EXE that shipped with Oracle 8.1.6, which
was about the last time the Windows version was
included in the RDBMS software installation, and
use that executable against later versions of
Oracle datafiles.
Before going into syntax and examples, some
preliminaries are in order.
First and foremost is this: bbed is an
undocumented and unsupported, from a customer’s
perspective, utility. Unless being directed to
use this tool by Oracle Support, the DBA is on
his own. Do not use bbed on a production
database unless one knows what one is doing. Do
not use bbed on any database that one cannot
afford to lose. Take a backup of any database on
which this tool is going to be used.
If the DBA needs to recover data and finds
herself completely stymied by every other effort
made so far, this is the last resort. There may
be bigger and better tools out there, but the
“here and now” tool is bbed. If this tool is
needed to save/rescue/recover a production
database, it would be in the DBA’s best interest
to first take a cold backup and then take a copy
of that backup as the test bed. In other words,
do the work on files separate from the actual
files. If the DBA is trying to restore data,
transfer it from a rescue instance back into the
production instance.
Oracle documentation for bbed, to include
looking for it on MetaLink, or My Oracle Support
as it is now known, is almost nowhere to be
found in the public domain. MetaLink note
62015.1 contains (assuming it still exists
within OSS) a note that “BBED is
a SUPPORT ONLY tool and should NOT be discussed
with customers.” The contents of the note are
available inside a mailing list, and support
agreements prevent publishing it within this
book. (See
http://www.freelists.org/archives/oracle-l/04-2004/
msg01068. html)
Nonetheless, information can be gleaned about
this tool and others as well from the message
library that accompanies Oracle software.
$ORACLE_HOME/rdbms/mesg contains a file named
bbedus.msg. One can cat or vi the file and
peruse its contents to obtain an idea of how the
tool works. Within the message library towards
the end is a listing of valid positional
parameters, one of which is HELP. Windows
installations of Oracle still contain the
message library even though BBED.EXE is no
longer included.
Before one starts working directly with bbed, it
is helpful to know one’s way around data blocks
in general including how to get internal block
information by row within a table. That and
other pieces of information commonly needed
include the absolute file number, the full path
and name of datafiles, datafile size in blocks,
data block address, block number, block size,
and the block type.
The DBA needs a reporting tool to output
information about a block. There is more than
one way to get this information, but the easiest
is based on using the supplied PL/SQL built-in
named DBMS_ROWID. This package with ten
functions and one procedure has been available
since at least the Oracle8i days, but use of it
may be new to the DBA. Information from several
functions is combined in the one procedure which
makes use of OUT parameters. Create one’s own
wrapper procedure around DBMS_ROWID.ROWID_INFO
to make it reusable. Next look at what the
procedure contains (Oracle®
Database PL/SQL
Packages and Types Reference 10g Release 2
(10.2)).