重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1795|回复: 0
打印 上一主题 下一主题

[工具] 使用BBED解决数据文件头中记录的检查点比控制文件中记录的要新?

[复制链接]
跳转到指定楼层
楼主
发表于 2021-10-26 18:00:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
10G 关闭数据库,报错了:

SQL> shutdown immediate
ORA-01122: database file 5 failed verification check
ORA-01110: data file 5: '/u01/app/oracle/oradata/orcl/example01.dbf'
ORA-01207: file is more recent than control file - old control file


1.查看控制文件中关于bbed数据文件的信息
  SQL> alter session set events 'immediate trace namecontrolf level 8';
  查看生成的日志文件中data file #5的信息
   DATA FILE #5:   (name #9) /u01/app/oracle/oradata/orcl/example01.dbf
creation size=12800 block size=8192 status=0xe head=9 tail=9 dup=1
tablespace 6, index=6 krfil=5 prev_file=0
unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
Checkpoint cnt:17 scn: 0x0000.000728c0 10/26/2021 16:29:43
Stop scn: 0xffff.ffffffff 02/21/2021 12:02:41
Creation Checkpointed at scn:  0x0000.00063947 02/20/2021 19:24:48
thread:1 rba:(0x1.6507.10)
可以看出控制文件中记录的检查点计数器的值为17转换成16进制为11,数据文件头中控制文件备份的计数器等于17-1=16换成16进制为10


2、修改EXAMPLE数据文件头中检查点计数器(kcvfhcpc)为控制文件记录的值
BBED> m /x 11000000 offset 140
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /u01/app/oracle/oradata/orcl/example01.dbf (5)
Block: 1                Offsets:  140 to  651           Dba:0x01400001
------------------------------------------------------------------------
11000000 1b087c3f 39000000 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 07004558 414d504c 45000000 00000000 00000000 00000000 00000000
00000000 05000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 3892b92a 01000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 c0280700 00000000
f7ddc940 01000000 05000000 8e120000 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>

2、修改example数据文件头中控制文件备份的计数器(kcvfhccc)的值
BBED> m /x 10000000 offset 148
File: /u01/app/oracle/oradata/orcl/example01.dbf (5)
Block: 1                Offsets:  148 to  659           Dba:0x01400001
------------------------------------------------------------------------
10000000 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 07004558
414d504c 45000000 00000000 00000000 00000000 00000000 00000000 05000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 3892b92a 01000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 c0280700 00000000 f7ddc940 01000000
05000000 8e120000 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>


3.重新生成sum
BBED> sum apply
Check value for File 5, Block 1:
current = 0x3b90, required = 0x3b90


之后,再去关闭数据库,正常。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-24 12:20 , Processed in 0.094843 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表