当前位置: 首页 > news >正文

深入解析:Oracle数据块编辑工具( Oracle Block Editor Tool)-obet

太友好(从10g之后无法直接编译使用,win版本偏移量错误等),基于这些情况,结合当前ai的便利,自己动手写了一个基础版的obet(Oracle Block Editor Tool)【就是由于oracle后续版本对于bbed的支撑不下载obet】,用来实现在某些情况下Oracle 内容块的编辑工作.目前(2025年11月10日)发布第一版主要能力有:
1. 通过16进制查看数据文件任何偏移量位置的数据(d/dump)
2. 通过16进制编辑数据文件任何偏移量位置的数据(m/modify)
3. 对oracle 数据块的tailchk自动修复(tailchk apply)
4. 对oracle 数据块的checksum自动修复(sum apply)
5. 数据文件之间部分数据拷贝功能(coopy)
6. 支持p/print打印Oracle文件头结构

启动软件界面

[root@iZbp11c0qyuuo1gr7j98upZ tmp]# ./obet

=============================================

Welcome to Oracle Block Editor Tool (OBET)

=============================================

***** !!! For Oracle Internal Use only !!! *****

[Software Function Description]

- View and edit data block inhexadecimal format

- Automatically repair tailchk and checksum

- Copy data between different data files

- Mark data block as corrupted block

[Developer Information]

- Name: XiFenFei

- Phone: +86-17813235971

- Email: dba@xifenfei

- Q Q: 107644445

- WeChat: 17813235971

- Website: https://www.xifenfei.com

[Version Details]

- Software Version: v2025.11.001

- Build Date: 2025.11.07

=============================================

Type 'help'forcommandlist | 'exit'to quit

=============================================

==================================================

Software License Status: Authorized

==================================================

使用说明

OBET> help

OBET (Oracle Block Editor Tool) commands:

open<config_file> - Load filelist from config file(format: <num> <path>)

info - Show loaded filelist (from opencommand)

setfilename <path> - Set target filepath (required)

setfile<num> - Set filename using loaded filenumber (from openlist)

setblocksize <size> - Set block size (2048,4096,[8192],16384,32768)

setblock <num> - Set block number (starts from 0, default: 1)

setoffset <offset> - Set offset within block (< blocksize, default: 0)

setcount <bytes> - Set number of bytes to read(default: 32)

setmode edit/browse- Enable edit/browsemode

d/dump[options] - Display data (options: block X, offset Y, count N)

m/modify<hex> [opts] - Modify data with hex (opts: block X, offset Y)

undo - Undo last modification

sum[block X] - Calculate checksum forblock (default: current block)

sumapply [block X] - Apply checksum: write calculated value to block

tailchk [block X] - Calculate tailchk forblock (default: current block)

tailchk apply [block X] - Apply tailchk: write calculated value to block

copy <src> to <dest> - Copy data between files

<src> format: file,block,offset,count (e.g., 1,1,10,64)

<dest> format: file[,block][,offset] (e.g., 3 or 3,1 or 3,1,128)

corrupt [block X] - Mark block as corrupted (default: current block)

show - Display current settings (filename, blocksize, block, offset, count, mode)

license - Show/managesoftware license (registration code required)

version - Show software version and developer information

help - Show this help message

quit/exit- Exit OBET

加载数据文件

--使用open打开数据文件列表(格式: 编号 路径)

OBET> open/tmp/3.txt

Loaded 4 files from config file'/tmp/3.txt'.

OBET> info

Loaded files (4 total):

----------------------------------------

Number Path

----------------------------------------

1 /u01/xifenfei/system01.dbf

2 /u01/xifenfei/sysaux01.dbf

3 /u01/xifenfei/undotbs01.dbf

4 /u01/xifenfei/users01.dbf

----------------------------------------

OBET> setfile1

