[20170412]bbed隐藏数据记录.txt

简介: [20170412]bbed隐藏数据记录.txt --上午做了bbed恢复修改记录(不等长)的情况,http://blog.itpub.net/267265/viewspace-2137082/ --下午做一个隐藏数据记录的情况,实际上这样做有点多余,就是删除命令,看看bbed是否可以完成。

[20170412]bbed隐藏数据记录.txt

--上午做了bbed恢复修改记录(不等长)的情况,http://blog.itpub.net/267265/viewspace-2137082/
--下午做一个隐藏数据记录的情况,实际上这样做有点多余,就是删除命令,看看bbed是否可以完成。

1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SCOTT@book> create table t as select * from dept ;
Table created.

SCOTT@book> @ &r/qq t 1
ROWID                    OBJECT         FILE        BLOCK          ROW ROWID_DBA                  DEPTNO DNAME          LOC
------------------ ------------ ------------ ------------ ------------ -------------------- ------------ -------------- -------------
AAAWGvAAEAAAAIjAAA        90543            4          547            0  0x1000223                     10 ACCOUNTING     NEW YORK
--//假设隐藏这条记录。

SCOTT@book> alter system checkpoint ;
System altered.

2.bbed操作,实际上就是修改对应flag =0x3c.

BBED> x /rncc dba 4,547 *kdbr[0]
rowdata[66]                                 @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x00
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK

BBED> assign offset 8162=0x3c;
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub1 rowdata[0]                              @8162     0x3c

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48a5, required = 0x48a5

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0x7f25fb24a27c
kdbchk: the amount of space used is not equal to block size
        used=94 fsc=0 avsp=7946 dtl=8064
Block 547 failed with check code 6110

--dtl - used - fsc = avsp
--8064-94-0=7970

BBED> assign kdbh.kdbhavsp=7970
sb2 kdbhavsp                                @134      7970

BBED> sum apply
Check value for File 4, Block 547:
current = 0x488d, required = 0x488d

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0xce0e7c
kdbchk: avsp(7970) > tosp(7946)
Block 547 failed with check code 6128

BBED> assign kdbh.kdbhtosp=kdbh.kdbhavsp
sb2 kdbhtosp                                @136      7970


BBED> sum apply
Check value for File 4, Block 547:
current = 0x48a5, required = 0x48a5

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0xce0e7c
kdbchk: space available on commit is incorrect
        tosp=7970 fsc=0 stb=2 avsp=7970
Block 547 failed with check code 6111

BBED> assign kdbh.kdbhtosp=7972
sb2 kdbhtosp                                @136      7968

--//依旧不理解stb 什么意思。是否指flag,lock这2个字节。
--//猜测tosp - fsc - stb = avsp.

BBED> p kdbh
struct kdbh, 14 bytes                       @124
   ub1 kdbhflag                             @124      0x00 (NONE)
   sb1 kdbhntab                             @125      1
   sb2 kdbhnrow                             @126      4
   sb2 kdbhfrre                             @128     -1
   sb2 kdbhfsbo                             @130      26
   sb2 kdbhfseo                             @132      7972
   sb2 kdbhavsp                             @134      7970
   sb2 kdbhtosp                             @136      7972

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48a3, required = 0x48a3

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

3.检查修改情况:
SCOTT@book> alter system flush buffer_cache ;
System altered.


SCOTT@book> select rowid,t.* from t;
ROWID                    DEPTNO DNAME          LOC
------------------ ------------ -------------- -------------
AAAWGvAAEAAAAIjAAB           20 RESEARCH       DALLAS
AAAWGvAAEAAAAIjAAC           30 SALES          CHICAGO
AAAWGvAAEAAAAIjAAD           40 OPERATIONS     BOSTON
--OK!!

4.重复测试隐藏3条看看。

SCOTT@book> drop table t purge ;
Table dropped.

SCOTT@book> create table t as select * from dept ;
Table created.

SCOTT@book> @ &r/qq t 1
ROWID                    OBJECT         FILE        BLOCK          ROW ROWID_DBA                  DEPTNO DNAME          LOC
------------------ ------------ ------------ ------------ ------------ -------------------- ------------ -------------- -------------
AAAWGwAAEAAAAIjAAA        90544            4          547            0  0x1000223                     10 ACCOUNTING     NEW YORK

SCOTT@book> alter system checkpoint ;
System altered.

BBED> x /rncc dba 4,547 *kdbr[0]
rowdata[66]                                 @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x00
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK


BBED> x /rncc dba 4,547 *kdbr[1]
rowdata[44]                                 @8140
-----------
flag@8140: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8141: 0x00
cols@8142:    3

col    0[2] @8143: 20
col    1[8] @8146: RESEARCH
col    2[6] @8155: DALLAS


BBED> x /rncc dba 4,547 *kdbr[2]
rowdata[24]                                 @8120
-----------
flag@8120: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8121: 0x00
cols@8122:    3

col    0[2] @8123: 30
col    1[5] @8126: SALES
col    2[7] @8132: CHICAGO

BBED> assign offset 8162=0x3c;
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub1 rowdata[0]                              @8162     0x3c

BBED> assign offset 8140=0x3c;
ub1 rowdata[0]                              @8140     0x3c

