1.BBED的安装
oracle 11g中缺bbed包,oracle11g bbed install and example
1.上传(sbbdpt.o ssbbded.o bbedus.msb,该三个文件拷贝oracle的linux64版本的)文件
$ORACLE_HOME/rdbms/lib/ssbbded.o
$ORACLE_HOME/rdbms/lib/sbbdpt.o
$ORACLE_HOME/rdbms/mesg/bbedus.msb
执行如下命令:
cd $ORACLE_HOME/rdbms/lib
make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
2.进入BBED
bbed
blockedit
$vi par.txt
blocksize=8192
listfile=filelist.txt
mode=edit
$vi filelist.txt
select file#||chr(9)||name||chr(9)||bytes from v$datafile;
1 /u01/app/oracle/oradata/ocp/system01.dbf 512000000
2 /u01/app/oracle/oradata/ocp/sysaux01.dbf 412000000
3 /u01/app/oracle/oradata/ocp/users01.dbf 215000000
bbed parfile=par.txt
blockedit
3.常用命令:set、 find、 dump、 modify 、sum apply、examine、map 、print、 verity
(1)set file 3 block 32
set dba 0x01000020
set offset 0 --0表示第一个字节开始
set block 1 --1表示第一个块开始
set count 8192 --默认是显示512字节
(2)find /x 05d67g --查指定的字符串在指定数据块中的具体位置
f --find的简写,表示继续从当前位置开始往下查询字符串05d67g
(3)dump --十六进制查看block
dump /v --查看十六进制内容的同时以文本方式“翻译”十六进制显示的内容,相当于对当前block执行strings命令
(4)modify /x d43 --修改指定block,指定offset的数据块块内记录的内容
(5)sum apply --计算修改后的数据块的checksum值,然后写入数据块的offset为16-17的位置
(6) map
map /v
p kcbh
p ktbbh
p kdbh
p kdbt
p kcvfh
p kcvfh.kcvfhrfn
p kcvfh.kcvfhckp
p *kdbr[0] --第一行记录
x /rnc -examine /read number char 用16进制翻译成我们能看懂的文件
二、使用BBED跳过归档
1.查文件号与scn
select file#,checkpoint_change# from v$datafile;
3 2951615
select file#,checkpoint_change# from v$datafile_header;
3 2951615
2.对3号文件rman备份
backup datafile 3 format '/backup/datafile4_%U';
3.切日志
alter system switch logfile;
4.3号文件离线
alter database datafile 3 offline;
5.还原3号文件
restore datafile 3;
6.报错,需要恢复
alter database datafile 3 online;
7.不要恢复
recover datafile 3;
8.dump文件头
alter session set events 'immediate trace name file_hdrs level 10';
Checkpointed at scn: 0x0000.003af414 09/27/2012 13:00:06
thread:1 rba:(0x4.2.10)
9.缺归档
rm -rf /arch/*
10.修改scn
Checkpointed at scn: 0x0000.0013cfd5 09/27/2012 13:00:06
修改rba
thread:1 rba:(0x5.1b.10)
11.用bbed修改(rba)--struct kcvcprba
select GROUP#,SEQUENCE#,STATUS from v$log;
bbed parfile=par.txt
show all
set filename '/u01/app/oracle/oradata/ocp/tp1.dbf'
set file 4 block 1
dump
p kcvfh
set offset 500
dump
modify /x 16000000
set offset 4
modify /x 10000000
set offset 0
dump
sum apply
12.用bbed修改(scn)--ub4 kscnbas
select group#,SEQUENCE#,status,to_char(first_change#,'xxxxxxxxx') from v$log;
--select file#,name,checkpoint_change#,to_char(checkpoint_change#,'xxxxxxxx') from v$datafile_header;
113930 --> 303911
select sequence#,first_change#,next_change#,to_char(first_change#,'xxxxxxxxx') from v$log_history order by 1;
13d013 -->
dump
p kcvfh
set offset 484
dump
modify /x 9c3911
sum apply
13.恢复
recover datafile 3;
alter database datafile 3 online;
**********本博客所有内容均为原创,如有转载请注明作者和出处!!!**********
Name: guoyJoe
QQ: 252803295
Email: oracledba_cn@hotmail.com
Blog: http://blog.csdn.net/guoyJoe
ITPUB: http://www.itpub.net/space-uid-28460966.html
OCM: http://education.oracle.com/education/otn/YGuo.HTM
_____________________________________________________________
加群验证问题:哪些SGA结构是必需的,哪些是可选的?否则拒绝申请!!!
答案在:http://blog.csdn.net/guoyjoe/article/details/8624392
DSI&Core Search(QQ群):127149411