暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
ORACLE_bbed_五个试用教程.doc
36
27页
5次
2024-10-10
10墨值下载
在之前的
blog
里介绍了
BBED
工具的语法部分。
参考:
Oracle BBED
工具
说明
http://blog.csdn.net/tianlesoftware/article/details/5006580
在这篇主要看一下
BBED
工具的几个使用示例。
Althoughbbed can modify data in the data files of an open Oracle database, it
isadvisable to shut down the database before making any changes. This avoids
thecheckpoint process overwriting the changes made with bbed from the Oracle
blockcache. It also avoids Oracle reading the block before the modifications arecomplete
and declaring the block corrupt.
虽然
bbed
可以在
db open
状态来进行修改,但是建议在做任何修改操作之前先
shutdown db
这样避免
checkpoint
进程重写
bbed
block
的修改。
也避免
oracle
bbed
修改完成之前读
block
或者申明
block
corrupt
Important:Using bbed to modify the contents of an Oracle data block renders the
dataun-supported by Oracle. These examples should be used for educational
purposesonly. If they are used on real production databases they should only be used
asa last resort and once the immediate problem has been resolved, all retrievabledata
should be exported and a new database created.
bbed
工具不受
Oracle
的技术支持。
Although bbed can be used to open a database that would otherwise be beyond
salvaging,the DBA must bear in mind that the internal tables such as OBJ$, UET$ and
FET$may no longer match the contents of the data blocks. The behavior of thedatabase
will therefore be unpredictable and ORA-600 errors are likely.
.
示例:
修改
Data
内容
1.1
连接
bbed
[oracle@db2 ~]$ bbed parfile=/u01/bbed.par
Password:
BBED: Release 2.0.0.0.0 - LimitedProduction on Fri Aug 12 18:26:46 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
************* !!! For Oracle Internal Useonly !!! ***************
BBED>
1.2
查看要修改的内容
SYS@dave2(db2)> select * from dvd;
JOB
--------------------------------------------------------------------------------
Dave is DBA!
Dave like Oracle!
注意:
bbed
的修改仅仅是对原有位置内容的一个替换。
对应
block
的信息如下:
SYS@dave2(db2)> select rowid,dbms_rowid.rowid_relative_fno(rowid)rel_fno,
dbms_rowid.rowid_block_number(rowid)blockno,
dbms_rowid.rowid_row_number(rowid) rowno
from t1;
ROWID REL_FNO BLOCKNO ROWNO
------------------ ---------- --------------------
AAAN9VAABAAAcKiAAA 1 115362 0
AAAN9VAABAAAcKiAAB 1 115362 1
SYS@dave2(db2)>
1.3
查找关键字
Dave
,确定其在
block
中的偏移量
offset
BBED> set dba 1,115362 offset 0
DBA 0x0041c2a2(4309666 1,115362)
OFFSET 0
BBED> find /c Dave
File:/u01/app/oracle/oradata/dave2/system01.dbf (1)
Block: 115362 Offsets: 8176 to 8191 Dba:0x0041c2a2
------------------------------------------------------------------------
44617665 20697320 44424121 020616b3
<32 bytes per line>
dump
查看具体内容:
BBED> dump /v dba 1,115362 offset 8176count 128
File: /u01/app/oracle/oradata/dave2/system01.dbf(1)
Block: 115362 Offsets: 8176 to 8191 Dba:0x0041c2a2
-------------------------------------------------------
44617665 20697320 44424121 020616b3 l Dave isDBA!...³
<16 bytes per line>
注意这里面的
Offsets:8176 to 8191
它指的是这一行的一个地址。其中
D
offset
8176
a
offset
8177
v
offset
8178
e
offset
8179
空格也算
offset
1.4
修改
block
,将
Dave
换成
DMM
BBED> modify /c 'DMM ' dba 1,115362offset 8176
File:/u01/app/oracle/oradata/dave2/system01.dbf (1)
Block: 115362 Offsets: 8176 to 8191 Dba:0x0041c2a2
------------------------------------------------------------------------
444d4d20 20697320 44424121 020616b3
<32 bytes per line>
--
注意这里
DMM
我用单引号括起来,并且最后还有一个空格,这样就是
4
bytes
,不用
单引号括起来,无法表示空格,验证一下
BBED> dump /v dba 1,115362 offset 8176count 128
File:/u01/app/oracle/oradata/dave2/system01.dbf (1)
Block: 115362 Offsets: 8176 to 8191 Dba:0x0041c2a2
-------------------------------------------------------
444d4d20 20697320 44424121 020616b3 l DMM is DBA!...³
<16 bytes per line>
1.5
应用变更
BBED> sum dba 1,115362
Check value for File 1, Block 115362:
current = 0xdef7, required = 0x8cc0
此时
current checksum
0xdef7
requiredchecksum
0x8cc0
BBED> sum dba 1,115362 apply
Check value for File 1, Block 115362:
current = 0x8cc0, required = 0x8cc0
加上
apply
参数,使
checksum
一致。即之前的修改生效。
SYS@dave2(db2)> alter system flush buffer_cache;
System altered.
of 27
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。