filename setto: /u01/xifenfei/system01.dbf (file#1)

--或者直接使用 setfilename

OBET> setfilename /tmp/system01.dbf

filename setto: /tmp/system01.dbf

进入数据文件特定位置

OBET> setfile2

filename setto: /u01/xifenfei/sysaux01.dbf (file#2)

OBET> setblock 5

block setto: 5

OBET> setoffset 128

offset setto: 128

16进制方式查看信息

OBET> d

File: /u01/xifenfei/system01.dbf

Block: 1 Offsets: 0 to 31

--------------------------------------------------------------------------------

00002000 0BA20000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

<32 bytes read>

OBET> dump block 521 offset 128

File: /u01/xifenfei/system01.dbf

Block: 521 Offsets: 128 to 159

--------------------------------------------------------------------------------

00412080 5E068D05 C6040000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes read>

OBET> setcount 128

count setto: 128

OBET> d

File: /u01/xifenfei/system01.dbf

Block: 1 Offsets: 0 to 127

--------------------------------------------------------------------------------

00002000 0BA20000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

00002020 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000

00002040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00002060 08024000 07000000 00000000 7DC92131 64676345 06200E00 00000000 00000000

<128 bytes read>

16进制方式修改数据块内容(一般修改数据块内容之后建议校验tailchk和sum)

OBET> d

File: /u01/xifenfei/system01.dbf

Block: 1 Offsets: 0 to 127

--------------------------------------------------------------------------------

00002000 0BA20000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

00002020 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000

00002040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00002060 08024000 07000000 00000000 7DC92131 64676345 06200E00 00000000 00000000

<128 bytes read>

OBET> m 0123

Confirm modification:

File: /u01/xifenfei/system01.dbf

Block: 1

Offset: 0 (fileoffset: 0x00002000)

Original value: 0B

New value: 0123

Confirm? (Y/YESto proceed): y

Verification successful: Data written correctly.

Modified 2 bytes at offset 0x00002000 successfully.

OBET> d

File: /u01/xifenfei/system01.dbf

Block: 1 Offsets: 0 to 127

--------------------------------------------------------------------------------

00002000 01230000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

00002020 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000

00002040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00002060 08024000 07000000 00000000 7DC92131 64676345 06200E00 00000000 00000000

<128 bytes read>

tail和checksum修改

OBET> tailchk

Check tailchk forFile /u01/xifenfei/system01.dbf, Block 1:

current = 0x010B0000, required = 0x01010000

OBET> sum

Check value forFile /u01/xifenfei/system01.dbf, Block 1:

current = 0x224D, required = 0x28CC

OBET> tailchk apply

Confirm applying tailchk:

File: /u01/xifenfei/system01.dbf

Block: 1

Offset inblock: 8188 (fileoffset: 0x00003FFC)

Original value: 0x010B0000

New value: 0x01010000

Confirm? (Y/YESto proceed): y

Verification successful: Stored tailchk matches calculated value (0x01010000).

Tailchk applied successfully.

OBET> sumapply

Confirm applying checksum:

File: /u01/xifenfei/system01.dbf

Block: 1

Offset inblock: 16 (fileoffset: 0x00002010)

Original value: 0x224D

New value: 0x28C6

Confirm? (Y/YESto proceed): y

Verification successful: Stored checksum matches calculated value (0x28C6).

Checksum applied successfully.

两个数据文件之前拷贝材料(一般copy数据之后建议校验tailchk和sum)
一般情况下记录之间的拷贝就是数据号不一样,比如修改checkpoint,resetlog信息等,这里拥护不一样偏移量,不一样数据块的拷贝

OBET> copy 1,1,0,128 to 3,5,128

Confirm copy:

Source: file#1 (/u01/xifenfei/system01.dbf), block 1, offset 0, 128 bytes

Target: file#3 (/u01/xifenfei/undotbs01.dbf), block 5, offset 128

Proceed? (Y/YESto confirm): y

Copy successful: 128 bytes copied from file#1 to file #3.

OBET> setfile3

filename setto: /u01/xifenfei/undotbs01.dbf (file#3)

OBET> d block 5 offset 128

File: /u01/xifenfei/undotbs01.dbf

Block: 5 Offsets: 128 to 255

--------------------------------------------------------------------------------

0000A080 0BA20000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

0000A0A0 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000

0000A0C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

0000A0E0 08024000 07000000 00000000 7DC92131 64676345 06200E00 00000000 00000000

<128 bytes read>

OBET> setfile1

filename setto: /u01/xifenfei/system01.dbf (file#1)

OBET> dump block 1 offset 0

File: /u01/xifenfei/system01.dbf

Block: 1 Offsets: 0 to 127

--------------------------------------------------------------------------------

00002000 0BA20000 01004000 00000000 00000104 224D0000 00000000 0004200B A2DB266A

00002020 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000

00002040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00002060 08024000 07000000 00000000 7DC92131 64676345 06200E00 00000000 00000000

<128 bytes read>

标记数据块为坏块能力

OBET> show

Current settings:

File: /u01/xifenfei/system01.dbf

Blocksize: 8192 bytes

Block: 1

Offset inblock: 0 (fileoffset: 0x00002000)

Count: 128 bytes

Mode: edit

Loaded files: 4 (use 'info'to list)

OBET> corrupt

Confirm modification:

File: /u01/xifenfei/system01.dbf

Block: 1

Offset: 14 (fileoffset: 0x0000200E)

Original value: 01

New value: FF

Are you sure to setthis block corrupted? (Y/YESto proceed): y

Verification successful: Block 1 marked as corrupted (offset 14 setto 0xFF).

Modification successful.

运用p/print打印文件头结构

OBET> p

Error: Missing param. The main commands include:

Supported structure display (one-level only):

p tailchk - Block tailcheck

p kcvfh - Complete KCVFH structure

p kcvfh.kcvfhbfh - File header block

p kcvfh.kcvfhhdr - File header descriptor

p kcvfh.kcvfhrdb - Database block

p kcvfh.kcvfhcrs - Creation SCN

p kcvfh.kcvfhcrt - Creation time

p kcvfh.kcvfhrlc - Reset log SCN

p kcvfh.kcvfhrls - Reset logs SCN

p kcvfh.kcvfhbti - Backup table info

p kcvfh.kcvfhbsc - Basic SCN

p kcvfh.kcvfhbth - Backup table header

p kcvfh.kcvfhsta - Status

p kcvfh.kcvfhbcp - Checkpoint info

p kcvfh.kcvfhbhz - Block size header

p kcvfh.kcvfhxcd - Extended checkpoint

p kcvfh.kcvfhtsn - Tablespace number

p kcvfh.kcvfhtln - Tablespace name length

p kcvfh.kcvfhtnm - Tablespace name

p kcvfh.kcvfhrfn - Relative filenumber

p kcvfh.kcvfhrfs - Recovery info

p kcvfh.kcvfhrft - Recovery time

p kcvfh.kcvfhafs - Auxiliary recovery

p kcvfh.kcvfhbcs - Backup control

p kcvfh.kcvfhofb - Offset bytes

p kcvfh.kcvfhnfb - Next offset bytes

p kcvfh.kcvfhprc - Recovery related

p kcvfh.kcvfhprs - Recovery structure

p kcvfh.kcvfhprfs - Recovery finish

p kcvfh.kcvfhcpc - Checkpoint count

p kcvfh.kcvfhrts - Reset time

p kcvfh.kcvfhccc - Change count

p kcvfh.kcvfhtrt - Total reset time

p kcvfh.kcvfhckp - Complex checkpoint

Note: Only one-level structure access is supported.

Example: 'p kcvfh.kcvfhhdr'shows the complete kcvfhhdr structure.

No multi-level access like 'p kcvfh.kcvfhhdr.kccfhtyp'is supported.

OBET> p kcvfh

File: /u01/xifenfei/users01.dbf

Size: 8192 bytes

Block: 1

struct kcvfh, 1272 bytes @0

struct kcvfhbfh, 20 bytes @0

ub1 type_kcbh @0 0x0B

ub1 frmt_kcbh @1 0xA2

ub2 wrp2_kcbh @2 0x0000

ub4 rdba_kcbh @4 0x01000001

ub4 bas_kcbh @8 0x00000000

ub2 wrp_kcbh @12 0x0000

ub1 seq_kcbh @14 0x01

ub1 flg_kcbh @15 0x04

ub2 chkval_kcbh @16 0x15CC

ub2 spare3_kcbh @18 0x0000

struct kcvfhhdr, 76 bytes @20

ub4 kccfhswv @20 0x00000000

ub4 kccfhcvn @24 0x0B200400

ub4 kccfhdbi @28 0x6A26DBA2

text kccfhdbn[8] @32-39 XIFENFEI

ub4 kccfhcsq @40 0x000002AC

ub4 kccfhfsz @44 0x00000280

s_blkz kccfhbsz @48 0x00

ub2 kccfhfno @52 0x0004

ub2 kccfhtyp @54 0x0003

ub4 kccfhacid @56 0x00000000

ub4 kccfhcks @60 0x00000000

text kccfhtag[32] @64-95

ub4 kcvfhrdb @96 0x00000000

struct kcvfhcrs, 8 bytes @100

ub4 kscnbas @100 0x00003F0F

ub2 kscnwrp @104 0x0000

ub2 kscnwrp2 @106 0x0000

ub4 kcvfhcrt @108 0x3121C98D

ub4 kcvfhrlc @112 0x45636764

struct kcvfhrls, 8 bytes @116

ub4 kscnbas @116 0x000E2006

ub2 kscnwrp @120 0x0000

ub2 kscnwrp2 @122 0x0000

ub4 kcvfhbti @124 0x00000000

struct kcvfhbsc, 8 bytes @128

ub4 kscnbas @128 0x00000000

ub2 kscnwrp @132 0x0000

ub2 kscnwrp2 @134 0x0000

ub2 kcvfhbth @136 0x0000

ub2 kcvfhsta @138 0x0000 (NONE)

struct kcvfhckp, 36 bytes @484

struct kcvcpscn, 8 bytes @484

ub4 kscnbas @484 0x000EB49E

ub2 kscnwrp @488 0x0000

ub2 kscnwrp2 @490 0x0000

ub4 kcvcptim @492 0x456367BB

ub2 kcvcpthr @496 0x0001

union u, 12 bytes @500

struct kcvcprba, 12 bytes @500

ub4 kcrbaseq @500 0x00000005

ub4 kcrbabno @504 0x000027A5

ub2 kcrbabof @508 0x0010

ub1 kcvcpetb[8] @512-519 02 00 00 00 00 00 00 00

ub4 kcvfhcpc @140 0x0000005B

ub4 kcvfhrts @144 0x45636739

ub4 kcvfhccc @148 0x0000005A

struct kcvfhbcp, 36 bytes @152

struct kcvcpscn, 8 bytes @152

ub4 kscnbas @152 0x00000000

ub2 kscnwrp @156 0x0000

ub2 kscnwrp2 @158 0x0000

ub4 kcvcptim @160 0x00000000

ub2 kcvcpthr @164 0x0000

union u, 12 bytes @168

struct kcvcprba, 12 bytes @168

ub4 kcrbaseq @168 0x00000000

ub4 kcrbabno @172 0x00000000

ub2 kcrbabof @176 0x0000

ub1 kcvcpetb[8] @180-187 00 00 00 00 00 00 00 00

ub4 kcvfhbhz @312 0x00000000

struct kcvfhxcd, 16 bytes @316

ub4 space_kcvmxcd[0] @316 0x00000000

ub4 space_kcvmxcd[1] @320 0x00000000

ub4 space_kcvmxcd[2] @324 0x00000000

ub4 space_kcvmxcd[3] @328 0x00000000

sword kcvfhtsn @332 4

ub2 kcvfhtln @336 0x0005

text kcvfhtnm[30] @338-367 USERS

ub4 kcvfhrfn @368 0x00000004

struct kcvfhrfs, 8 bytes @372

ub4 kscnbas @372 0x00000000

ub2 kscnwrp @376 0x0000

ub2 kscnwrp2 @378 0x0000

ub4 kcvfhrft @380 0x00000000

struct kcvfhafs, 8 bytes @384

ub4 kscnbas @384 0x00000000

ub2 kscnwrp @388 0x0000

ub2 kscnwrp2 @390 0x0000

ub4 kcvfhbbc @392 0x00000000

ub4 kcvfhncb @396 0x00000000

ub4 kcvfhmcb @400 0x00000000

ub4 kcvfhlcb @404 0x00000000

ub4 kcvfhbcs @408 0x00000000

ub2 kcvfhofb @412 0x0000

ub2 kcvfhnfb @414 0x0000

ub4 kcvfhprc @416 0x3121C97A

struct kcvfhprs, 8 bytes @420

ub4 kscnbas @420 0x00000001

ub2 kscnwrp @424 0x0000

ub2 kscnwrp2 @426 0x0000

struct kcvfhprfs, 8 bytes @428

ub4 kscnbas @428 0x00000000

ub2 kscnwrp @432 0x0000

ub2 kscnwrp2 @434 0x0000

ub4 kcvfhtrt @444 0x00000000

<kcvfh structure printed successfully>

OBET>

OBET> p kcvfh.kcvfhckp

File: /u01/xifenfei/users01.dbf

Size: 8192 bytes

Block: 1

Offset: 448

struct kcvfhckp, 36 bytes @484

struct kcvcpscn, 8 bytes @484

ub4 kscnbas @484 0x000EB49E

ub2 kscnwrp @488 0x0000

ub2 kscnwrp2 @490 0x0000

ub4 kcvcptim @492 0x456367BB

ub2 kcvcpthr @496 0x0001

union u, 12 bytes @500

struct kcvcprba, 12 bytes @500

ub4 kcrbaseq @500 0x00000005

ub4 kcrbabno @504 0x000027A5

ub2 kcrbabof @508 0x0010

ub1 kcvcpetb[8] @512-519 02 00 00 00 00 00 00 00

<kcvfh.kcvfhckp structure printed successfully>

由于该工具直接编辑Oracle 底层数据块操作具有一定的破坏性和风险性,所以在没有授权的情况下无法对数据块进行修改(只能查看),具体授权操作

OBET> license

========================================

Software Registration

========================================

Your Hardware ID: XXXXXXXX ----->提供给我

Please send your Hardware ID to XiFenFei to register.

Website: https://www.xifenfei.com

Tel/WX: +86-17813235971

Enter Registration Code: XXXXXX-XXXXXXXX <-----输入注册码进行授权

Registration successful!

http://www.jsqmd.com/news/355558/

相关文章:

  • 当AI人才被哄抢,Java程序员却求职无门:揭秘技术圈的残酷裂变与生存指南! - 教程
  • 公安心理测评系统厂商推荐:2026谁能当好万千民警的心灵守护者? - 健成星云
  • 解读商业密码,营销管理经典实战书籍推荐
  • 高原缺氧环境下的AI压力测试术:挑战、实战与优化策略
  • hello_agent第八章总结
  • 财务人员必看的三本书,财务会计基础入门必备
  • 流量红利下的技术人突围:测试工程师的内容创作方法论
  • 2026年2月阻尼器厂家推荐,旋转阻尼器/车载阻尼器制造公司选择指南 - 品致汇
  • 管理学从入门到进阶必读的五本经典书籍推荐
  • 时间管理书籍推荐:如果只读一本,我会选这本
  • 企业战略管理必看书籍推荐与阅读建议
  • 【毕业设计】java-springboot+vue“智慧食堂”设计与实现
  • 郑州恒达感应加热设备:20年深耕,工业加热解决方案领跑者 - 朴素的承诺
  • 公安心理测评系统2026排行榜,谁才是民警身后可靠的心灵守护者? - 健成星云
  • 财务管理十大必看书籍推荐
  • Web学习之Restful风格
  • 全链赋能 智会未来:AIX艾可视会议一体机引领行业新生态 - 朴素的承诺
  • ‌情绪计算测试:多生理信号在情感识别模型的融合验证框架‌ ‌
  • 超级文件粉碎机(文件清理、隐私销毁、文件解锁、文件删除、机密文件)
  • AIX艾可视广告机:全链赋能 智领数字化传播新生态 - 朴素的承诺
  • AIX艾可视:液晶拼接屏领军者 一站式音视频解决方案标杆 - 朴素的承诺
  • 巩义市万众给排水:橡胶软接头领航者,铸就高压力大口径品质标杆 - 朴素的承诺
  • Android 15 ServiceManager与Binder服务注册深度解析
  • 地表最强编程王者PK!Opus 4.6双榜单封神, Codex 5.3速度满分
  • 2026最新云石胶源头厂家top5推荐!国内优质云石胶权威品牌榜单发布,资质服务双优助力高品质建材应用 - 品牌推荐2026
  • 2026年专业深度测评:中国排名前五的GEO获客优化机构权威 - 电商资讯
  • AIX艾可视:LED显示屏一站式解决方案,赋能全场景智慧视界 - 朴素的承诺
  • 郑州恒达感应加热设备:深耕19年,赋能制造业智能升级 - 朴素的承诺
  • 巩义市万众给排水:高端橡胶软接头引领者,赋能多行业管道安全 - 朴素的承诺
  • 量子纠缠网络:分布式AI的终极形态