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

[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!!

时间: 2024-10-23 20:15:20

[20170412]bbed隐藏数据记录.txt的相关文章

[20160526]bbed修改数据记录(不等长).txt

[20160526]bbed修改数据记录(不等长).txt --以前做的测试,有点乱,当时没有很好的理解快速提交.而且做的很乱,链接如下: http://blog.itpub.net/267265/viewspace-1193074/ --今天重复测试看看: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ ------

[20140624]bbed修改数据记录(不等长).txt

[20140624]bbed修改数据记录(不等长).txt http://www.itpub.net/thread-1872851-1-1.html --给出的问题修改记录时,长度没有变化,如果存在变化,修改与原来的不同,要修改kdbr[0]的值. --还有一些细节的步骤. SCOTT@test> @ver BANNER -------------------------------------------------------------------------------- Oracle

[20160526]bbed修复删除记录.txt

[20160526]bbed修复删除记录.txt --以前也做过,链接: http://blog.itpub.net/267265/viewspace-745944/ --自己当时完全是依葫芦画瓢,许多东西理解不深刻,重新做一次. 1.环境: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ --------------

[20170412]bbed恢复修改记录(不等长).txt

[20170412]bbed恢复修改记录(不等长).txt --//昨天做了删除记录恢复测试,今天测试update记录如何还原通过bbed. --//实际上类似的测试我自己做了好几次,都是按照别人的帖子依葫芦画瓢,没有很好理解一些内在的东西. http://blog.itpub.net/267265/viewspace-2137000/ http://blog.itpub.net/267265/viewspace-2107060/ http://blog.itpub.net/267265/vie

[20150522]bbed与数据块检查和.txt

[20150522]bbed与数据块检查和.txt --我现在基本拿bbed学习,基本是拿bbed查看,而使用bvi修改数据.我感觉这种方便1写. --实际上使用bbed的好处就是修改数据块检查和不一致,而使用bbed修改很简单仅仅需要执行sum apply就ok了. --对比dbv与bbed确定检查和位置. 1.建立测试环境: SCOTT@test> @ &r/ver1 PORT_STRING                    VERSION        BANNER -------

[20160329]bbed修复offline的数据文件.txt

[20160329]bbed修复offline的数据文件.txt --测试数据库,不小心将一个数据文件offline了,archivelog也删除了(主要磁盘空间紧张,做了一次整理). --自己测试修复看看,顺便做一个记录. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- --------

[20150527]bbed解决数据文件大小问题.txt

[20150527]bbed解决数据文件大小问题.txt --模拟一个数据文件大小不一致的问题. 1.建立测试环境: SCOTT@test> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- ---------------------------------------------------------------- x86

[20121019]8k数据块到底能放多少行记录.txt

[20121019]8k数据块到底能放多少行记录.txt 前一阵子聚会,被问及一个8k数据块能够放多少行记录,我记得以前piner的书提高过,73X条. 实际上表sys.tab$的spare1字段保存的Hakan Factor,即该表数据块的最大行号,各种数据块的大小不同, spare1的缺省值也不一样. _______________________________ 块大小  最大行数每块(spare1)   _______________________________ 2K      17

[20150527]bbed与数据块检查和2.txt

[20150527]bbed与数据块检查和2.txt http://blog.itpub.net/267265/viewspace-1666781/ --我现在基本拿bbed学习,基本是拿bbed查看,而使用bvi修改数据.我感觉这种方便1写. --实际上使用bbed的好处就是修改数据块检查和不一致,而使用bbed修改很简单仅仅需要执行sum apply就ok了. --对比dbv与bbed确定检查和位置. --实际上既然检查和在16,17字节,只要清零,加上dbv就很容易确定要修改的内容. 1.