通过BBED修复UNDO文件头坏块过程比较复制,并且BBED工具并不对外公开,也不提供技术支持,使用过程中很容易出现问题,建议在正式环境尽量避免使用BBED工具;
可以通过下面网站查看具体修改过程;
BBED工具的安装
Oracle 11g版本和以后的版本已经不提供bbed工具了,11g数据库如果需要使用bbed工具,可以拷贝10g或之前版本数据库上的三个文件:
[oracle11@primary ~]$ ll -rth bbed_install/
total 20K
-rw-r--r-- 1 root root 8.5K Sep 8 2012 bbedus.msb
-rw-r--r-- 1 root root 1.9K Sep 8 2012 sbbdpt.o
-rw-r--r-- 1 root root 1.2K Sep 8 2012 ssbbded.o
将文件拷贝到指定目录
[oracle11@primary ~]$ cp /home/oracle11/bbed_install/bbedus.msb /u02/app/oracle/
product/11.2.0/rdbms/mesg/
[oracle11@primary ~]$ cp /home/oracle11/bbed_install/ssbbded.o /u02/app/oracle/product/11.2.0/rdbms/lib/
[oracle11@primary ~]$ cp /home/oracle11/bbed_install/sbbdpt.o /u02/app/oracle/product/11.2.0/rdbms/lib/
编译
[oracle11@primary ~]$ make -f /u02/app/oracle/product/11.2.0/rdbms/lib/ins_rdbms
.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
bbed默认密码"blockedit"
[oracle11@primary ~]$ bbed
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Sat Jul 30 14:22:17 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED>
使用BBED工具之前需要创建filelist文件
SQL> set linesize 100
SQL> col name for a45
SQL> spool /home/oracle11/filelist.txt
SQL> select file#,name,bytes from v$datafile order by 1;
FILE# NAME BYTES
---------- --------------------------------------------- ----------
1 /u02/app/oracle/oradata/orcl11/system01.dbf 775946240
2 /u02/app/oracle/oradata/orcl11/sysaux01.dbf 545259520
3 /u02/app/oracle/oradata/orcl11/undotbs01.dbf 73400320
4 /u02/app/oracle/oradata/orcl11/users01.dbf 5242880
5 /u02/app/oracle/oradata/orcl11/chen01.dbf 1048576
SQL> spool off
[oracle11@primary ~]$ touch bbed.par
[oracle11@primary ~]$ vim bbed.par
blocksize=8192
listfile=/home/oracle11/filelist.txt
mode=edit
[oracle11@primary ~]$ bbed parfile=bbed.par
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Sat Jul 30 14:36:34 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> show
FILE# 1
BLOCK# 1
OFFSET 0
DBA 0x00400001 (4194305 1,1)
FILENAME /u02/app/oracle/oradata/orcl11/system01.dbf
BIFILE bifile.bbd
LISTFILE /home/oracle11/filelist.txt
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No