BBED的编译需要一些依赖包,如果你没有提供这些依赖包,那么你会遇到错误,像下面这样:
[oracle@ora11gdg1 ~]$ cd $ORACLE_HOME/rdbms/lib [oracle@ora11gdg1 lib]$ ls -ltr | grep bbed [oracle@ora11gdg1 lib]$ ls -ltr | grep ins_rdbms -rw-r--r-- 1 oracle oinstall 40983 Aug 24 2013 ins_rdbms.mk [oracle@ora11gdg1 lib]$ [oracle@ora11gdg1 lib]$ make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed Linking BBED utility (bbed) rm -f /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed gcc -o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed -m64 -z noexecstack -L/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/stubs/ /u01/app/oracle/product/11.2.0/dbhome_1/lib/s0main.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ssbbded.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/sbbdpt.o `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -ldbtools11 -lclntsh `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/11.2.0/dbhome_1/lib -lm `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -ldl -lm -L/u01/app/oracle/product/11.2.0/dbhome_1/lib gcc: /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ssbbded.o: No such file or directory gcc: /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/sbbdpt.o: No such file or directory make: *** [/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed] Error 1 [oracle@ora11gdg1 lib]$
可以很明显的看到上面的报错【No such file or directory】。
BBED的成功编译需要这样的几个依赖包:
$ORACLE_HOME/rdbms/lib/sbbdpt.o $ORACLE_HOME/rdbms/lib/ssbbded.o $ORACLE_HOME/rdbms/mesg/bbedus.msb $ORACLE_HOME/rdbms/mesg/bbedus.msg
但是从11g开始,Oracle不提供这些包了。
你可以从10g上面获取这些包,放到11g或者12c中使用。
如果没有已经安装好的10g环境,可以直接从10g的安装介质中提取上面的几个包:
解压好的10g的安装介质:
[root@ora11gdg1 software]# pwd /software [root@ora11gdg1 software]# [root@ora11gdg1 software]# ls -ltr total 782824 drwxr-xr-x 6 94110 42424 4096 Oct 23 2005 database -rw-r--r-- 1 root root 801603584 Jul 15 2010 10201_database_linux_x86_64.cpio [root@ora11gdg1 software]#
查询脚本:
[root@ora11gdg1 software]# find / -name "jar" /u01/app/oracle/product/13c/agent/agent_13.2.0.0.0/oracle_common/jdk/bin/jar /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/jar [root@ora11gdg1 software]# [root@ora11gdg1 software]# cat ~/find_jar_in_oracle.sh for jar in $(find /software/database -type f -name "*.jar" | grep rdbms ) do result=$(/u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/jar -tvf $jar | grep --color -E "sbbdpt.o|ssbded.o|bbedus.msb|bbedus.msg" && echo $jar) if [ "$result" != "" ] then echo "------------- jar is : [$jar]" echo "$result" echo "" fi done [root@ora11gdg1 software]#
执行脚本:
[root@ora11gdg1 software]# sh ~/find_jar_in_oracle.sh ------------- jar is : [/software/database/stage/Components/oracle.rdbms.util/10.2.0.1.0/1/DataFiles/filegroup5.jar] 8704 Fri Sep 09 09:46:10 CST 2005 rdbms/mesg/bbedus.msb 10270 Tue Jul 25 19:32:00 CST 2000 rdbms/mesg/bbedus.msg /software/database/stage/Components/oracle.rdbms.util/10.2.0.1.0/1/DataFiles/filegroup5.jar ------------- jar is : [/software/database/stage/Components/oracle.rdbms/10.2.0.1.0/1/DataFiles/filegroup33.jar] 1863 Sat Sep 17 19:59:24 CST 2005 rdbms/lib/sbbdpt.o /software/database/stage/Components/oracle.rdbms/10.2.0.1.0/1/DataFiles/filegroup33.jar ------------- jar is : [/software/database/stage/Components/oracle.rdbms.hybrid/10.2.0.1.0/1/DataFiles/filegroup1.jar] 3043 Thu Sep 08 03:43:08 CST 2005 rdbms/lib32/sbbdpt.o /software/database/stage/Components/oracle.rdbms.hybrid/10.2.0.1.0/1/DataFiles/filegroup1.jar [root@ora11gdg1 software]#
找到了需要的【*.jar】文件后,就可以针对性的解压了:
[root@ora11gdg1 software]# ls 10201_database_linux_x86_64.cpio database jar_unzip_dir [root@ora11gdg1 software]# [root@ora11gdg1 software]# cd jar_unzip_dir/ [root@ora11gdg1 jar_unzip_dir]# [root@ora11gdg1 jar_unzip_dir]# /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/jar xvf /software/database/stage/Components/oracle.rdbms.util/10.2.0.1.0/1/DataFiles/filegroup5.jar inflated: rdbms/mesg/bbedus.msb inflated: rdbms/mesg/expus.msb inflated: rdbms/mesg/impus.msb inflated: rdbms/mesg/nidus.msb inflated: rdbms/mesg/opwus.msb inflated: rdbms/mesg/sbtus.msb inflated: rdbms/mesg/udeus.msb inflated: rdbms/mesg/udius.msb inflated: rdbms/mesg/ulus.msb inflated: rdbms/mesg/dgmus.msb inflated: rdbms/mesg/bbedus.msg inflated: rdbms/mesg/expus.msg inflated: rdbms/mesg/impus.msg inflated: rdbms/mesg/sbtus.msg inflated: rdbms/mesg/udeus.msg inflated: rdbms/mesg/udius.msg inflated: rdbms/mesg/ulus.msg inflated: rdbms/mesg/dgmus.msg [root@ora11gdg1 jar_unzip_dir]# [root@ora11gdg1 jar_unzip_dir]# /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/jar xvf /software/database/stage/Components/oracle.rdbms/10.2.0.1.0/1/DataFiles/filegroup33.jar inflated: rdbms/lib/dmndm.o inflated: rdbms/lib/dmndmse.o inflated: rdbms/lib/hoaoci.o inflated: rdbms/lib/hoat.o inflated: rdbms/lib/hoax.o inflated: rdbms/lib/homts.o inflated: rdbms/lib/horm.o inflated: rdbms/lib/hormc.o inflated: rdbms/lib/hormd.o inflated: rdbms/lib/hormt.o inflated: rdbms/lib/hout.o inflated: rdbms/lib/hsxaora.o inflated: rdbms/lib/jox.o inflated: rdbms/lib/joxoff.o inflated: rdbms/lib/kciwcx.o inflated: rdbms/lib/kcsm.o inflated: rdbms/lib/kfod.o inflated: rdbms/lib/kkxntp.o inflated: rdbms/lib/kkxwtp.o inflated: rdbms/lib/kopc.o inflated: rdbms/lib/kprnts.o inflated: rdbms/lib/kprwts.o inflated: rdbms/lib/kpucb.o inflated: rdbms/lib/ksms.o inflated: rdbms/lib/ksnkcs.o inflated: rdbms/lib/ksnktd.o inflated: rdbms/lib/ksnnni.o inflated: rdbms/lib/ksnnt2.o inflated: rdbms/lib/ktd.o inflated: rdbms/lib/kzlnlbac.o inflated: rdbms/lib/libknlopt.a inflated: rdbms/lib/libperfsrv10.a inflated: rdbms/lib/libdsga10.a inflated: rdbms/lib/libskgxns.a inflated: rdbms/lib/libodm10.a inflated: rdbms/lib/libqsmashr.a inflated: rdbms/lib/opimai.o inflated: rdbms/lib/s0kudbv.o inflated: rdbms/lib/s0kuzr.o inflated: rdbms/lib/sbbdpt.o inflated: rdbms/lib/shou.o inflated: rdbms/lib/shorm.o inflated: rdbms/lib/skfedpt.o inflated: rdbms/lib/skfodpt.o inflated: rdbms/lib/skrspt.o inflated: rdbms/lib/ssbbded.o inflated: rdbms/lib/sskfeded.o inflated: rdbms/lib/sskfoded.o inflated: rdbms/lib/sskrned.o inflated: rdbms/lib/sskrsed.o inflated: rdbms/lib/ssoraed.o inflated: rdbms/lib/sstrced.o inflated: rdbms/lib/strcpt.o inflated: rdbms/lib/ttcoerr.o inflated: rdbms/lib/ttcsoi.o inflated: rdbms/lib/xsnoolap.o inflated: rdbms/lib/genksms.o [root@ora11gdg1 jar_unzip_dir]# [root@ora11gdg1 jar_unzip_dir]# /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/jar xvf /software/database/stage/Components/oracle.rdbms.hybrid/10.2.0.1.0/1/DataFiles/filegroup1.jar inflated: rdbms/lib32/hoaoci.o inflated: rdbms/lib32/hoat.o inflated: rdbms/lib32/hoax.o inflated: rdbms/lib32/homts.o inflated: rdbms/lib32/horm.o inflated: rdbms/lib32/hormc.o inflated: rdbms/lib32/hormd.o inflated: rdbms/lib32/hormt.o inflated: rdbms/lib32/hout.o inflated: rdbms/lib32/hsxaora.o inflated: rdbms/lib32/kopc.o inflated: rdbms/lib32/kpucb.o inflated: rdbms/lib32/s0exudrv.o inflated: rdbms/lib32/s0impdrv.o inflated: rdbms/lib32/s0kudbv.o inflated: rdbms/lib32/s0kuzr.o inflated: rdbms/lib32/sbbdpt.o inflated: rdbms/lib32/shou.o inflated: rdbms/lib32/skrspt.o inflated: rdbms/lib32/ssbbded.o inflated: rdbms/lib32/sskrsed.o inflated: rdbms/lib32/sulmain.o inflated: rdbms/lib32/ttcoerr.o inflated: rdbms/lib32/ttcsoi.o [root@ora11gdg1 jar_unzip_dir]# [root@ora11gdg1 jar_unzip_dir]# pwd /software/jar_unzip_dir [root@ora11gdg1 jar_unzip_dir]# ls -ltr total 4 drwxr-xr-x 5 root root 4096 Apr 7 11:24 rdbms [root@ora11gdg1 jar_unzip_dir]# [root@ora11gdg1 jar_unzip_dir]# ls rdbms/ lib lib32 mesg [root@ora11gdg1 jar_unzip_dir]#
将BBED需要的包移动到单独的目录中:
[root@ora11gdg1 ~]# mkdir /software/bbed_base [root@ora11gdg1 ~]# [root@ora11gdg1 ~]# cp /software/jar_unzip_dir/rdbms/mesg/bbedus.ms* /software/bbed_base/ [root@ora11gdg1 ~]# [root@ora11gdg1 ~]# cp /software/jar_unzip_dir/rdbms/lib/sbbdpt.o /software/bbed_base/ [root@ora11gdg1 ~]# cp /software/jar_unzip_dir/rdbms/lib/ssbbded.o /software/bbed_base/ [root@ora11gdg1 ~]# [root@ora11gdg1 ~]# ls -ltr /software/bbed_base/ total 32 -rw-r--r-- 1 root root 10270 Apr 7 11:26 bbedus.msg -rw-r--r-- 1 root root 8704 Apr 7 11:26 bbedus.msb -rw-r--r-- 1 root root 1863 Apr 7 11:26 sbbdpt.o -rw-r--r-- 1 root root 1191 Apr 7 11:27 ssbbded.o [root@ora11gdg1 ~]#
然后,在需要配置BBED的目标系统上,将他们分别放到特定的目录中:
bbedus.* –> $ORACLE_HOME/rdbms/mesg
sbdpt.o –> $ORACLE_HOME/rdbms/lib
ssbbed.o –> $ORACLE_HOME/rdbms/lib
[root@ora11gdg1 ~]# chown -R oracle.oinstall /software [root@ora11gdg1 ~]# [root@ora11gdg1 ~]# su - oracle [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/mesg | grep bbedus [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/lib | grep sbbdpt [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/lib | grep ssbbed [oracle@ora11gdg1 ~]$ [oracle@ora11gdg1 ~]$ cp /software/bbed_base/bbedus.ms* $ORACLE_HOME/rdbms/mesg [oracle@ora11gdg1 ~]$ cp /software/bbed_base/sbbdpt.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ [oracle@ora11gdg1 ~]$ cp /software/bbed_base/ssbbded.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ [oracle@ora11gdg1 ~]$ [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/mesg | grep bbedus -rw-r--r-- 1 oracle oinstall 10270 Apr 7 11:32 bbedus.msg -rw-r--r-- 1 oracle oinstall 8704 Apr 7 11:32 bbedus.msb [oracle@ora11gdg1 ~]$ [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/lib | grep sbbdpt -rw-r--r-- 1 oracle oinstall 1863 Apr 7 11:32 sbbdpt.o [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/lib | grep ssbbed [oracle@ora11gdg1 ~]$ [oracle@ora11gdg1 ~]$ ls -ltr $ORACLE_HOME/rdbms/lib | grep ssbbded -rw-r--r-- 1 oracle oinstall 1191 Apr 7 11:32 ssbbded.o [oracle@ora11gdg1 ~]$
编译:
[oracle@ora11gdg1 ~]$ cd $ORACLE_HOME/rdbms/lib [oracle@ora11gdg1 lib]$ ls | grep --color bbed [oracle@ora11gdg1 lib]$ [oracle@ora11gdg1 lib]$ ls | grep --color ins_rdbms ins_rdbms.mk [oracle@ora11gdg1 lib]$ [oracle@ora11gdg1 lib]$ make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed Linking BBED utility (bbed) rm -f /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed gcc -o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed -m64 -z noexecstack -L/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/stubs/ /u01/app/oracle/product/11.2.0/dbhome_1/lib/s0main.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ssbbded.o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/sbbdpt.o `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -ldbtools11 -lclntsh `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/11.2.0/dbhome_1/lib -lm `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -ldl -lm -L/u01/app/oracle/product/11.2.0/dbhome_1/lib [oracle@ora11gdg1 lib]$ [oracle@ora11gdg1 lib]$ ls | grep --color bbed bbed [oracle@ora11gdg1 lib]$
这样,就编译好了。
进BBED
默认口令:blockedit
[oracle@ora11gdg1 lib]$ bbed Password: BBED: Release 2.0.0.0.0 - Limited Production on Fri Apr 7 11:51:08 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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] =
查看一下:
BBED> set filename '/u01/app/oracle/oradata/enmy/system01.dbf' FILENAME /u01/app/oracle/oradata/enmy/system01.dbf BBED> show FILE# 0 BLOCK# 1 OFFSET 0 DBA 0x00000000 (0 0,1) FILENAME /u01/app/oracle/oradata/enmy/system01.dbf BIFILE bifile.bbd LISTFILE BLOCKSIZE 8192 MODE Browse EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL No BBED> map File: /u01/app/oracle/oradata/enmy/system01.dbf (0) Block: 1 Dba:0x00000000 ------------------------------------------------------------ Data File Header struct kcvfh, 860 bytes @0 ub4 tailchk @8188 BBED> BBED> p kcvfhbfh struct kcvfhbfh, 20 bytes @0 ub1 type_kcbh @0 0x0b ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x00400001 ub4 bas_kcbh @8 0x00000000 ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x01 ub1 flg_kcbh @15 0x04 (KCBHFCKV) ub2 chkval_kcbh @16 0xf7b1 ub2 spare3_kcbh @18 0x0000 BBED>
——————————————
Done。