Chinaunix首页 | 论坛 | 博客
  • 博客访问: 361633
  • 博文数量: 79
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 42
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-30 12:25
文章分类

全部博文(79)

文章存档

2019年(1)

2017年(19)

2016年(25)

2015年(30)

2014年(4)

分类: Oracle

2016-09-26 16:50:27

原文地址:ORA-01200错误的修复(二) 作者:TOMSYAN

ORA-01200错误的修复(一) http://blog.chinaunix.net/uid-22948773-id-3302663.html
 
除了使用构造文件的方法来骗过oracle外,我们还可以通过bbed修改文件头的方法来解决这个问题:
 

点击(此处)折叠或打开

  1. SQL> alter database open;
  2. alter database open
  3. *
  4. ERROR at line 1:
  5. ORA-01122: database file 6 failed verification check
  6. ORA-01110: data file 6: '/u01/app/oracle/oradata/huateng/htyansp01.dbf'
  7. ORA-01200: actual file size of 7399 is smaller than correct size of 12800
  8. blocks


  9. [oracle@db2server ~]$ bbed password=blockedit filename=/u01/app/oracle/oradata/huateng/htyansp01.dbf

  10. BBED: Release 2.0.0.0.0 - Limited Production on Sun Aug 5 17:52:43 2012

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

  12. ************* !!! For Oracle Internal Use only !!! ***************

  13. BBED> set block 1
  14.         BLOCK# 1

  15. BBED> show
  16.         FILE# 0
  17.         BLOCK# 1
  18.         OFFSET 0
  19.         DBA 0x00000000 (0 0,1)
  20.         FILENAME /u01/app/oracle/oradata/huateng/htyansp01.dbf
  21.         BIFILE bifile.bbd
  22.         LISTFILE
  23.         BLOCKSIZE 8192
  24.         MODE Browse
  25.         EDIT Unrecoverable
  26.         IBASE Dec
  27.         OBASE Dec
  28.         WIDTH 80
  29.         COUNT 512
  30.         LOGFILE log.bbd
  31.         SPOOL No

  32. BBED> p offset 44 --偏移量44记录了文件的实际大小,一共4个字节

  33. kcvfh.kcvfhhdr.kccfhfsz
  34. -----------------------

  35. ub4 kccfhfsz @44 0x00003200




  36. SQL> select to_number('3200','xxxx') from dual;

  37. TO_NUMBER('3200','XXXX')
  38. ------------------------

  39.                    12800

  40. SQL> select to_char(7399,'xxxx') from dual;

  41. TO_CH
  42. -----

  43.  1ce7



  44. BBED> set offset 44
  45.         OFFSET 44

  46. BBED> dump /v count 16
  47.  File: /u01/app/oracle/oradata/huateng/htyansp01.dbf (0)
  48.  Block: 1 Offsets: 44 to 59 Dba:0x00000000
  49. -------------------------------------------------------

  50.  00320000 00200000 06000300 00000000 l .2... ..........

  51.  <16 bytes per line>

  52. BBED> modify /x e71c
  53. BBED-00215: editing not allowed in BROWSE mode


  54. BBED> set mode edit
  55.         MODE Edit

  56. BBED> modify /x e71c
  57. Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
  58.  File: /u01/app/oracle/oradata/huateng/htyansp01.dbf (0)
  59.  Block: 1 Offsets: 44 to 59 Dba:0x00000000
  60. ------------------------------------------------------------------------

  61.  e71c0000 00200000 06000300 00000000

  62.  <32 bytes per line>

  63. BBED> sum apply
  64. Check value for File 0, Block 1:
  65. current = 0x4285, required = 0x4285

  66. BBED>


下面就可以打开数据库了:
 

点击(此处)折叠或打开

  1. SQL> alter database open;

  2. Database altered.

  3. SQL>

阅读(1025) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~