问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

如何恢复“文件头数据与类型不匹配”文件?

发布网友 发布时间:2022-04-14 14:22

我来回答

3个回答

懂视网 时间:2022-04-14 18:43

SYS@orcl11galter database datafile 6 online;alter database datafile 6 online*ERROR at line 1:ORA-01113: file 6 needs media recoveryORA-01110: data file 6: /opt/oracle/oradata/orcl11g/zbdba01.dbf 有时候我们数据文件offline之后,再online需要

SYS@orcl11g>alter database datafile 6 online;
alter database datafile 6 online
*
ERROR at line 1:
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/opt/oracle/oradata/orcl11g/zbdba01.dbf'
有时候我们数据文件offline之后,再online需要介质恢复
SYS@orcl11g>select file#,name,status from v$datafile;
 FILE# NAME        STATUS
---------- ------------------------------------------------------------ ------------------------------------------------------------
  1 /opt/oracle/oradata/orcl11g/system01.dbf   SYSTEM
  2 /opt/oracle/oradata/orcl11g/sysaux01.dbf   ONLINE
  3 /opt/oracle/oradata/orcl11g/undotbs01.dbf   ONLINE
  4 /opt/oracle/oradata/orcl11g/users01.dbf   ONLINE
  5 /opt/oracle/oradata/orcl11g/zbdba.dbf   ONLINE
  6 /opt/oracle/oradata/orcl11g/zbdba01.dbf   RECOVER
  7 /opt/oracle/oradata/orcl11g/test.dbf    ONLINE


但是我们归档已经丢失,无法完成介质恢复:
SYS@orcl11g>recover datafile 6;
ORA-00279: change 1986632 generated at 10/28/2014 05:16:11 needed for thread 1
ORA-00289: suggestion : /opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_28/o1_mf_1_74_b4yqrglr_.arc
ORA-00280: change 1986632 for thread 1 is in sequence #74


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log '/opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_28/o1_mf_1_74_b4yqrglr_.arc'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
所以这时候我们直接修改文件头进行online:
[oracle@ogg1 lib]$ bbed parfile=par.txt
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Tue Oct 28 05:20:19 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

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

BBED>
BBED>
BBED> info all
File# Name       Size(blks)
----- ----       ----------
 1 /opt/oracle/oradata/orcl11g/system01.dbf    0
 2 /opt/oracle/oradata/orcl11g/sysaux01.dbf    0
 3 /opt/oracle/oradata/orcl11g/undotbs01.dbf    0
 4 /opt/oracle/oradata/orcl11g/users01.dbf    0
 5 /opt/oracle/oradata/orcl11g/zbdba.dbf    0
 6 /opt/oracle/oradata/orcl11g/zbdba01.dbf    0
 7 /opt/oracle/oradata/orcl11g/test.dbf     0

BBED> set file 1 block 1
 FILE#  1
 BLOCK#  1

BBED> p kcvfhckp
struct kcvfhckp, 36 bytes   @484 
 struct kcvcpscn, 8 bytes   @484 
 ub4 kscnbas    @484 0x001e526c
 ub2 kscnwrp    @488 0x0000
 ub4 kcvcptim    @492 0x3362e202
 ub2 kcvcpthr    @496 0x0001
 union u, 12 bytes   @500 
 struct kcvcprba, 12 bytes  @500 
  ub4 kcrbaseq   @500 0x0000004d
  ub4 kcrbabno   @504 0x000001a6
  ub2 kcrbabof   @508 0x0010
 ub1 kcvcpetb[0]    @512 0x02
 ub1 kcvcpetb[1]    @513 0x00
 ub1 kcvcpetb[2]    @514 0x00
 ub1 kcvcpetb[3]    @515 0x00
 ub1 kcvcpetb[4]    @516 0x00
 ub1 kcvcpetb[5]    @517 0x00
 ub1 kcvcpetb[6]    @518 0x00
 ub1 kcvcpetb[7]    @519 0x00

BBED> p kcvfhcpc
ub4 kcvfhcpc    @140 0x000000f9

BBED> p kcvfhccc
ub4 kcvfhccc    @148 0x000000f8

BBED> set file 6 block 1
 FILE#  6
 BLOCK#  1

