使用BBED修改表数据
来源:互联网 发布:淘宝卫浴装修效果图 编辑:程序博客网 时间:2024/06/05 02:31
bbed可以直接修改block上的内容
模拟环境:
SQL> select * from goolen;
ID NAME
---------- --------------------
1 GOOLEN
2 ORACLE
SQL> select
2 dbms_rowid.rowid_relative_fno(rowid) file_number,
3 dbms_rowid.rowid_block_number(rowid) block_number,
4 id,name
5 from goolen;
FILE_NUMBER BLOCK_NUMBER ID NAME
----------- ------------ ---------- --------------------
4 172 1 GOOLEN
4 172 2 ORACLE
--我们把id=1的这一列,name值改为ORACLE
[oracle@localhost bbed]$ bbed parfile=bbed.par
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Thu Oct 24 10:17:18 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> info
File# Name Size(blks)
----- ---- ----------
1 /opt/app/oracle/oradata/goolen/system01.dbf 87040
2 /opt/app/oracle/oradata/goolen/sysaux01.dbf 71680
3 /opt/app/oracle/oradata/goolen/undotbs01.dbf 3840
4 /opt/app/oracle/oradata/goolen/users01.dbf 7040
BBED> set dba 4,172
DBA 0x010000ac (16777388 4,172)
--/c 直接查找字符串,确定这一行在block中的偏移量offset
BBED> f /c GOOLEN
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
------------------------------------------------------------------------
474f4f4c 454e0206 5fd4
<32 bytes per line>
--dump查看具体的内容
BBED> d /v dba 4,172 offset 8182 count 32
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
-------------------------------------------------------
474f4f4c 454e0206 5fd4 l GOOLEN.._?
<16 bytes per line>
--修改
BBED> modify /c ORACLE dba 4,172 offset 8182
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
------------------------------------------------------------------------
4f524143 4c450206 5fd4
<32 bytes per line>
--再次dump查看内容
BBED> d /v dba 4,172 offset 8182 count 32
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
-------------------------------------------------------
4f524143 4c450206 5fd4 l ORACLE.._?
<16 bytes per line>
BBED> sum apply
Check value for File 4, Block 172:
current = 0xe3c7, required = 0xe3c7
--刷新,查看表数据
SQL> alter system flush buffer_cache;
System altered.
--数据已经被更改
SQL> select rowid,g.* from goolen g;
ROWID ID NAME
------------------ ---------- --------------------
AAASNRAAEAAAACsAAA 1 ORACLE
AAASNRAAEAAAACsAAB 2 ORACLE
--回滚所有操作
BBED> revert
All changes made in this session will be rolled back. Proceed? (Y/N) y
Reverted file '/opt/app/oracle/oradata/goolen/users01.dbf', block 172
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
BBED>
--再次刷新
SQL> alter system flush buffer_cache;
System altered.
SQL> select rowid,g.* from goolen g;
ROWID ID NAME
------------------ ---------- --------------------
AAASNRAAEAAAACsAAA 1 GOOLEN
AAASNRAAEAAAACsAAB 2 ORACLE
SQL>
模拟环境:
SQL> select * from goolen;
ID NAME
---------- --------------------
1 GOOLEN
2 ORACLE
SQL> select
2 dbms_rowid.rowid_relative_fno(rowid) file_number,
3 dbms_rowid.rowid_block_number(rowid) block_number,
4 id,name
5 from goolen;
FILE_NUMBER BLOCK_NUMBER ID NAME
----------- ------------ ---------- --------------------
4 172 1 GOOLEN
4 172 2 ORACLE
--我们把id=1的这一列,name值改为ORACLE
[oracle@localhost bbed]$ bbed parfile=bbed.par
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Thu Oct 24 10:17:18 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> info
File# Name Size(blks)
----- ---- ----------
1 /opt/app/oracle/oradata/goolen/system01.dbf 87040
2 /opt/app/oracle/oradata/goolen/sysaux01.dbf 71680
3 /opt/app/oracle/oradata/goolen/undotbs01.dbf 3840
4 /opt/app/oracle/oradata/goolen/users01.dbf 7040
BBED> set dba 4,172
DBA 0x010000ac (16777388 4,172)
--/c 直接查找字符串,确定这一行在block中的偏移量offset
BBED> f /c GOOLEN
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
------------------------------------------------------------------------
474f4f4c 454e0206 5fd4
<32 bytes per line>
--dump查看具体的内容
BBED> d /v dba 4,172 offset 8182 count 32
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
-------------------------------------------------------
474f4f4c 454e0206 5fd4 l GOOLEN.._?
<16 bytes per line>
--修改
BBED> modify /c ORACLE dba 4,172 offset 8182
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
------------------------------------------------------------------------
4f524143 4c450206 5fd4
<32 bytes per line>
--再次dump查看内容
BBED> d /v dba 4,172 offset 8182 count 32
File: /opt/app/oracle/oradata/goolen/users01.dbf (4)
Block: 172 Offsets: 8182 to 8191 Dba:0x010000ac
-------------------------------------------------------
4f524143 4c450206 5fd4 l ORACLE.._?
<16 bytes per line>
BBED> sum apply
Check value for File 4, Block 172:
current = 0xe3c7, required = 0xe3c7
--刷新,查看表数据
SQL> alter system flush buffer_cache;
System altered.
--数据已经被更改
SQL> select rowid,g.* from goolen g;
ROWID ID NAME
------------------ ---------- --------------------
AAASNRAAEAAAACsAAA 1 ORACLE
AAASNRAAEAAAACsAAB 2 ORACLE
--回滚所有操作
BBED> revert
All changes made in this session will be rolled back. Proceed? (Y/N) y
Reverted file '/opt/app/oracle/oradata/goolen/users01.dbf', block 172
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
BBED>
--再次刷新
SQL> alter system flush buffer_cache;
System altered.
SQL> select rowid,g.* from goolen g;
ROWID ID NAME
------------------ ---------- --------------------
AAASNRAAEAAAACsAAA 1 GOOLEN
AAASNRAAEAAAACsAAB 2 ORACLE
SQL>
- 使用BBED修改表数据
- 使用bbed修改数据
- Oracle bbed的使用(修改表数据)
- 使用bbed恢复表数据
- 通过bbed修改表的数据内容
- bbed修改varchar数据
- 使用BBED修改SCN
- 使用DUMP数据块与BBED查看BLOCK对比数据库修改时的SCN
- 使用BBED修改SCN让数据文件online
- 使用BBED恢复delete删除的数据
- 【Oracle】使用bbed恢复delete的数据
- 【Oracle】使用bbed恢复update的数据
- bbed使用
- 用BBED理解和修改Oracle数据块
- 【bbed】bbed工具使用小记
- BBED模拟表数据块的损坏
- 3.Oracle BBED解析数据块——BBED基本使用一
- 4.Oracle BBED解析数据块——BBED基本使用二
- 关于进程堆栈分布和工作原理(转发)
- 1024
- 关于Linux文件权限
- code review (一)
- ADB server didn't ACK解决方法
- 使用BBED修改表数据
- 未来的软件以及未来的Notes/Domino
- 任务管理器,win7的,显示不全
- 直接拿来用!10款实用Android UI工具
- Unicode转化为汉字
- 数据库弱一致性四个隔离级别
- 可望不可及的开源:Google是如何逐步牢牢控制Android的?
- 三星移动硬盘在nuc960上无法挂载问题解决方法
- window.top和window.parent