使用bbed模拟delete提交操作

--session 1

TEST@ orcl >create table tt(id int,name varchar2(100));
Table created.
TEST@ orcl >insert into tt values(1,'AAAAA');
1 row created.
TEST@ orcl > insert into tt values(2,'BBBBB');
1 row created.
TEST@ orcl >insert into tt values(3,'CCCCC');
1 row created.
TEST@ orcl >COMMIT;
Commit complete.
TEST@ orcl > alter system flush buffer_cache;
System altered.
TEST@ orcl > select rowid,id,name,DBMS_ROWID.ROWID_RELATIVE_FNO(rowid) file#,DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid) block# from test.tt;
ROWID ID NAME FILE# BLOCK#
------------------ ---------- -------------------- ---------- ----------
AAAVW0AAFAAAAi3AAA 1 AAAAA 5 2231
AAAVW0AAFAAAAi3AAB 2 BBBBB 5 2231
AAAVW0AAFAAAAi3AAC 3 CCCCC 5 2231
TEST@ orcl >alter system checkpoint;
System altered.
TEST@ orcl > alter system dump datafile 5 block 2231;
System altered.
TEST@ orcl >select * from v$diag_info where name='Default Trace File';
INST_ID NAME VALUE
---------- -------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Default Trace File /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_18408.trc
TEST@ orcl >select * from tt;
ID NAME
---------- --------------------
1 AAAAA
2 BBBBB
3 CCCCC

dump的结果

--session 1执行删除操作

TEST@ orcl >delete from tt where name='AAAAA';
1 row deleted.
TEST@ orcl > select * from tt;
ID NAME
---------- --------------------
2 BBBBB
3 CCCCC

--session2执行操作

SQL> alter system checkpoint;
System altered.
SQL> alter system flush buffer_cache;
System altered.
SQL> alter system flush shared_pool;
System altered.
SQL> alter system dump datafile 5 block 2231;
System altered.
SQL> select * from v$diag_info where name='Default Trace File';
INST_ID NAME
---------- ----------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
1 Default Trace File
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_22529.trc
SQL> alter system dump datafile 5 block 2231;
System altered.
SQL> select * from v$diag_info where name='Default Trace File';
INST_ID NAME
---------- ----------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
1 Default Trace File
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_22529.trc

dump结果

--session 3 bbed会话

BBED>  set file 5 block 2231
FILE# 5
BLOCK# 2231
BBED> p ktbbh
struct ktbbh, 72 bytes @20
ub1 ktbbhtyp @20 0x01 (KDDBTDATA)
union ktbbhsid, 4 bytes @24
ub4 ktbbhsg1 @24 0x000155b4
ub4 ktbbhod1 @24 0x000155b4
struct ktbbhcsc, 8 bytes @28
ub4 kscnbas @28 0x0092cb9b
ub2 kscnwrp @32 0x0000
sb2 ktbbhict @36 2
ub1 ktbbhflg @38 0x32 (NONE)
ub1 ktbbhfsl @39 0x00
ub4 ktbbhfnx @40 0x014008b0
struct ktbbhitl[], 24 bytes @44
struct ktbitxid, 8 bytes @44
ub2 kxidusn @44 0x000a
ub2 kxidslt @46 0x000b
ub4 kxidsqn @48 0x00004456
struct ktbituba, 8 bytes @52
ub4 kubadba @52 0x00c002d8
ub2 kubaseq @56 0x0175
ub1 kubarec @58 0x08
ub2 ktbitflg @60 0x8000 (KTBFCOM)
union _ktbitun, 2 bytes @62
sb2 _ktbitfsc @62 0
ub2 _ktbitwrp @62 0x0000
ub4 ktbitbas @64 0x0092cb3d
struct ktbbhitl[], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub2 kxidusn @68 0x0008
ub2 kxidslt @70 0x0011
ub4 kxidsqn @72 0x000078b4
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x00c00397
ub2 kubaseq @80 0x017e
ub1 kubarec @82 0x1d
ub2 ktbitflg @84 0x0001 (NONE)
union _ktbitun, 2 bytes @86
sb2 _ktbitfsc @86 10
ub2 _ktbitwrp @86 0x000a
ub4 ktbitbas @88 0x00000000

bbed执行修改

BBED> m /x 0080 offset 84
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/app/oracle/oradata/orcl/test01.dbf (5)
Block: 2231 Offsets: 84 to 595 Dba:0x014008b7
------------------------------------------------------------------------
00800a00 00000000 00000000 00000000 00010300 ffff1800 741f5c1f 681f0000
03008c1f 801f741f c21db41e 770b6e0c 480d240e 1d0f2510 21110312 1513f013 <32 bytes per line>
BBED> sum apply
Check value for File 5, Block 2231:
current = 0x1761, required = 0x1761

再次查看