BBED> assign offset 8120=0x3c;
ub1 rowdata[0]                              @8120     0x3c

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48ba, required = 0x48ba

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0x7fa16f64b27c
kdbchk: the amount of space used is not equal to block size
        used=56 fsc=0 avsp=7946 dtl=8064
Block 547 failed with check code 6110

--dtl - used - fsc = avsp
-- 8064-56-0=8008

BBED> assign kdbh.kdbhavsp=8008
sb2 kdbhavsp                                @134      8008

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48f8, required = 0x48f8

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0x198ce7c
kdbchk: avsp(8008) > tosp(7946)
Block 547 failed with check code 6128


BBED> assign kdbh.kdbhtosp=kdbh.kdbhavsp
sb2 kdbhtosp                                @136      8008

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48ba, required = 0x48ba

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547

Block Checking: DBA = 16777763, Block Type = KTB-managed data block
data header at 0x198ce7c
kdbchk: space available on commit is incorrect
        tosp=8008 fsc=0 stb=6 avsp=8008
Block 547 failed with check code 6111
--//感觉stb=6,猜测正常。

--//猜测tosp - fsc - stb = avsp.
--//8014-0-6=8008

BBED> assign kdbh.kdbhtosp=8014
sb2 kdbhtosp                                @136      8014

BBED> sum apply
Check value for File 4, Block 547:
current = 0x48bc, required = 0x48bc

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 547


SCOTT@book> alter system flush buffer_cache ;
System altered.

SCOTT@book> select rowid,t.* from t;
ROWID                    DEPTNO DNAME          LOC
------------------ ------------ -------------- -------------
AAAWGwAAEAAAAIjAAD           40 OPERATIONS     BOSTON

--OK!!

目录
相关文章
|
Oracle 关系型数据库 数据库
[20180604]在内存修改数据(bbed).txt
[20180604]在内存修改数据(bbed).txt --//以前曾经做过在内存修改数据,通过oradebug poke命令修改内存信息,相关链接: --//http://blog.itpub.net/267265/viewspace-2124466/=>[20160904]在内存修改数据.txt --//今天测试看看是否通过bbed修改数据信息的情况.使用asmm,这样/dev/shm可以看到一个一个文件。
1101 0
|
数据库管理
[20170411]bbed删除记录的恢复.txt
[20170411]bbed删除记录的恢复.txt --//昨天上午做的测试,链接:http://blog.itpub.net/267265/viewspace-2136933/ --//我当时并没有选择恢复记录,仅仅看删除的内容.
1045 0
|
Oracle 关系型数据库 测试技术
[20170412]bbed恢复修改记录(不等长).txt
[20170412]bbed恢复修改记录(不等长).txt --//昨天做了删除记录恢复测试,今天测试update记录如何还原通过bbed。 --//实际上类似的测试我自己做了好几次,都是按照别人的帖子依葫芦画瓢,没有很好理解一些内在的东西。
1026 0
|
Oracle 关系型数据库 开发工具
[20161020]bbed保存执行结果.txt
[20161020]bbed保存执行结果.txt --别人问的问题,实际上如果输出内容不多,直接界面上查看。 --如果输出很多,屏幕显示一闪而过,如果在tmux下使用就很简单,使用前缀键+[进入tmux的buffer模式,浏览以前的显示的内容 --我设置vi模式,可以像vim使用?或者/查询需要找的内容,一般使用?,因为tmux的显示是从下向上的。
761 0
|
数据库管理
[20160528]bbed观察行目录变化.txt
[20160528]bbed观察行目录变化.txt 如果使用bbed观察kdbr,可以发现记录的是相对偏移量,这个偏移我一直认为从kdbh算起.而对于数据块前面有ITL槽信息,对于有2个ITL的块, 使用assm的表空间,一般我看到都是100.
762 0
|
Oracle 关系型数据库 数据库管理
[20160526]bbed修改数据记录(不等长).txt
[20160526]bbed修改数据记录(不等长).txt --以前做的测试,有点乱,当时没有很好的理解快速提交.而且做的很乱,链接如下: http://blog.
926 0
|
数据库管理
[20160526]bbed修复删除记录.txt
[20160526]bbed修复删除记录.txt --以前也做过,链接: http://blog.itpub.net/267265/viewspace-745944/ --自己当时完全是依葫芦画瓢,许多东西理解不深刻,重新做一次.
933 0
|
Oracle 关系型数据库 数据库
[20160413利用bbed修改跳过损坏的索引.txt
[20160413利用bbed修改跳过损坏的索引.txt --前一阵子做过利用bbed修改跳过损坏的索引,这次测试看看破坏索引SYS.I_OBJ1看看. 1.环境: SYS@book> @ &r/ver1 PORT_STRING             ...
1017 0
|
关系型数据库 测试技术 数据库
[20160405]利用bbed修改跳过损坏的索引.txt
[20160405]利用bbed修改跳过损坏的索引.txt --oracle的启动通过system的第一块的rdba(kcvfhrdb) http://blog.itpub.
906 0
|
存储 Oracle 关系型数据库
[20160407]bbed修改文件头2(补充).txt
[20160407]bbed修改文件头2(补充).txt --昨天被别人问一个问题,就是我的测试修改数据文件相应的CHECKPOINT_CHANGE#就ok了.偏移量是block=1的offset=484.
773 0