[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


目录
相关文章
|
2天前
|
监控 网络协议 算法
2026年起SSL证书有效期逐年缩短:企业如何避免“续期风暴”!
SSL证书有效期将从2026年起分三阶段逐步缩短至47天,人工续期难以为继。阿里云“WoSign SSL证书+自动化服务”,支持域名监控、自动托管、云产品/服务器一键部署及智能提醒,助力企业高效应对高频续期挑战。
8083 2
|
12天前
|
域名解析 人工智能 Linux
|
20天前
|
人工智能
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
进不去 Antigravity 或 Gemini,提示所在地区不可用?三步查清 Google 账号关联地区、官方更正表单理由选法与改区注意事项。
10374 13
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
|
6天前
|
人工智能 安全 网络安全
|
10天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是 DeepSeek AI 开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、执行命令、处理表格等自动化任务;免费开源,兼容 Win/macOS,需配 API 密钥使用。(239字)
1567 5
|
9天前
|
云安全 数据采集 人工智能
|
17天前
|
人工智能 开发工具 开发者
2026最新codex下载安装保姆级使用教程(下载+安装+登录+使用,含所有历史版本)
Codex 是 OpenAI 推出的开源 AI 编程智能体,跑在本地终端和桌面客户端里,能读懂整个代码仓库,一句自然语言就能让它改代码、执行命令、跑测试、修 Bug,支持 Windows、macOS、Linux 三大平台。本文把 Codex下载、安装、登录、汉化、基础使用一次讲全,并整理了国内用户最常踩的坑,跟着做 10 分钟就能跑起来。
2716 8
|
9天前
|
Web App开发 缓存 安全
巨魔商店 TrollStore 安装教程(2026):免电脑在线安装与全机型安装器矩阵_iOS巨魔安装
巨魔商店(TrollStore)是iOS 14–17.0(特定版本)的永久签名工具,无需越狱,利用CoreTrust漏洞实现IPA签名长期有效,彻底告别7天重签。支持免电脑在线安装(TrollHelperOTA),适配多机型/系统组合,开源免费,安全可控。(239字)
2487 0