文章

Oracle-编译-bbed

Oracle-编译-bbed

前言

记录一下 Oracle 编译 bbed 的过程,方便后续查询

Oracle 11g 编译 bbed

通过 ins_rdbms.mk 编译 bbed ,Oracle 的很多工具都是通过 ins_rdbms.mk 编译的

1
2
3
4
5
6
7
8
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/lib]
└──╼ $ cd $ORACLE_HOME/rdbms/lib
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ ll ins_rdbms.mk
-rw-r--r-- 1 oracle oinstall 40983 Aug 24  2013 ins_rdbms.mk
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ locate ins_rdbms.mk
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk

编译的时候生成的文件必须在$ORACLE_HOME/rdbms/lib/路径下,否则会提示错误,可以在编译完成之后移动位置

1
2
3
4
5
6
7
8
9
┌─[✗]─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/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: error: /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ssbbded.o: No such file or directory
gcc: error: /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 10g 的安装包才提供相关的 ssbbded.o 依赖包,在 10g 之后的版本都没有提供相关的依赖包,所以需要去 Oracle 10g 的安装包中找到相关的依赖包。在这里也可以下载

1
2
3
4
5
6
7
8
9
10
11
12
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ cp /mnt/h/BaiduNetdiskDownload/OraclePackages/编译需要的 10g 依赖包/* .
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ ll /mnt/h/BaiduNetdiskDownload/OraclePackages/编译需要的 10g 依赖包/
total 64
-rwxrwxrwx 1 oracle oinstall  8704 Feb 23 17:53 bbedus.msb
-rwxrwxrwx 1 oracle oinstall 10270 Feb 23 17:53 bbedus.msg
-rwxrwxrwx 1 oracle oinstall  3976 Feb 23 17:53 sbbdpt.o
-rwxrwxrwx 1 oracle oinstall  3306 Feb 23 17:53 ssbbded.o
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $
# 后续发现 bbedus.msb 和 bbedus.msg 文件需要放到 $ORACLE_HOME/rdbms/mesg 目录下

下载好相关的依赖包之后,再次编译就可以了

1
2
3
4
5
6
7
8
9
10
11
12
13
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/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@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ ll bbed
-rwxr-xr-x 1 oracle oinstall 261816 Feb 23 17:56 bbed
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $


默认密码为 blockedit

执行 bbed 报错

1
2
3
4
┌─[✗]─[oracle@TheDarkStar]─[~]
└──╼ $ bbed
Message 112 not found; No message file for product=RDBMS, facility=BBED
BBED-00113: file not found

如果执行 bbed 报错,需要将两个bbedus.ms* 文件放到 $ORACLE_HOME/rdbms/mesg 目录下

参考

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ mv bbedus.ms
bbedus.msb  bbedus.msg
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ mv bbedus.ms* ../mesg/
Display all 203 possibilities? (y or n)
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ mv bbedus.ms* $ORACLE_HOME/rdbms/mesg/
┌─[oracle@TheDarkStar]─[/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]
└──╼ $ bbed ## 密码是 blockedit
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Sun Feb 23 21:29:10 2025

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

BBED> quit
本文由作者按照 CC BY 4.0 进行授权

© TheDarkStarJack. 保留部分权利。

[本站总访问量次] [本站访客数人次] [本文总阅读量次]

本站采用 Jekyll 主题 Chirpy