标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr MySQL恢复 obet ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kcratr_nab_less_than_odr ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 ORACLE恢复 Oracle 恢复 ORACLE数据库恢复 oracle碎片 OSD-04016 YOUR FILES ARE ENCRYPTED 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (112)
- 数据库 (1,874)
- DB2 (22)
- MySQL (82)
- Oracle (1,700)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (72)
- Oracle Bug (8)
- Oracle RAC (56)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (657)
- Oracle安装升级 (107)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (90)
- PostgreSQL (37)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (5)
- 达梦恢复 (3)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (51)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (34)
-
最近发表
- 不当数据库恢复操作导致一个月数据丢失
- obet快速修复oracle 位图损坏块
- 不太常见的10.2.0.1的oracle redo损坏恢复
- obet forcecopy功能抢救硬件故障中的数据文件
- kcratr_nab_less_than_odr和system坏块故障处理
- 通过obet 恢复system坏块,打开数据库
- obet dbv功能完整说明
- 分享一例运行在aix上的sap系统数据库恢复过程
- OBET-Oracle Block Editor Tool使用说明
- 几乎动用了所有手段的Oracle故障恢复
- Oracle Block Edit Tool (obet) 功能增强–2026.07
- Oracle 19c 202607补丁(RUs+OJVM)-19.32
- Patch_SCN快速修复ORA-01555数据库open故障
- 快速处理 ORA-01210: data file header is media corrupt 故障
- ORA-00314: log 3 of thread 1, expected sequence# N doesn’t match 0
- 记录block 0损坏,数据文件大量坏块,使用不当数据库版本恢复等各种操作之后的故障处理
- 需要注意:dbv 检测controlfile可能不准
- 达梦数据库redo异常强制拉库
- dd破坏包含50多个pdb的asm 磁盘组恢复
- Oracle数据库系统回滚段异常处理-ORA-600 4137/4193
标签归档:obet修改scn
obet一键恢复offline数据文件
客户有一个数据库由于异常断电之后无法正常启动,自行尝试恢复之后但是没有open成功,让可以通过Oracle数据库异常恢复检查脚本(Oracle Database Recovery Check)脚本收集信息进行评估,发现两个问题:
1. 根据查询信息确认users01.dbf(file# 4)文件处于offline状态,而且checkpoint scn明显小于其他文件

2. 通过分析alert日志确认客户在尝试offline file 4 之后open数据库报ORA-600 4194错误,数据库没有open成功
Mon Mar 30 06:26:30 2026 Starting ORACLE instance (normal) Mon Mar 30 06:27:00 2026 ALTER DATABASE DATAFILE 4 OFFLINE DROP Completed: ALTER DATABASE DATAFILE 4 OFFLINE DROP Mon Mar 30 06:27:26 2026 ALTER DATABASE OPEN Beginning crash recovery of 1 threads parallel recovery started with 7 processes Started redo scan Completed redo scan read 88 KB redo, 103 data blocks need recovery Started redo application at Thread 1: logseq 3, block 3 Recovery of Online Redo Log: Thread 1 Group 3 Seq 3 Reading mem 0 Mem# 0: /home/oracle/app/oracle/oradata/orcl/redo03.log Completed redo application of 0.07MB Completed crash recovery at Thread 1: logseq 3, block 180, scn 415466134 103 data blocks read, 103 data blocks written, 88 redo k-bytes read Mon Mar 30 06:27:28 2026 Thread 1 advanced to log sequence 4 (thread open) Thread 1 opened at log sequence 4 Current log# 1 seq# 4 mem# 0: /home/oracle/app/oracle/oradata/orcl/redo01.log Successful open of redo thread 1 MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set Mon Mar 30 06:27:28 2026 SMON: enabling cache recovery Successfully onlined Undo Tablespace 2. Verifying file header compatibility for 11g tablespace encryption.. Verifying 11g file header compatibility for tablespace encryption completed SMON: enabling tx recovery Database Characterset is ZHS16GBK No Resource Manager plan active Errors in file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_smon_17628.trc(incident=186839): ORA-00600: internal error code, arguments: [4194], [], [], [], [], [], [], [], [], [], [], [] Incident details in: /home/oracle/app/oracle/diag/rdbms/orcl/orcl/orcl_smon_17628_i186839.trc Exception [type: SIGBUS, Non-existent physical address] [ADDR:0x6C0C4B62] [PC:0x2297750, kgegpa()+40] Exception [type: SIGBUS, Non-existent physical address] [ADDR:0x6C0C4B62] [PC:0x229597B, kgebse()+279] Mon Mar 30 06:27:28 2026 PMON (ospid: 17604): terminating the instance due to error 397 Errors in file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_smon_17628.trc: ORA-00328: archived log ends at change 415466135, need later change 415466136 ORA-00334: archived log: '/home/oracle/app/oracle/oradata/orcl/redo03.log' ORA-00600: internal error code, arguments: [4194], [], [], [], [], [], [], [], [], [], [], [] Instance terminated by PMON, pid = 17604
接手这个故障之后,由于数据库是非归档模式,而且已经被屏蔽一致性强制打开过(open过程没成功),redo已经被clear过,因此基于这样的情况,直接上obet工具(Oracle Block Editor Tool修改file# 4的文件头状态
obet修复之前文件状态
STATUS CHECKPOINT_TIME FUZ CHECKPOINT_CHANGE# ROW_NUM ------- ---------------------------------------- --- ------------------ ---------------- OFFLINE 2026-03-30 06:24:41 YES 415446014 1 ONLINE 2026-03-30 06:28:26 YES 415486184 7
obet修改文件头操作
OBET> open listfile.txt
Loaded 8 files from datafile list 'listfile.txt'.
OBET> info
Loaded files (2 total):
----------------------------------------
Number Path
----------------------------------------
1 /home/oracle/app/oracle/oradata/orcl/system01.dbf
4 /opt/oradata/orcl/users01.dbf
----------------------------------------
OBET> set mode edit
mode set to: edit
OBET> set file 4
filename set to: /opt/oradata/orcl/users01.dbf (file#4)
OBET> backup block 1
Created backup directory: backup_blk
Successfully backed up block 1 from current file to /tmp/backup_blk/users01.dbf_1.20260331092333
OBET> copy chkscn file 1 to file 4
Confirm Modify chkscn:
Source: file#1 (/home/oracle/app/oracle/oradata/orcl/system01.dbf)
Target: file#4 (/opt/oradata/orcl/users01.dbf)
Proceed? (Y/YES to confirm): y
Successfully copied checkpoint SCN information from file#1 to file#4.
OBET> exit
Exiting OBET.
再次查询文件头scn信息
STATUS CHECKPOINT_TIME FUZ CHECKPOINT_CHANGE# ROW_NUM ------- ---------------------------------------- --- ------------------ ---------------- OFFLINE 2026-03-30 06:28:26 NO 415486184 1 ONLINE 2026-03-30 06:28:26 YES 415486184 7
尝试online文件,并open库成功
SQL> recover datafile 4; Media recovery complete. SQL> alter database datafile 4 online; Database altered. SQL> alter database open; Database altered.
obet(Oracle Block Editor Tool)第二版发布
在几天之前发布了obet的第一个版本(Oracle数据块编辑工具( Oracle Block Editor Tool)-obet),最近对功能进行了一些完善,并发布第二版
obet工具下载地址:obet下载
obet工具使用说明:obet使用说明
主要增加了以下几个功能:
0) corrupt [block x] 命令主要用于标记坏块功能(在第一版中已经完善)
1) repair [block x] 命令对于坏块的自动修复,主要包括checksum,tailchk,seq_kcbh等
2)增加copy chkscn 命令主要用于对文件头的checkpoint scn相关信息修复
3)增加copy resetlogscn命令主要用于对文件头的resetlogs相关信息修复
4)把之前的copy命令调整为copy data命令格式
5)增加copy block命令主要用于数据文件之间的数据块直接拷贝
该版本的help命令提示
OBET (Oracle Block Editor Tool) commands:
open <config_file> - Load file list from config file (format: <num> <path>)
info - Show loaded file list (from open command)
set filename <path> - Set target file path (required)
set file <num> - Set filename using loaded file number (from open list)
set blocksize <size> - Set block size (2048,4096,[8192],16384,32768)
set block <num> - Set block number (starts from 0, default: 1)
set offset <offset> - Set offset within block (< blocksize, default: 0)
set count <bytes> - Set number of bytes to read (default: 32)
set mode edit/browse - Enable edit/browse mode
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 for block (default: current block)
sum apply [block X] - Apply checksum: write calculated value to block
tailchk [block X] - Calculate tailchk for block (default: current block)
tailchk apply [block X] - Apply tailchk: write calculated value to block
repair [block X] - Repair bad block (fix seq_kcbh, tailchk, checksum)
copy data <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)
copy block file#,block# to file#,block# - Copy entire data block
copy chkscn file n to file m - Copy datafile header checkpoint SCN info
copy resetlogscn file n to file m - Copy datafile header resetlogs info
corrupt [block X] - Mark block as corrupted (default: current block)
show - Display current settings (filename, blocksize, block, offset, count, mode)
license - Show/manage software license (registration code required)
version - Show software version and developer information
p/print <param> - Print Oracle structure,Use the 'p/print' command to see details
undo - Undo the last copy chkscn or copy resetlogscn operation
help - Show this help message
quit/exit - Exit OBET
copy block功能演示
随便把一个block拷贝到文件的另外位置,也可以拷贝到不同文件的其他位置,根据需要调整
OBET> copy block 1,1 to 1,5 Confirm copy block: Source: file#1 (/u01/xifenfei/system01.dbf), block 1 (entire 8192-byte block) Target: file#1 (/u01/xifenfei/system01.dbf), block 5 (entire 8192-byte block) Proceed? (Y/YES to confirm): y Successfully copied block 1 from file#1 to block 5 in file#1 (8192 bytes). OBET> set file 1 filename set to: /u01/xifenfei/system01.dbf (file#1) OBET> set count 128 count set to: 128 OBET> dump block 1 offset 0 File: /u01/xifenfei/system01.dbf Block: 1 Offsets: 0 to 127 -------------------------------------------------------------------------------- 00002000 01230000 01004000 00000000 00000104 28C60000 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 12345678 87654321 00000000 00000000 <128 bytes read> OBET> dump block 5 offset 0 File: /u01/xifenfei/system01.dbf Block: 5 Offsets: 0 to 127 -------------------------------------------------------------------------------- 0000A000 01230000 01004000 00000000 00000104 28C60000 00000000 0004200B A2DB266A 0000A020 58494645 4E464549 AC020000 00720100 00200000 01000300 00000000 00000000 0000A040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000A060 08024000 07000000 00000000 7DC92131 12345678 87654321 00000000 00000000 <128 bytes read>
copy chkscn功能演示
OBET> p kcvfh.kcvfhckp
File: H:\xifenfei\system01.dbf
Size: 8192 bytes
Block: 1
Offset: 484
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0x1BDDBF09
ub2 kscnwrp @488 0x163D
ub2 kscnwrp2 @490 0x0000
ub4 kcvcptim @492 0x488361FC
ub2 kcvcpthr @496 0x0001
union u, 12 bytes @500
struct kcvcprba, 12 bytes @500
ub4 kcrbaseq @500 0x0006E3D3
ub4 kcrbabno @504 0x0000B44B
ub2 kcrbabof @508 0x0010
ub1 kcvcpetb[8] @512-519 02 00 00 00 00 00 00 00
OBET> p kcvfh.kcvfhckp
File: H:\xifenfei\sysaux01.dbf
Size: 8192 bytes
Block: 1
Offset: 484
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0x67452301
ub2 kscnwrp @488 0x0000
ub2 kscnwrp2 @490 0x0000
ub4 kcvcptim @492 0x00000000
ub2 kcvcpthr @496 0x0000
union u, 12 bytes @500
struct kcvcprba, 12 bytes @500
ub4 kcrbaseq @500 0x0006E3D3
ub4 kcrbabno @504 0x0000B44B
ub2 kcrbabof @508 0x0010
ub1 kcvcpetb[8] @512-519 02 00 00 00 00 00 00 00
<kcvfh.kcvfhckp structure printed successfully>
OBET> copy chkscn file 1 to file 2
Confirm Modify chkscn:
Source: file#1 (H:\xifenfei\system01.dbf)
Target: file#2 (H:\xifenfei\sysaux01.dbf)
Proceed? (Y/YES to confirm): y
Successfully copied checkpoint SCN information from file#1 to file#2.
OBET> p kcvfh.kcvfhckp
File: H:\xifenfei\sysaux01.dbf
Size: 8192 bytes
Block: 1
Offset: 484
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0x1BDDBF09
ub2 kscnwrp @488 0x163D
ub2 kscnwrp2 @490 0x0000
ub4 kcvcptim @492 0x488361FC
ub2 kcvcpthr @496 0x0001
union u, 12 bytes @500
struct kcvcprba, 12 bytes @500
ub4 kcrbaseq @500 0x0006E3D3
ub4 kcrbabno @504 0x0000B44B
ub2 kcrbabof @508 0x0010
ub1 kcvcpetb[8] @512-519 02 00 00 00 00 00 00 00
<kcvfh.kcvfhckp structure printed successfully>
copy resetlogscn功能演示
OBET> p kcvfh.kcvfhrlc File: H:\xifenfei\system01.dbf Size: 8192 bytes Block: 1 Offset: 112 ub4 kcvfhrlc @112 0x3215EC5C <kcvfh.kcvfhrlc structure printed successfully> OBET> p kcvfh.kcvfhrls File: H:\xifenfei\system01.dbf Size: 8192 bytes Block: 1 Offset: 116 struct kcvfhrls, 8 bytes @116 ub4 kscnbas @116 0x000E74FF ub2 kscnwrp @120 0x0000 ub2 kscnwrp2 @122 0x0000 <kcvfh.kcvfhrls structure printed successfully> OBET> p kcvfh.kcvfhrlc File: H:\xifenfei\sysaux01.dbf Size: 8192 bytes Block: 1 Offset: 112 ub4 kcvfhrlc @112 0x67452301 <kcvfh.kcvfhrlc structure printed successfully> OBET> p kcvfh.kcvfhrls File: H:\xifenfei\sysaux01.dbf Size: 8192 bytes Block: 1 Offset: 116 struct kcvfhrls, 8 bytes @116 ub4 kscnbas @116 0x43658709 ub2 kscnwrp @120 0x0021 ub2 kscnwrp2 @122 0x0000 <kcvfh.kcvfhrls structure printed successfully> OBET> copy resetlogscn file 1 to file 2 Confirm Modify resetlogscn: Source: file#1 (H:\xifenfei\system01.dbf) Target: file#2 (H:\xifenfei\sysaux01.dbf) Proceed? (Y/YES to confirm): y Successfully copied resetlog SCN information from file#1 to file#2. OBET> p kcvfh.kcvfhrlc File: H:\xifenfei\sysaux01.dbf Size: 8192 bytes Block: 1 Offset: 112 ub4 kcvfhrlc @112 0x3215EC5C <kcvfh.kcvfhrlc structure printed successfully> OBET> p kcvfh.kcvfhrls File: H:\xifenfei\sysaux01.dbf Size: 8192 bytes Block: 1 Offset: 116 struct kcvfhrls, 8 bytes @116 ub4 kscnbas @116 0x000E74FF ub2 kscnwrp @120 0x0000 ub2 kscnwrp2 @122 0x0000 <kcvfh.kcvfhrls structure printed successfully>
corrupt [block x]标记坏块功能
C:\Users\XFF>dbv file=h:/xifenfei/users01.dbf DBVERIFY: Release 11.2.0.4.0 - Production on 星期三 11月 12 21:40:55 2025 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. DBVERIFY - 开始验证: FILE = H:\XIFENFEI\USERS01.DBF DBVERIFY - 验证完成 检查的页总数: 26656 处理的页总数 (数据): 23569 失败的页总数 (数据): 0 处理的页总数 (索引): 309 失败的页总数 (索引): 0 处理的页总数 (其他): 720 处理的总页数 (段) : 0 失败的总页数 (段) : 0 空的页总数: 2058 标记为损坏的总页数: 0 流入的页总数: 0 加密的总页数 : 0 最高块 SCN : 2255414715 (18.2255414715) OBET> corrupt block 10 Confirm modification: File: h:/xifenfei/users01.dbf Block: 10 Offset: 14 (file offset: 0x0001400E) Original value: 01 New value: FF Are you sure to set this block corrupted? (Y/YES to proceed): y Verification successful: Block 10 marked as corrupted (offset 14 set to 0xFF). Modification successful. C:\Users\XFF>dbv file=h:/xifenfei/users01.dbf DBVERIFY: Release 11.2.0.4.0 - Production on 星期三 11月 12 21:41:22 2025 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. DBVERIFY - 开始验证: FILE = H:\XIFENFEI\USERS01.DBF 页 10 流入 - 很可能是介质损坏 Corrupt block relative dba: 0x0100000a (file 4, block 10) Fractured block found during dbv: Data in bad block: type: 30 format: 2 rdba: 0x0100000a last change scn: 0x0000.00003e78 seq: 0xff flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x3e781e01 check value in block header: 0x1a6 computed block checksum: 0xfe DBVERIFY - 验证完成 检查的页总数: 26656 处理的页总数 (数据): 23569 失败的页总数 (数据): 0 处理的页总数 (索引): 309 失败的页总数 (索引): 0 处理的页总数 (其他): 719 处理的总页数 (段) : 0 失败的总页数 (段) : 0 空的页总数: 2058 标记为损坏的总页数: 1 流入的页总数: 1 加密的总页数 : 0 最高块 SCN : 2255414715 (18.2255414715)
repair [block x]修复坏块功能
C:\Users\XFF>dbv file=h:/xifenfei/undo01.dbf DBVERIFY: Release 11.2.0.4.0 - Production on 星期日 11月 16 00:06:59 2025 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. DBVERIFY - 开始验证: FILE = H:\XIFENFEI\UNDO01.DBF 页 2 流入 - 很可能是介质损坏 Corrupt block relative dba: 0x02000002 (file 8, block 2) Fractured block found during dbv: Data in bad block: type: 29 format: 2 rdba: 0x02000002 last change scn: 0x163d.1bddbcfa seq: 0xff flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0xbcfa1d02 check value in block header: 0xec11 computed block checksum: 0xfd DBVERIFY - 验证完成 检查的页总数: 4880 处理的页总数 (数据): 0 失败的页总数 (数据): 0 处理的页总数 (索引): 0 失败的页总数 (索引): 0 处理的页总数 (其他): 4372 处理的总页数 (段) : 11 失败的总页数 (段) : 0 空的页总数: 507 标记为损坏的总页数: 1 流入的页总数: 1 加密的总页数 : 0 最高块 SCN : 467517187 (5693.467517187) OBET> repair Repairing block 2 in file H:\xifenfei\undo01.dbf... Repair analysis for block 2: 1. seq_kcbh check: 0xFF -> needs repair (0x01) 2. Tailchk check: 0x021DFABC -> needs repair (0x011DFABC) 3. Checksum check: 0x11EC -> OK Confirm repair operations: File: H:\xifenfei\undo01.dbf Block: 2 Operations needed: fix offset14, fix tailchk Confirm? (Y/YES to proceed): y Verification after repair: 1. seq_kcbh: 0x01 OK 2. Tailchk: 0x011DFABC OK 3. Checksum: 0x11EC OK Block 2 repair completed successfully. C:\Users\XFF>dbv file=h:/xifenfei/undo01.dbf DBVERIFY: Release 11.2.0.4.0 - Production on 星期日 11月 16 00:07:29 2025 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. DBVERIFY - 开始验证: FILE = H:\XIFENFEI\UNDO01.DBF DBVERIFY - 验证完成 检查的页总数: 4880 处理的页总数 (数据): 0 失败的页总数 (数据): 0 处理的页总数 (索引): 0 失败的页总数 (索引): 0 处理的页总数 (其他): 4373 处理的总页数 (段) : 11 失败的总页数 (段) : 0 空的页总数: 507 标记为损坏的总页数: 0 流入的页总数: 0 加密的总页数 : 0 最高块 SCN : 467517187 (5693.467517187)


加我微信(17813235971)
加我QQ(107644445)