BBED> p kcvfhckp
struct kcvfhckp, 36 bytes   @484 
 struct kcvcpscn, 8 bytes   @484 
 ub4 kscnbas    @484 0x001e5048
 ub2 kscnwrp    @488 0x0000
 ub4 kcvcptim    @492 0x3362e11b
 ub2 kcvcpthr    @496 0x0001
 union u, 12 bytes   @500 
 struct kcvcprba, 12 bytes  @500 
  ub4 kcrbaseq   @500 0x0000004a
  ub4 kcrbabno   @504 0x00005801
  ub2 kcrbabof   @508 0x0010
 ub1 kcvcpetb[0]    @512 0x02
 ub1 kcvcpetb[1]    @513 0x00
 ub1 kcvcpetb[2]    @514 0x00
 ub1 kcvcpetb[3]    @515 0x00
 ub1 kcvcpetb[4]    @516 0x00
 ub1 kcvcpetb[5]    @517 0x00
 ub1 kcvcpetb[6]    @518 0x00
 ub1 kcvcpetb[7]    @519 0x00

BBED> p kcvfhcpc
ub4 kcvfhcpc    @140 0x0000043c

BBED> p kcvfhccc
ub4 kcvfhccc    @148 0x0000043b

BBED> modify /x 6c52 offset 484
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 1  Offsets: 484 to 995  Dba:0x01800001
------------------------------------------------------------------------
6c521e00 00000000 1be16233 01000000 4a000000 01580000 10000000 02000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0d000d00 0d000100 00000000 00000000 00000000 02008001 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> modify /x 02e2 offset 492
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 1  Offsets: 492 to 1003  Dba:0x01800001
------------------------------------------------------------------------
02e26233 01000000 4a000000 01580000 10000000 02000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 0d000d00 0d000100
00000000 00000000 00000000 02008001 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> modify /x f900 offset 140
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 1  Offsets: 140 to 651  Dba:0x01800001
------------------------------------------------------------------------
f9000000 7fe16233 3b040000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
06000000 05005a42 44424100 00000000 00000000 00000000 00000000 00000000
00000000 06000000 00000000 00000000 a3d96233 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 6b946b29 01000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 6c521e00 00000000
02e26233 01000000 4a000000 01580000 10000000 02000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 0d000d00 0d000100

<32 bytes per line>

BBED> modify /x f800 offset 148
File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
Block: 1  Offsets: 148 to 659  Dba:0x01800001
------------------------------------------------------------------------
f8000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 06000000 05005a42
44424100 00000000 00000000 00000000 00000000 00000000 00000000 06000000
00000000 00000000 a3d96233 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 6b946b29 01000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 6c521e00 00000000 02e26233 01000000
4a000000 01580000 10000000 02000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 0d000d00 0d000100 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 6, Block 1:
current = 0x1924, required = 0x1924

BBED> verify
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/orcl11g/zbdba01.dbf
BLOCK = 1


DBVERIFY - Verification complete

Total Blocks Examined  : 1
Total Blocks Processed (Data) : 0
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
Message 531 not found; product=RDBMS; facility=BBED


BBED> show all
 FILE#  6
 BLOCK#  1
 OFFSET  148
 DBA  0x01800001 (25165825 6,1)
 FILENAME /opt/oracle/oradata/orcl11g/zbdba01.dbf
 BIFILE  bifile.bbd
 LISTFILE filelist.txt
 BLOCKSIZE 8192
 MODE  Edit
 EDIT  Unrecoverable
 IBASE  Dec
 OBASE  Dec
 WIDTH  80
 COUNT  512
 LOGFILE  log.bbd
 SPOOL  No

BBED> p kcvfhckp
struct kcvfhckp, 36 bytes   @484 
 struct kcvcpscn, 8 bytes   @484 
 ub4 kscnbas    @484 0x001e526c
 ub2 kscnwrp    @488 0x0000
 ub4 kcvcptim    @492 0x3362e202
 ub2 kcvcpthr    @496 0x0001
 union u, 12 bytes   @500 
 struct kcvcprba, 12 bytes  @500 
  ub4 kcrbaseq   @500 0x0000004a
  ub4 kcrbabno   @504 0x00005801
  ub2 kcrbabof   @508 0x0010
 ub1 kcvcpetb[0]    @512 0x02
 ub1 kcvcpetb[1]    @513 0x00
 ub1 kcvcpetb[2]    @514 0x00
 ub1 kcvcpetb[3]    @515 0x00
 ub1 kcvcpetb[4]    @516 0x00
 ub1 kcvcpetb[5]    @517 0x00
 ub1 kcvcpetb[6]    @518 0x00
 ub1 kcvcpetb[7]    @519 0x00

