bbed工具安装
1、上传bbedus.msb bbedus.msg sbbdpt.o ssbbded.o四个文件到数据库服务器
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ ll
total 36
-rw-r--r-- 1 oracle oinstall 8704 Oct 20 2013 bbedus.msb
-rw-r--r-- 1 oracle oinstall 10270 Oct 20 2013 bbedus.msg
-rw-r--r-- 1 oracle oinstall 3043 Oct 20 2013 sbbdpt.o
-rw-r--r-- 1 oracle oinstall 2721 Oct 20 2013 ssbbded.o
2、将以上四个文件复制到相应目录
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ cp ssbbded.o $ORACLE_HOME/rdbms/lib
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ cp sbbdpt.o $ORACLE_HOME/rdbms/lib
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ cp bbedus.msb $ORACLE_HOME/rdbms/mesg
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ cp bbedus.msg $ORACLE_HOME/rdbms/mesg
3、编译安装
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
Linking BBED utility (bbed)
rm -f /u01/app/oracle/product/11.2.0/dbhome_1/bin/bbed
/usr/bin/gcc -m32 -o /u01/app/oracle/product/11.2.0/dbhome_1/bin/bbed -m32 -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/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/ -lirc -lipgo /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 -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
4、扩展
bbed的密码为blockedit,为方便使用,我们还可以进行以下步骤。
vi par.txt
blocksize=8192
listfile=filelist.txt
mode=edit
列出文件:
SQL> select file#||chr(9)||name||chr(9)||bytes from v$datafile;
FILE#||CHR(9)||NAME||CHR(9)||BYTES
--------------------------------------------------------------------------------
1 /u01/app/oracle/oradata/ORCL/system01.dbf 786432000
2 /u01/app/oracle/oradata/ORCL/sysaux01.dbf 545259520
3 /u01/app/oracle/oradata/ORCL/undotbs01.dbf 319815680
4 /u01/app/oracle/oradata/ORCL/users01.dbf 5242880
5 /u01/app/oracle/oradata/ORCL/test01.dbf 524288000
编辑filelist.txt文件:
1 /u01/app/oracle/oradata/ORCL/system01.dbf 786432000
2 /u01/app/oracle/oradata/ORCL/sysaux01.dbf 545259520
3 /u01/app/oracle/oradata/ORCL/undotbs01.dbf 319815680
4 /u01/app/oracle/oradata/ORCL/users01.dbf 5242880
5 /u01/app/oracle/oradata/ORCL/test01.dbf 524288000
设置bbed命令工具别名:
vi .bash_profile
alias bbed='bbed parfile=par.txt password=blockedit'
这样就可以输入bbed直接登录,而不需要再输入密码,列出数据文件。
[oracle@edgzrip1-PROD1 bbed_10g_src_x32]$ bbed
BBED: Release 2.0.0.0.0 - Limited Production on Sat Nov 7 01:57:29 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> info
File# Name Size(blks)
----- ---- ----------
1 /u01/app/oracle/oradata/ORCL/system01.dbf 96000
2 /u01/app/oracle/oradata/ORCL/sysaux01.dbf 66560
3 /u01/app/oracle/oradata/ORCL/undotbs01.dbf 39040
4 /u01/app/oracle/oradata/ORCL/users01.dbf 640
5 /u01/app/oracle/oradata/ORCL/test01.dbf 64000