【BBED】编译及基本命令(1)

【BBED】编译及基本命令(1)

一.1  BLOG文档结构图

 

 

 

一.2  前言部分

 

一.2.1  导读和注意事项

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① BBED的安装(编译)

② BBED的基本命令

 

  Tips:

       ① 若文章代码格式有错乱,推荐使用搜狗、QQ或360浏览器,也可以下载pdf格式的文档来查看,pdf文档下载地址:http://yunpan.cn/cdEQedhCs2kFz (提取码:ed9b) 

       ② 本篇BLOG中命令的输出部分需要特别关注的地方我都用灰色背景和粉红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方;而命令一般使用黄色背景和红色字体标注;对代码或代码输出部分的注释一般采用蓝色字体表示。

 

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

  ---- ------- ---------- ------------------- ---------- ---------

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

 

 

[ZFXXDB1:root]:/>lsvg -o

T_XDESK_APP1_vg

rootvg

[ZFXXDB1:root]:/>

00:27:22 SQL> alter tablespace idxtbs read write;

 

 

====》2097152*512/1024/1024/1024=1G 

 

 

 

 

 

本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。

 

 

 

一.2.2  相关参考文章链接

 

完整内容参考David Dai的blog:http://blog.csdn.net/tianlesoftware/article/details/5006580#

 

 