BBED> p kcvfhcpc
ub4 kcvfhcpc    @140 0x000000f9

BBED> p kcvfhccc
ub4 kcvfhccc    @148 0x000000f8

BBED> 
修改完成后我们再次恢复该数据文件:
SYS@orcl11g>startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size   2213936 bytes
Variable Size  318769104 bytes
Database Buffers  92274688 bytes
Redo Buffers  4288512 bytes
Database mounted.
Database opened.
SYS@orcl11g>recover datafile 6;
Media recovery complete.
SYS@orcl11g>alter database datafile 6 online;

Database altered.





热心网友 时间:2022-04-14 15:51

比较简单的就是用指令进行恢复,但是这个得看情况,很多人恢复不了。然后笨的方法就是用MiniTool数据恢复工具这些免费数据恢复软件进行恢复,当然后面的耗时比较长

热心网友 时间:2022-04-14 17:09

文件可以用软件恢复的,个人推荐你用安易,,数据恢复软件。彻底删除的文件,永久删除的文件也支持的。常见的卸载软件丢失的数据,硬盘被格式化了或者提示未被格式化要恢复文件,u盘内存卡等也支持恢复。软件恢复的很全面,值得一用。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
粒上皇开口熟栗120g*5袋(共600g)-详细介绍 三皇王板栗介绍 品牌榜:2024年板栗十大品牌排行榜 投票结果公布【新】 为什么来大姨妈胸会胀 少儿学什么舞蹈 青年学什么舞蹈好 成年人学什么舞蹈 福州企业最低工资标准 2013年厦门的底薪是多少 生产要素的需求有哪些性质 微信很多千奇百怪的动态图片怎么弄得?不是系统动态表情那种 三伏天怎样做绿豆稀饭 在哪里可以收看央视的06年春节联欢晚会? 男,1985年农历十一月初八,中午十二点出生,属牛,命运如何? 农历1985年11月12日下午2点属牛男出生的人命运怎么样呢 1985年属牛11月初6是什么命如题 谢谢了 1985年属牛人农历11月初八申时一生的命运 属牛1985年11月16号出生命运 施工服务可以框架协议招标不? 总包方只签完了框架协议没有签订施工合同总包方有权分包吗? - 信息提示 甲方将工程和乙方已鉴了框架协议还可以承包给另一家吗? 框架协议可以超越资质等级承揽业务是什么意思 施工框架协议签订后可以进场做现场施工前准备吗? 爱探险的朵拉里面的捣蛋鬼把朵拉的袜子和书包拿走了是第几集 陕西股票新三板开户需要什么条件 平安证券新三板是怎么开户的 同城,不同银行自动取款机上取款,取1500元共收多少手续费? 麻烦帮帮忙,交行异地跨【同省】行取款多少手续费?我取1500要扣多少钱? 邮政卡,一次取1500,跨行跨市,会扣多少手续费? 电视剧天下第一楼唐二爷是谁扮演的? 天下第一楼大少爷媳妇谁演的 电视剧《天下第一楼》里的小翠的真实名字 天下第一楼王子西人物分析 《天下第一楼》人物分析是什么? 天下第一楼导演 《天下第一楼》中常贵的称号尊卑 天下第一楼里吃钉子下酒的演员是谁? 哪位大神有天下第一楼2004年由 巍子主演的百度云资源 王姫演过的电视剧有哪些? LOLAD怎样设置走A,就是点A键自动攻击的那种 adc怎么改键走a lol adc怎样改键方便走a ,求详细说明,谢谢! LOL ad走A是怎么走的? LOL ad怎么设置走A才更顺畅啊? 西门塔尔牛第一次下小牛有困难吗 不思量 是什么意思 十年生死俩茫茫,不思量,自难忘。是什么意思? 梦到邻居送我家一只死兔子 我想养西门达尔牛我想了解一下,下面的几个问题? 西门塔尔牛的寿命是多少年? 西门塔尔牛的公牛母牛平