bbed是一个强大的工具,同意我们绕过oracle直接从数据文件里改动相应的内容

ZBDBA@orcl11g>select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- -------------------- ------------------ ---------- ------------ ---------- ---------- ----------
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10 13 rows selected.

这里我们查看该表相应的物理块号

ZBDBA@orcl11g>select rowid,dbms_rowid.rowid_object(rowid) robject,
2 dbms_rowid.rowid_relative_fno(rowid) fno,
3 dbms_rowid.rowid_block_number(rowid) bno,
4 dbms_rowid.rowid_row_number(rowid) rno from emp where rownum=1;
ROWID ROBJECT FNO BNO RNO
------------------ ---------- ---------- ---------- ----------
AAASKaAAGAAAACDAAA 74394 6 131

使用bbed进行改动

BBED> set file 6 block 131
FILE# 6
BLOCK# 131 BBED> map
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Dba:0x01800083
------------------------------------------------------------
KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 struct ktbbh, 96 bytes @20 struct kdbh, 14 bytes @124 struct kdbt[1], 4 bytes @138 sb2 kdbr[13] @142 ub1 freespace[7491] @168 ub1 rowdata[529] @7659 ub4 tailchk @8188

这里通过字符串形式查找 SCOTT

BBED> find /c SCOTT
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Offsets: 7902 to 8191 Dba:0x01800083
------------------------------------------------------------------------
53434f54 5407414e 414c5953 5403c24c 430777bb 04130101 0102c21f ff02c115
2c000803 c24e5305 434c4152 4b074d41 4e414745 5203c24f 280777b5 06090101
0103c219 33ff02c1 0b2c0008 03c24d63 05424c41 4b45074d 414e4147 455203c2
4f280777 b5050101 010103c2 1d33ff02 c11f2c00 0803c24d 37064d41 5254494e
0853414c 45534d41 4e03c24d 630777b5 091c0101 0103c20d 3302c20f 02c11f2c
000803c2 4c43054a 4f4e4553 074d414e 41474552 03c24f28 0777b504 02010101
03c21e4c ff02c115 2c000803 c24c1604 57415244 0853414c 45534d41 4e03c24d
630777b5 02160101 0103c20d 3302c206 02c11f2c 000803c2 4b640541 4c4c454e
0853414c 45534d41 4e03c24d 630777b5 02140101 0102c211 02c20402 c11f0206
c656 <32 bytes per line>

dump下来看是不是我们须要的内容:

BBED> d /v offset 7902 count 128
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Offsets: 7902 to 8029 Dba:0x01800083
-------------------------------------------------------
53434f54 5407414e 414c5953 5403c24c l SCOTT.ANALYST..L
430777bb 04130101 0102c21f ff02c115 l C.w.............
2c000803 c24e5305 434c4152 4b074d41 l ,....NS.CLARK.MA
4e414745 5203c24f 280777b5 06090101 l NAGER..O(.w.....
0103c219 33ff02c1 0b2c0008 03c24d63 l ....3....,....Mc
05424c41 4b45074d 414e4147 455203c2 l .BLAKE.MANAGER..
4f280777 b5050101 010103c2 1d33ff02 l O(.w.........3..
c11f2c00 0803c24d 37064d41 5254494e l ..,....M7.MARTIN <16 bytes per line> BBED> d /v offset 7902 count 12
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Offsets: 7902 to 7913 Dba:0x01800083
-------------------------------------------------------
53434f54 5407414e 414c5953 l SCOTT.ANALYS <16 bytes per line> BBED> modify /c 'ZBDBA' offset 7902
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Offsets: 7902 to 7913 Dba:0x01800083
------------------------------------------------------------------------
5a424442 4107414e 414c5953 <32 bytes per line> BBED> d /v offset 7902 count 12
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 131 Offsets: 7902 to 7913 Dba:0x01800083
-------------------------------------------------------
5a424442 4107414e 414c5953 l ZBDBA.ANALYS <16 bytes per line> BBED> sum apply
Check value for File 6, Block 131:
current = 0x60f5, required = 0x60f5 BBED> verify
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/orcl11g/zbdba01.dbf
BLOCK = 131 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>

刷新缓存:

alter system flush buffer_cache;
查看是否改动成功:
ZBDBA@orcl11g>select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- -------------------- ------------------ ---------- ------------ ---------- ---------- ----------
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 ZBDBA KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10

使用bbed改动数据的更多相关文章

  1. 使用BBED恢复数据文件头

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/31018075 @@@@@@@利用BBED模拟损坏5文件1号块(文件头) BBED> ...

  2. bbed改动undo段状态(ORA-01578)

    ZBDBA@orcl11g>select * from zbdba; select * from zbdba * ERROR at line 1: ORA-01578: ORACLE data ...

  3. 利用BBED恢复数据文件头

    转载请注明出处:http: @@@@@@@利用BBED模拟损坏5文件1号块(文件头) BBED block block ) Block: Dba:0x01400001 ---------------- ...

  4. 使用bbed编辑研究oracle数据块结构

    bbed是随oracle软件公布的一款数据块查看和编辑工具,作为一款内部工具.bbed的功能很强大,可是假设使用不当可能给数据库造成无法挽回的损失.因此.我们建议在使用bbed改动数据块前备份被改动的 ...

  5. oracle BBED 直接改动数据库block块

    1.BBED配置 1)将相应文件放到$ORACLE_HOME/rdbms/mesg和$ORACLE_HOME/rdbms/lib中:     --将lib中bbedus.msb和bbedus.msg ...

  6. [20180604]在内存修改数据(bbed).txt

    [20180604]在内存修改数据(bbed).txt --//以前曾经做过在内存修改数据,通过oradebug poke命令修改内存信息,相关链接:--//http://blog.itpub.net ...

  7. 使用BBED理解和修改Oracle数据块

    1.生成bbed list file文件: SQL> select file#||' '||name||' '||bytes from v$datafile; $ vim dbfile.txt ...

  8. jquery easyui datagrid实现数据改动

    1.单击选中待改动行 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA= ...

  9. bbed初体验

    bbed能够直接查看或改动数据文件.听起来非常强大,以下体验一下,安装方法网上一搜一大把,我的环境是centos+10G的 bbed參考文档:http://pan.baidu.com/s/1hqCC6 ...

随机推荐

  1. CAD参数绘制mcdbsolid对象(com接口)

    C#中实现代码说明: private void DrawSolid() { //绘McDbSolid对象 axMxDrawX1.AddLinetype("MLineType1", ...

  2. gifsicle for linux ----------gif 图像处理

    1.gifsicle 在linux 中的使用下载gifsicle yum install gifsicle 若发现没有此包 ,更新epel第三方软件库 sudo yum install epel-re ...

  3. pycharm connect to mysql

    1.download mysql installer community 5.7.20 https://dev.mysql.com/downloads/file/?id=473605 or 链接:ht ...

  4. h5 中MP3 播放暂停 jq

    <!--音乐--> <div id="music"> <img src="../img/music.gif" class=&quo ...

  5. 树莓派 - platform总线,设备和驱动

    以树莓派为例子,分析一下其中LED的 platform device 和 platform driver. 查看LED设备,被挂载在/sys/devices/platform下. 注意其中的drive ...

  6. LeetCode(63)Unique Paths II

    题目 Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. Ho ...

  7. Uva 1572 自组合

    贴个源码// UVa1572 Self-Assembly // Rujia Liu #include<cstdio> #include<cstring> #include< ...

  8. 【转】Java中的IO操作

    在使用io操作之前,先看一下java中的文件类File如何使用.File包括文件和目录,对文件和目录的操作是新建目录mkdir,新建文件createNewFile,删除文件和目录delete,以及其他 ...

  9. DBA的40条军规

    DBA操作规范 1.涉及业务上的修改/删除数据,在得到业务方.CTO的邮件批准后方可执行,执行前提前做好备份,必要时可逆. 2.所有上线需求必须走工单系统,口头通知视为无效. 3.在对大表做表结构变更 ...

  10. Rikka with Phi 线段树

    Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds ...