ORA-01200错误的修复(一) http://blog.chinaunix.net/uid-22948773-id-3302663.html
除了使用构造文件的方法来骗过oracle外,我们还可以通过bbed修改文件头的方法来解决这个问题:
- SQL> alter database open;
- alter database open
- *
- ERROR at line 1:
- ORA-01122: database file 6 failed verification check
- ORA-01110: data file 6: '/u01/app/oracle/oradata/huateng/htyansp01.dbf'
- ORA-01200: actual file size of 7399 is smaller than correct size of 12800
- blocks
- [oracle@db2server ~]$ bbed password=blockedit filename=/u01/app/oracle/oradata/huateng/htyansp01.dbf
- BBED: Release 2.0.0.0.0 - Limited Production on Sun Aug 5 17:52:43 2012
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- ************* !!! For Oracle Internal Use only !!! ***************
- BBED> set block 1
- BLOCK# 1
- BBED> show
- FILE# 0
- BLOCK# 1
- OFFSET 0
- DBA 0x00000000 (0 0,1)
- FILENAME /u01/app/oracle/oradata/huateng/htyansp01.dbf
- BIFILE bifile.bbd
- LISTFILE
- BLOCKSIZE 8192
- MODE Browse
- EDIT Unrecoverable
- IBASE Dec
- OBASE Dec
- WIDTH 80
- COUNT 512
- LOGFILE log.bbd
- SPOOL No
- BBED> p offset 44 --偏移量44记录了文件的实际大小,一共4个字节
- kcvfh.kcvfhhdr.kccfhfsz
- -----------------------
- ub4 kccfhfsz @44 0x00003200
- SQL> select to_number('3200','xxxx') from dual;
- TO_NUMBER('3200','XXXX')
- ------------------------
- 12800
- SQL> select to_char(7399,'xxxx') from dual;
- TO_CH
- -----
- 1ce7
- BBED> set offset 44
- OFFSET 44
- BBED> dump /v count 16
- File: /u01/app/oracle/oradata/huateng/htyansp01.dbf (0)
- Block: 1 Offsets: 44 to 59 Dba:0x00000000
- -------------------------------------------------------
- 00320000 00200000 06000300 00000000 l .2... ..........
- <16 bytes per line>
- BBED> modify /x e71c
- BBED-00215: editing not allowed in BROWSE mode
- BBED> set mode edit
- MODE Edit
- BBED> modify /x e71c
- Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
- File: /u01/app/oracle/oradata/huateng/htyansp01.dbf (0)
- Block: 1 Offsets: 44 to 59 Dba:0x00000000
- ------------------------------------------------------------------------
- e71c0000 00200000 06000300 00000000
- <32 bytes per line>
- BBED> sum apply
- Check value for File 0, Block 1:
- current = 0x4285, required = 0x4285
- BBED>
下面就可以打开数据库了:
- SQL> alter database open;
- Database altered.
- SQL>
阅读(1610) | 评论(0) | 转发(1) |