BBED> p ktbbh
struct ktbbh, 72 bytes @20
ub1 ktbbhtyp @20 0x01 (KDDBTDATA)
union ktbbhsid, 4 bytes @24
ub4 ktbbhsg1 @24 0x000155b4
ub4 ktbbhod1 @24 0x000155b4
struct ktbbhcsc, 8 bytes @28
ub4 kscnbas @28 0x0092cb9b
ub2 kscnwrp @32 0x0000
sb2 ktbbhict @36 2
ub1 ktbbhflg @38 0x32 (NONE)
ub1 ktbbhfsl @39 0x00
ub4 ktbbhfnx @40 0x014008b0
struct ktbbhitl[], 24 bytes @44
struct ktbitxid, 8 bytes @44
ub2 kxidusn @44 0x000a
ub2 kxidslt @46 0x000b
ub4 kxidsqn @48 0x00004456
struct ktbituba, 8 bytes @52
ub4 kubadba @52 0x00c002d8
ub2 kubaseq @56 0x0175
ub1 kubarec @58 0x08
ub2 ktbitflg @60 0x8000 (KTBFCOM)
union _ktbitun, 2 bytes @62
sb2 _ktbitfsc @62 0
ub2 _ktbitwrp @62 0x0000
ub4 ktbitbas @64 0x0092cb3d
struct ktbbhitl[], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub2 kxidusn @68 0x0008
ub2 kxidslt @70 0x0011
ub4 kxidsqn @72 0x000078b4
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x00c00397
ub2 kubaseq @80 0x017e
ub1 kubarec @82 0x1d
ub2 ktbitflg @84 0x8000 (KTBFCOM)
union _ktbitun, 2 bytes @86
sb2 _ktbitfsc @86 10
ub2 _ktbitwrp @86 0x000a
ub4 ktbitbas @88 0x00000000
BBED> p *kdbr[]
rowdata[]
-----------
ub1 rowdata[] @8176 0x3c ###状态为3c,标记已经删除 BBED> x/rncccccc
rowdata[] @8176
-----------
flag@8176: 0x3c (KDRHFL, KDRHFF, KDRHFD, KDRHFH)
lock@8177: 0x02
cols@8178: 0
BBED> dump /v offset 8176 count 20
File: /u01/app/oracle/oradata/orcl/test01.dbf (5)
Block: 2231 Offsets: 8176 to 8191 Dba:0x014008b7
-------------------------------------------------------
3c020202 c1020541 41414141 01069bcb l <...

06 使用bbed提交delete的数据--01的更多相关文章

  1. 06 使用bbed修复delete的数据--01

    06 使用bbed修复delete的数据--01 根据rowid查看数据文件和block号 SYS@ orcl ; ROWID ID NAME FILE# BLOCK# --------------- ...

  2. 06 使用bbed修复update的数据--01

    场景1 表t3 SQL> select * from t3; ID NAME ---------- -------------------- aaa bbbb SQL> update t3 ...

  3. 【Oracle】使用bbed恢复delete的数据

    表中的数据被delete之后并不会真正删除数据,而是打了一个删除标记,仅仅要还没有被覆盖就能够恢复回来. 实验步骤例如以下: SYS@ORCL>create table bbed_test(x  ...

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

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

  5. 提交JSON修改数据

    提交JSON修改数据 设计目标: 1)可以一次性提交多个表的修改数据 2)跨语言.跨平台 { "deltas": [ { "table": "tuni ...

  6. 使用ajax提交的json数据,产生筹码问题

    使用ajax提交的json数据,我们必须添加produces注解,如下所示.否则将会产生乱码 方法一:添加produces注解 @ApiOperation(value = "删除日志&quo ...

  7. WCF+Restfull服务 提交或获取数据时数据大小限制问题解决方案

    近日在使用wcf的restfull架构服务时遭遇到了提交大数据的问题. 大数据包含两种情形: 1)单条数据量过大. 2)提交或获取的数据条数过多. 在测试时发现,默认设置下当单条JSON数据大于30K ...

  8. checkbox提交多组数据到action

    突然想通过checkbox来提交多组数据到action,一时间想不起来怎么写,到网上流岚大婶们的笔迹之后,有了新发现! 方法一: 在action用一个String类型的变量来接受checkbox传过来 ...

  9. PHP 表单提交多行数据,显示多个submit

    echo "<table border=1 class="imagetable" >"; //使用表格格式化数据echo "<for ...

随机推荐

  1. There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.

    There are multiple modules with names that only differ in casing.This can lead to unexpected behavio ...

  2. 基于TCP/UDP协议的socket

    基于TCP协议的socket tcp是基于链接的,必须先启动服务端,然后再启动客户端去链接服务端 server端 import socket sk = socket.socket() sk.bind( ...

  3. Verilog-2001标准在2001年就发布了

      ,不过翻了一些Verilog书籍,对Verilog-2001的新增特性很少有提及,即使提到了,也只是寥寥数语带过,其实在Verilog-2001中做了很多有用的改进,给编程带来很大的帮助,有必要详 ...

  4. Nginx优化_数据包头部信息过大问题

    如果客户端发出请求的URL头部信息过大,网站将不能及时响应,并通过状态码414报错. <center><h1>414 Request-URI Too Large</h1& ...

  5. 牛客练习赛33 E tokitsukaze and Similar String (字符串哈希hash)

    链接:https://ac.nowcoder.com/acm/contest/308/E 来源:牛客网 tokitsukaze and Similar String 时间限制:C/C++ 2秒,其他语 ...

  6. SQL查询优化的步骤

    一.定位慢查询 SQL优化的一般步骤:先查询mysql数据库运行状况,然后定位慢查询,再分析sql的执行过程,然后进行优化 1.使用show status查询数据库的运行状况 //显示数据库运行状态 ...

  7. Git整理[1] git cherry-pick的使用

    简单地说 git cherry-pick为”挑拣”提交 ,挑取某次提交合并到其他分支上,而不用合并整个分支. 参数: git cherry-pick [<options>] <com ...

  8. IntelliJ IDEA VM options(转)

    Custom IntelliJ IDEA VM options # Custom IntelliJ IDEA VM options ##################JVM模式########### ...

  9. Linux学习-NFS服务

    一.NFS服务相关介绍 1.NFS简介 NFS (Network File System) 网络文件系统,基于内核的文件系统.Sun公司开发,通过使用NFS,用户和程序可以像访问本地文件一样访问远端系 ...

  10. CSS画心形和蛋形

    一.心形 使用transform-origin属性实现设置不同的点为原点 1.改变元素基点transform-origin(transform-origin是变形原点,原点就是元素绕着旋转或变形的点) ...