BBED> find /x 41414141
File: /disk2/oradata/sydb/tbs03.dbf (0)
Block: 135 Offsets: 8184 to 8191 Dba:0x00000000
------------------------------------------------------------------------
41414141 01061aa9
修改值(mode 必须为edit):
MODIFY[/x|d|u|o|c] numeric/character string
通过已知的文件号7,block 135,offset把AAAA的值修改为ABCE
BBED> modify /c ABCE file 7 block 135 offset 8184
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y
File: /disk2/oradata/sydb/tbs03.dbf (7)
Block: 135 Offsets: 8184 to 8191 Dba:0x01c00087
------------------------------------------------------------------------
41424345 0106abba
提交修改:
SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ]
BBED> sum apply
Check value for File 7, Block 135:
current = 0xbe37, required = 0xbe37
验证数据块:
VERIFY [ DBA | FILE | FILENAME | BLOCK ]
BBED> verify
DBVERIFY - Verification starting
FILE = /disk2/oradata/sydb/tbs03.dbf
BLOCK = 135
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
Message 531 not found; product=RDBMS; facility=BBED
验证数据的修改,注:应该在数据库关闭时使用bbed修改数据块,因为当数据库运行时,数据块可能被修改覆盖,这里只是做为测试,并没有其它任何dml或其它操作,当bbed修改数据块并物理保存后,在内存中的数据块并没有刷新,所以此时查询到的数据依然是旧数据:
SQL> column dump format a60
SQL> select name,dump(name,16)dump from tt1;
NAME DUMP
------------------------------ ------------------------------------------------------------
AAAA Typ=1 Len=4: 41,41,41,41
BBBB Typ=1 Len=4: 42,42,42,42
清理buffer_cache和share_pool 触发物理读,数据正确:
SQL>alter system flush buffer_cache;
System altered.
Elapsed: 00:00:00.93
SQL>alter system flush shared_pool;
System altered.
SQL> select name,dump(name,16)dump from tt1;
NAME DUMP
------------------------------ ------------------------------------------------------------
ABCE Typ=1 Len=4: 41,42,43,45
BBBB Typ=1 Len=4: 42,42,42,42
撤销操作:
REVERT [ DBA | FILE | FILENAME | BLOCK ]
撤销当前会话所有操作:
BBED> revert
All changes made in this session will be rolled back. Proceed? (Y/N) y
Reverted file '/disk2/oradata/sydb/tbs03.dbf', block 135
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
选择文件和数据块撤销:
BBED> revert dba 7,135
撤销当前会话上一个操作:
UNDO
当前值:
SQL> select name,dump(name,16)dump from tt1;
NAME DUMP
------------------------------ ----------------------------------------
DFCA Typ=1 Len=4: 44,46,43,41
BBBB Typ=1 Len=4: 42,42,42,42
BBED> modify /c ibmc dba 7,135 offset 8184
File: /disk2/oradata/sydb/tbs03.dbf (7)
Block: 135 Offsets: 8184 to 8191 Dba:0x01c00087
------------------------------------------------------------------------
69626d63 0106abba
BBED> sum apply
Check value for File 7, Block 135:
current = 0xa93a, required = 0xa93a
确认值:
SQL> alter system flush shared_pool;
SQL> alter system flush buffer_cache;
SQL> select name,dump(name,16)dump from tt1;
NAME DUMP
------------------------------ ----------------------------------------
ibmc Typ=1 Len=4: 69,62,6d,63
BBBB Typ=1 Len=4: 42,42,42,42
UNDO操作: