[20180619]bbed verify问题.txt

简介: [20180619]bbed verify问题.txt --//记录一下自己一个多年的错误. 1.环境: SCOTT@test01p> @ ver1 PORT_STRING                    VERSION        BANNER   ...
[20180619]bbed verify问题.txt

--//记录一下自己一个多年的错误.

1.环境:
SCOTT@test01p> @ ver1
PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.1.0.1.0     Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production              0

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

SCOTT@test01p> select rowid,t.* from t;
ROWID                  DEPTNO DNAME                LOC
------------------ ---------- -------------------- -------------
AAAaRYAAJAAAAC7AAA         10 ACCOUNTING           NEW YORK
AAAaRYAAJAAAAC7AAB         20 RESEARCH             DALLAS
AAAaRYAAJAAAAC7AAC         30 SALES                CHICAGO
AAAaRYAAJAAAAC7AAD         40 OPERATIONS           DALLAS

SCOTT@test01p> @ rowid AAAaRYAAJAAAAC7AAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
    107608          9        187          0  0x24000BB           9,187                alter system dump datafile 9 block 187 ;

SCOTT@test01p> alter system checkpoint ;
System altered.

2.如果delete删除记录,提交后在对应的itl槽,fsc记录回收的空闲空间.

SCOTT@test01p> delete from t where deptno in (10,20);
2 rows deleted.

SCOTT@test01p> commit ;
Commit complete.

SCOTT@test01p> alter system checkpoint ;
System altered.

BBED> p /d dba 9,188   kdbh
struct kdbh, 14 bytes                       @124
   ub1 kdbhflag                             @124      0 (NONE)
   b1 kdbhntab                              @125      1
   b2 kdbhnrow                              @126      4
   sb2 kdbhfrre                             @128     -1
   sb2 kdbhfsbo                             @130      26
   sb2 kdbhfseo                             @132      7972
   b2 kdbhavsp                              @134      7946
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   b2 kdbhtosp                              @136      7994
--//我使用windows的bbed,访问的块存在一个数据块的偏移. 实际上dba 9,187.

BBED> p /d dba 9,188   ktbbh.ktbbhitl[1]
struct ktbbhitl[1], 24 bytes                @68
   struct ktbitxid, 8 bytes                 @68
      ub2 kxidusn                           @68       8
      ub2 kxidslt                           @70       21
      ub4 kxidsqn                           @72       25182
   struct ktbituba, 8 bytes                 @76
      ub4 kubadba                           @76       20972155
      ub2 kubaseq                           @80       1834
      ub1 kubarec                           @82       32
   ub2 ktbitflg                             @84       8194 (KTBFUPB)
   union _ktbitun, 2 bytes                  @86
      b2 _ktbitfsc                          @86       44
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      
      ub2 _ktbitwrp                         @86       44
   ub4 ktbitbas                             @88       27402089

--//可以发现itl事务槽记录的fsc=44.

BBED> assign dba 9,188 kdbh.kdbhavsp=7945
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
b2 kdbhavsp                                 @134      7945

--//人为造成一个错误,造成verify错误.

BBED> sum apply dba 9,188
Check value for File 9, Block 188:
current = 0xca36, required = 0xca36

BBED> verify dba 9,188
DBVERIFY - Verification starting
FILE = D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
BLOCK = 187

Block Checking: DBA = 37748923, Block Type = KTB-managed data block
data header at 0x2a1027c
kdbchk: the amount of space used is not equal to block size
        used=74 fsc=44 avsp=7945 dtl=8064
Block 187 failed with check code 6110

DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing   (Data) : 1
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0

--//fsc=44.
--//我的错误在这里,我一直人为这几个参数关系是dtl-used+fsc = avsp,而实际上:
used=74 fsc=44 avsp=7945 dtl=8064.
dtl-used-fsc = avsp
~~~~~~~~~~~~~~~~~~~~=> 应该是减去fsc.我以前这里一直是0,加减都是对的,^_^.严重错误.
--//或者是used+fsc+avsp=dtl.
8064-74-44 = 7946

--//更正后.一切ok.
BBED> assign dba 9,188 kdbh.kdbhavsp=7946
b2 kdbhavsp                                 @134      7946

BBED> sum apply dba 9,188
Check value for File 9, Block 188:
current = 0xca35, required = 0xca35

--//很奇怪的windows bbed,会自动更正检查和.

BBED> verify dba 9,188
DBVERIFY - Verification starting
FILE = D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
BLOCK = 187
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

4.人为产生3个事务,覆盖itl槽,这样对应的fsc信息被清除.
SCOTT@test01p> select * from t where deptno=30 for update ;
    DEPTNO DNAME                LOC
---------- -------------------- -------------
        30 SALES                CHICAGO

SCOTT@test01p> commit ;
Commit complete.

--//执行3次就ok了.
SCOTT@test01p> alter system checkpoint ;
System altered.

BBED> p /d dba 9,188  kdbh
struct kdbh, 14 bytes                       @124
   ub1 kdbhflag                             @124      0 (NONE)
   b1 kdbhntab                              @125      1
   b2 kdbhnrow                              @126      4
   sb2 kdbhfrre                             @128      0
   sb2 kdbhfsbo                             @130      26
   sb2 kdbhfseo                             @132      7972
   b2 kdbhavsp                              @134      7994
   b2 kdbhtosp                              @136      7994

--//前面kdbh.kdbhavsp=7946,fsc=44.
--// 7946+44 = 7990 .
--// 注意我以前测试过(注意计算不包括flag,lock的长度),这样还差4个字节.

BBED> assign dba 9,188 kdbh.kdbhavsp=7993
b2 kdbhavsp                                 @134      7993

--//人为造成一个错误,造成verify错误.

BBED> sum apply dba 9,188
Check value for File 9, Block 188:
current = 0x8516, required = 0x8516

BBED> verify dba 9,188
DBVERIFY - Verification starting
FILE = D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
BLOCK = 187

Block Checking: DBA = 37748923, Block Type = KTB-managed data block
data header at 0x215027c
kdbchk: the amount of space used is not equal to block size
        used=70 fsc=0 avsp=7993 dtl=8064
Block 187 failed with check code 6110

DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing   (Data) : 1
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0

--//dtl-used-fsc = avsp 或者是used+fsc+avsp=dtl.
used=70 fsc=0 avsp=7993 dtl=8064
8064-70-0 = 7994

BBED> assign dba 9,188 kdbh.kdbhavsp=7994
b2 kdbhavsp                                 @134      7994

BBED> sum apply dba 9,188
Check value for File 9, Block 188:
current = 0x8515, required = 0x8515

BBED> verify dba 9,188
DBVERIFY - Verification starting
FILE = D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
BLOCK = 187
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


目录
相关文章
|
数据库管理
[20180205]使用bbed相关问题.txt
[20180205]使用bbed相关问题.txt --//上个星期5使用bbed修改块遇到一些问题,做一个记录: 1.环境: SCOTT@book> @ ver1 PORT_STRING                    VERSION       ...
968 0
|
Oracle 关系型数据库 数据库管理
[20171124]bbed的使用问题2.txt
[20171124]bbed的使用问题2.txt --//bbed 是探究oracle数据块的好工具,有时候不用转储,直接可以它看oracle内部块的内部结构. --//在使用中要注意一些问题,昨天又犯类似错误,通过例子来说明: SCOTT@book> select rowid,dept.
1282 0
|
缓存 Oracle 关系型数据库
[20171122]rman filesystemio_options.txt
[20171122]rman备份与参数filesystemio_options设置.txt --//这几天写了几篇filesystemio_options参数设置的文章,单独测试这个参数对rman备份以及os缓存的影响.
993 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
1013 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1228 0
|
SQL Oracle 关系型数据库
[20171031]rman xxx Failure.txt
[20171031]rman xxx Failure.txt --//简单测试 List Failure, Advise Failure and Repair Failure命令在11g下,也许以后工作需要.
984 0
|
Oracle 关系型数据库 数据库
[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt --//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录: --//链接:http://www.
1153 0
|
数据库管理
[20161129]BBED-00209 invalid number.txt
[20161129]BBED-00209 invalid number (9524782f).txt --以前遇到的问题,现在补充测试看看。 BBED> modify /x 9524782f  offset 492 BBED-00209: invalid ...
1711 0
|
Oracle 关系型数据库 数据库管理
[20161124]bbed使用问题.txt
[20161124]bbed使用问题.txt --最近一致在使用bbed探究oracle数据库,遇到一些问题做一些记录。 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION  ...
905 0