Oracle BBED工具介绍(五)
0 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
从刚才关闭数据库时cp的文件中复制第17个块来覆盖当前的块,覆盖完了再检查一下。
BBED> verify
DBVERIFY - Verification starting
FILE = /export/home/oradata/orcl/users01.dbf
BLOCK = 17
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 1
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
BBED>
好了,看看123的情况
BBED> dump file 4 block 17 offset 123
File: /export/home/oradata/orcl/users01.dbf (4)
Block: 17 Offsets: 123 to 634 Dba:0x01000011
------------------------------------------------------------------------
4bd68222 4b000000 00000000 00000000 00000000 00120000 01000000 00000000
00080000 00080000 00190000 01000000 00000000 00000000 00050000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
000220ed 35
数据还原了过来,再次改过来,试试回滚的命令。
BBED> modify /x 62 file 4 block 17 offset 123
File: /export/home/oradata/orcl/users01.dbf (4)
Block: 17 Offsets: 123 to 634 Dba:0x01000011
------------------------------------------------------------------------
62000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> undo
BBED> modify /x 00 filename '/export/home/oradata/orcl/users01.dbf' block 17. offset 123.
File: /export/home/oradata/orcl/users01.dbf (4)
Block: 17 Offsets: 123 to 634 Dba:0x01000011
------------------------------------------------------------------------
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
undo就相当于sqlplus里面的 rollback 不过是回滚上一步,而不是所有操作。
下面试试revert,不过要重新登陆,因为revert是回滚这次登陆以来所有的操作。
BBED> dump file 4 block 17 offset 123
File: /export/home/oradata/orcl/users01.dbf (4)
Block: 17 Offsets: 120 to 631 Dba:0x01000011
------------------------------------------------------------------------
00000000 00000000 00000000 00000000 00000000