一.3  我的一个编译例子

 

 [email protected]:/oracle$ ls -l  $ORACLE_HOME/rdbms/lib/*sbbd*

-rw-r--r--    1 oracle   dba            1671 May 26 2010  /oracle/app/oracle/product/10.2.0/db/rdbms/lib/sbbdpt.o

-rw-r--r--    1 oracle   dba             900 May 26 2010  /oracle/app/oracle/product/10.2.0/db/rdbms/lib/ssbbded.o

[email protected]:/oracle$ ls -l  $ORACLE_HOME/rdbms/mesg/bbed*

-rw-r--r--    1 oracle   dba            8704 May 27 2010  /oracle/app/oracle/product/10.2.0/db/rdbms/mesg/bbedus.msb

-rw-r--r--    1 oracle   dba           10270 Jul 25 2000  /oracle/app/oracle/product/10.2.0/db/rdbms/mesg/bbedus.msg

[email protected]:/oracle$

 

[email protected]:/oracle$ scp $ORACLE_HOME/rdbms/lib/*sbbd* [email protected]:/oracle/app/oracle/product/11.2.0/db/rdbms/lib/

The authenticity of host ‘22.188.194.64 (22.188.194.64)‘ can‘t be established.

RSA key fingerprint is 17:0d:6f:34:a8:0b:15:20:ca:ab:35:83:58:bb:aa:4f.

Are you sure you want to continue connecting (yes/no)?yes

Warning: Permanently added ‘22.188.194.64‘ (RSA) to the list of known hosts.

************************************************************

*                                                          *

*                                                          *

*     ATTENTION:You have logged onto a secured server.     *

*                                                          *

*     All accesses logged!                                 *

*                                                          *

*                                                          *

************************************************************

[email protected]‘s password:

sbbdpt.o                                                                                                                             100% 1671     1.6KB/s   00:00   

ssbbded.o                                                                                                                            100%  900     0.9KB/s   00:00   

[email protected]:/oracle$  scp $ORACLE_HOME/rdbms/mesg/bbed* [email protected]:/oracle/app/oracle/product/11.2.0/db/rdbms/mesg/

************************************************************

*                                                          *

*                                                          *

*     ATTENTION:You have logged onto a secured server.     *

*                                                          *

*     All accesses logged!                                 *

*                                                          *

*                                                          *

************************************************************

[email protected]‘s password:

bbedus.msb                                                                                                                           100% 8704     8.5KB/s   00:00   

bbedus.msg                                                                                                                           100%   10KB  10.0KB/s   00:00   

[email protected]:/oracle$

[[email protected]:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]$ cd $ORACLE_HOME/rdbms/lib

[[email protected]:/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

        ld -b64 -o /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/bbed -L/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/ /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 -bI:/usr/lib/aio.exp `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11   -ldbtools11  `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 -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 -lpls11  -lrt  -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  -lld -lm `cat /u01/app/oracle/product/11.2.0/dbhome_1/lib/sysliblist`  -lm   -lsql11  /u01/app/oracle/product/11.2.0/dbhome_1/lib/nautab.o /u01/app/oracle/product/11.2.0/dbhome_1/lib/naeet.o /u01/app/oracle/product/11.2.0/dbhome_1/lib/naect.o /u01/app/oracle/product/11.2.0/dbhome_1/lib/naedhs.o

ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait_timeout64

ld: 0711-224 WARNING: Duplicate symbol: aio_nwait_timeout64

ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait64

ld: 0711-224 WARNING: Duplicate symbol: aio_nwait64

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

ld: 0711-773 WARNING: Object /u01/app/oracle/product/11.2.0/dbhome_1/lib//libgeneric11.a[sdbgrfu.o], imported symbol timezone

        Symbol was expected to be local. Extra instructions

        are being generated to reference the symbol.

[[email protected]:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]$

[[email protected]:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib]$ bbed

Password:

 

BBED: Release 2.0.0.0.0 - Limited Production on Wed Mar 23 11:12:18 2016

 

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

 

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

 

BBED>

 

一.4  我的命令

ls -l  $ORACLE_HOME/rdbms/lib/*sbbd*

ls -l  $ORACLE_HOME/rdbms/mesg/bbed*

chown oracle:dba /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/*sbbd*

chown oracle:dba /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg/bbed*

 

--cd $ORACLE_HOME/rdbms/lib

--make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

--make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed

 

 

 

一.5  总结

 

11g以下可以直接编译使用,11g及以后需要从相应平台的10g中拷贝4个文件到11g相应目录,如下,bbedar.msb可以不用拷贝。然后执行编译命令即可,编译的bbed命令可以直接生成在$ORACLE_HOME/bin下,命令为:make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed

 

$ORACLE_HOME/rdbms/lib/ssbbded.o

$ORACLE_HOME/rdbms/lib/sbbdpt.o

$ORACLE_HOME/rdbms/mesg/bbedus.msb

$ORACLE_HOME/rdbms/mesg/bbedus.msg

$ORACLE_HOME/rdbms/mesg/bbedar.msb

 

 

------------------------以下是摘自网络内容---------------------------

第二章  BBED 的安装和使用

       The name bbed is an acronym for Block Browser and Editor and it is shipped with thedatabase. It is intended for Oracle internal use only and the company neverpublishes any details about it. It is a very powerful tool but also extremelydangerous since it can change and/or corrupt data blocks of any Oracledatabase.

       Ifyou use this tool, you do so at your own risk. Any modifications made with thistool render the database unsupported by Oracle.

        BBED(Oracle Block Browerand EDitor Tool),用来直接查看和修改数据文件数据的一个工具,是Oracle一款内部工具,可以直接修改Oracle数据文件块的内容,在一些极端恢复场景下比较有用。该工具不受Oracle支持,所以默认是没有生成可执行文件的,在使用前需要重新连接。

     虽然bbed 可以在db open 状态来进行修改,但是建议在做任何修改操作之前先shutdown db。 这样避免checkpoint 进程重写bbed 对block 的修改。 也避免oracle 在bbed 修改完成之前读block 或者申明block 为corrupt。

 

二.1  BBED 安装

       Oracle8i 的BBED在windows 平台下的$ORACLE_HOME/bin下可以找到,9i中似乎未随软件发布,故在windows没有这个工具,在linux上面有,需要编译。

二.1.1  9i或10g中

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

[[email protected] dul]$ cd $ORACLE_HOME/rdbms/lib

[[email protected] lib]$ make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

Linking BBED utility (bbed)

rm -f /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/bbed

gcc -o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/bbed -L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/stubs/  /u01/app/oracle/product/10.2.0/db_1/lib/s0main.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ssbbded.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sbbdpt.o `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o -ldbtools10 -lclntsh  `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/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 /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/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 /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/10.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/10.2.0/db_1/lib

 

然后把这个路径添加到环境变量,注意:aix下为 ~/.profile文件:

cd ~

vi .bash_profile 

export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/jdk/bin:$ORACLE_HOME/rdbms/lib

 

source ~/.bash_profile

[email protected]:/oracle$ .  ~/.profile

[email protected]:/oracle$ bbed

Password:

 

BBED: Release 2.0.0.0.0 - Limited Production on Fri Sep 30 10:42:45 2022

 

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

 

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

 

BBED>

       以上生成的bbed可执行文件在$ORACLE_HOME/rdbms/lib目录,可以复制到其他位置或者其他同Oracle版本的机器上运行。

也可通过以下命令将bbed生成到$ORACLE_HOME/bin目录

[[email protected] lib]$ make -f ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed

 

Linking BBED utility (bbed)

rm -f /u01/app/oracle/product/10.2.0/db_1/bin/bbed

gcc -o/u01/app/oracle/product/10.2.0/db_1/bin/bbed-L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/-L/u01/app/oracle/product/10.2.0/db_1/lib/-L/u01/app/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /u01/app/oracle/product/10.2.0/db_1/lib/s0main.o/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ssbbded.o/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sbbdpt.o `cat/u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o-ldbtools10 -lclntsh  `cat/u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lnro10 `cat/u01/app/oracle/product/10.2.0/db_1/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 /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lnro10 `cat/u01/app/oracle/product/10.2.0/db_1/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/u01/app/oracle/product/10.2.0/db_1/lib/sysliblist`-Wl,-rpath,/u01/app/oracle/product/10.2.0/db_1/lib -lm    `cat/u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/10.2.0/db_1/lib

 

[[email protected] lib]$ ls -lrt bbed

-rwxr-xr-x 1 oracle oinstall 536161 Aug 1118:30 bbed

[[email protected] lib]$ cd $ORACLE_HOME/bin

[[email protected] bin]$ ls -lrt bbed

-rwxr-xr-x 1 oracle oinstall 536161 Aug 11 18:33bbed

 

二.1.2  11g及以上

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

[[email protected]_lhr ~]$ cd $ORACLE_HOME/rdbms/lib

[[email protected]_lhr 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 -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

 

AIX下:

[ZFXDESKDB1:oracle]:/oracle>cd $ORACLE_HOME/rdbms/lib

[ZFXDESKDB1:oracle]:/oracle/app/oracle/product/11.2.0/db/rdbms/lib>make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

Linking BBED utility (bbed)

        rm -f /oracle/app/oracle/product/11.2.0/db/rdbms/lib/bbed

        ld -b64 -o /oracle/app/oracle/product/11.2.0/db/rdbms/lib/bbed -L/oracle/app/oracle/product/11.2.0/db/rdbms/lib/ -L/oracle/app/oracle/product/11.2.0/db/lib/ /oracle/app/oracle/product/11.2.0/db/lib/s0main.o /oracle/app/oracle/product/11.2.0/db/rdbms/lib/ssbbded.o /oracle/app/oracle/product/11.2.0/db/rdbms/lib/sbbdpt.o -bI:/usr/lib/aio.exp `cat /oracle/app/oracle/product/11.2.0/db/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11   -ldbtools11  `cat /oracle/app/oracle/product/11.2.0/db/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /oracle/app/oracle/product/11.2.0/db/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lztkg11 -lclient11 -lnnetd11  -lvsn11  -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11  -lcore11 -lsnls11  -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11  -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /oracle/app/oracle/product/11.2.0/db/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /oracle/app/oracle/product/11.2.0/db/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11  -lvsn11  -lcommon11 -lgeneric11 -lpls11  -lrt  -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  -lld -lm `cat /oracle/app/oracle/product/11.2.0/db/lib/sysliblist`  -lm   -lsql11  /oracle/app/oracle/product/11.2.0/db/lib/nautab.o /oracle/app/oracle/product/11.2.0/db/lib/naeet.o /oracle/app/oracle/product/11.2.0/db/lib/naect.o /oracle/app/oracle/product/11.2.0/db/lib/naedhs.o

ld: 0706-005 Cannot find or open file: /oracle/app/oracle/product/11.2.0/db/rdbms/lib/ssbbded.o

        ld:open(): A file or directory in the path name does not exist.

ld: 0706-005 Cannot find or open file: /oracle/app/oracle/product/11.2.0/db/rdbms/lib/sbbdpt.o

        ld:open(): A file or directory in the path name does not exist.

make: 1254-004 The error code from the last command is 255.

 

 

 

Stop.

 

 

需要从10g里面考:

sz $ORACLE_HOME/rdbms/lib/ssbbded.o

sz $ORACLE_HOME/rdbms/lib/sbbdpt.o

sz $ORACLE_HOME/rdbms/mesg/bbedus.msb

sz $ORACLE_HOME/rdbms/mesg/bbedus.msg

sz $ORACLE_HOME/rdbms/mesg/bbedar.msb

考出来。

 

su – oracle

export ORACLE_SID=PROD

pwd

 

 

选administrator下的下载。窗口一定要在/home/oracle路径下(不能在上面的窗口)。

 

 

点击添加和确定。

 

 

cp bbedus.msb $ORACLE_HOME/rdbms/mesg

cp bbedus.msg $ORACLE_HOME/rdbms/mesg

cp *.o $ORACLE_HOME/rdbms/lib

再次执行:

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

 

搞定。

cd /home/oracle

vi .bash_profile

export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/jdk/bin:/u01/app/oracle/product/11.2.0/db_1/rdbms/lib

 

source /home/oracle/.bash_profile

 

 

 

二.3  使用BBED

       一般使用bbed,都是将一些配置信息写入到一个参数文本里,在调用bbed时,指定该参数文件。如:

       $bbed parfile=bbed.par

bbed help=y

 

 

这里我们先演示一个示例。

(1)先获取datafile 的信息

       将datafile 的信息写入一个文件,格式为:文件编号  文件名字 文件大小。可以通过如下SQL   获取:

set line 9999 pagesize 9999

select file#||‘ ‘||name||‘ ‘||bytes from v$datafile;

 

       注意,这里的file id。 我们这里的file id 和 oracle 系统内部的file id 相同。 当然这个id 我们也可以自己指定。 当我们在bbed 里设置file id 时,就是根据这个参数文件中的的设置来的。 最好设置为相同,不然以后可能会混淆。

 

将上面查询出来的datafile信息保存到文本里。

 cd /home/oracle

vi file.txt

1 /u01/app/oracle/oradata/PROD/disk3/system01.dbf 340787200

2 /u01/app/oracle/oradata/PROD/disk4/sysaux01.dbf 340787200

3 /u01/app/oracle/oradata/PROD/disk5/undotbs01.dbf 209715200

4 /u01/app/oracle/oradata/PROD/disk3/users01.dbf 524288000

5 /u01/app/oracle/oradata/PROD/disk3/cuug01.dbf 52428800

 

vi bbed.par

blocksize=8192

listfile=/home/oracle/file.txt

mode=edit

 

source /home/oracle/.bash_profile

bbed parfile=/home/oracle/bbed.par

blockedit

 

BBED是Oracle 内部使用的命令,所以Oracle 不提供技术支持。 为了安全,BBED设置了口令保护,默认密码为blockedit。

show

 

如果没有设置参数文件,显示:

 

 

------------------------以上是摘自网络内容---------------------------

 

About Me

 

...........................................................................................................................................................................................

本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

ITPUB BLOG:http://blog.itpub.net/26736162

本文地址:http://blog.itpub.net/26736162/viewspace-2075216/

本文pdf版:http://yunpan.cn/cdEQedhCs2kFz (提取码:ed9b)

QQ:642808185 若加QQ请注明您所正在读的文章标题

于 2016-04-04 10:00~ 2016-04-04 19:00 在唐镇完成

<版权所有,文章允许转载,但须以链接方式注明源地址,否则追究法律责任!>

...........................................................................................................................................................................................

时间: 2024-08-02 16:36:17

【BBED】编译及基本命令(1)的相关文章

使用bbed编辑研究oracle数据块结构

bbed是随oracle软件发布的一款数据块查看和编辑工具,作为一款内部工具,bbed的功能非常强大,但是如果使用不当可能给数据库造成无法挽回的损失.因此.我们建议在使用bbed修改数据块前备份被修改的数据文件,并且在成功修复数据块后立即将数据库数据导出,并新建数据库. 编辑并使用bbed 首次使用bbed前必须要经过链接编译.编译方法如下: [[email protected] lib]$ make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed Lin

小麦苗微信公众号文章链接地址

小麦苗的微信公众号文章链接地址: 发布日期 文章标题 2016-08-14 [等待事件]User I/O类 等待事件(2.1)--db file sequential read(数据文件顺序读) 2016-08-13 [等待事件]等待事件概述(1)--等待事件的源起和分类 2016-08-12 [故障处理]ORA-12545: Connect failed because target host 2016-08-11 [故障解决]ORA-06502: PL/SQL: numeric or val

Linux 2.6内核Makefile浅析【转】

转自:http://blog.csdn.net/tommy_wxie/article/details/7280463 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 概述 kbuild文件 1 obj-y和obj-m 11 obj-y生成built-ino 12 目标由多个源文件编译得到 13 调用子目录Makefile 2 lib-y和lib-m 3 编译选项变量 31 ccflags-yasflags-yldflags-y 32 subdir-ccflags-ysub

Linux 2.6内核Makefile浅析

1 概述 Makefile由五个部分组成: Makefile:根目录Makefile,它读取.config文件,并负责创建vmlinux(内核镜像)和modules(模块文件). .config:内核配置文件(一般由make menuconfig生成). arch/$(ARCH)/Makefile:目标处理器的Makefile. scripts/Makefile.*:所有kbuild Makefile的规则,它们包含了定义/规则等. kbuild Makefiles:每个子目录都有kbuild

Makefile实例

A stupid man think himself is clever. A clever think himself is stupid. Make基础 先上脚本: COMPILE = g++ FLAGS = -std=c++11 -g target = epollserver objs = client.o clientmanager.o main.o savetomysql.o threadable.o libs = -L -lpthread -L/usr/lib/x86_64-linu

Oracle 11g 编译使用BBED

环境:RHEL 6.4 + Oracle 11.2.0.4 1. 拷贝缺失文件 2. 编译BBED 3. BBED使用测试 Reference 1. 拷贝缺失文件 11g中缺失几个相关文件,但我们实际可以从10g拷贝相关文件到11g对应目录下: $ORACLE_HOME/rdbms/lib/sbbdpt.o $ORACLE_HOME/rdbms/lib/ssbbded.o $ORACLE_HOME/rdbms/mesg/bbedus.msb $ORACLE_HOME/rdbms/mesg/bbe

11.2.0.4 linux 6.3下编译bbed

本文借鉴自:http://blog.csdn.net/inthirties/article/details/5558030 环境: Oracle db 11.2.0.4,rhel 6.3 x86-64bit 在11.2.0.4(确切的说是11gR2)下编译bbed所需要的下列文件: sbbdpt.o 来源于:rhel5.8 x86-64bit下的Oracle db 10.2.0.5的$ORACLE_HOME/lib ssbbded.o 来源于:rhel5.8 x86-64bit下的Oracle

【BBED】bbed常用命令

[BBED]bbed常用命令         一.1  相关知识点扫盲 BBED(Oracle Block Browerand EDitor Tool),用来直接查看和修改数据文件数据的一个工具,是Oracle一款内部工具,可以直接修改Oracle数据文件块的内容,在一些极端恢复场景下比较有用.该工具不受Oracle支持,所以默认是没有生成可执行文件的,在使用前需要重新连接.   一.1.1  我的编译代码 ls -l  $ORACLE_HOME/rdbms/lib/*sbbd* ls -l 

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版本