当前位置:Gxlcms > mysql > 利用BBED恢复数据文件头

利用BBED恢复数据文件头

时间:2021-07-01 10:21:17 帮助过:22人阅读

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/31018075 @@@@@@@利用BBED模拟损坏5文件1号块(文件头) BBED copy file 4 block 4 to file 5 block 1 File: /u01/app/oracle/oradata/PROD/tp01.dbf (5) Block: 1 Offsets: 0 to 19 Dba:0x01

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/31018075

@@@@@@@利用BBED模拟损坏5文件1号块(文件头)

  1. BBED> copy file 4 block 4 to file 5 block 1
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 0 to 19 Dba:0x01400001
  4. ------------------------------------------------------------------------
  5. 1ea20000 04000001 1a4b0000 00000104 99810000
  6. <32 bytes per line>
  7. sys@PROD> shutdown abort;
  8. ORACLE instance shut down.
  9. sys@PROD> starup
  10. SP2-0042: unknown command "starup" - rest of line ignored.
  11. sys@PROD> startup
  12. ORACLE instance started.
  13. Total System Global Area 939495424 bytes
  14. Fixed Size 2233960 bytes
  15. Variable Size 251660696 bytes
  16. Database Buffers 679477248 bytes
  17. Redo Buffers 6123520 bytes
  18. Database mounted.
  19. ORA-01122: database file 5 failed verification check
  20. ORA-01110: data file 5: '/u01/app/oracle/oradata/PROD/tp01.dbf'
  21. ORA-01210: data file header is media corrupt

BBED开始恢复

1、找个文件头覆盖

  1. <strong>BBED> copy file 4 block 1 to file 5 block 1
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 0 to 19 Dba:0x01400001
  4. ------------------------------------------------------------------------
  5. 0ba20000 01000001 00000000 00000104 edbc0000
  6. <32 bytes per line>
  7. </strong>
2、进入5文件1号块
  1. BBED> set file 5 block 1
  2. FILE# 5
  3. BLOCK# 1

(1)改块的地址5文件1号块,rdba_kcbh

  1. BBED> p kcvfhbfh
  2. struct kcvfhbfh, 20 bytes @0
  3. ub1 type_kcbh @0 0x0b
  4. ub1 frmt_kcbh @1 0xa2
  5. ub1 spare1_kcbh @2 0x00
  6. ub1 spare2_kcbh @3 0x00
  7. ub4 rdba_kcbh @4 0x01000001
  8. ub4 bas_kcbh @8 0x00000000
  9. ub2 wrp_kcbh @12 0x0000
  10. ub1 seq_kcbh @14 0x01
  11. ub1 flg_kcbh @15 0x04 (KCBHFCKV)
  12. ub2 chkval_kcbh @16 0xbced
  13. ub2 spare3_kcbh @18 0x0000
  1. BBED> d /v offset 4
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 4 to 23 Dba:0x01400001
  4. -------------------------------------------------------
  5. 01000001 00000000 00000104 edbc0000 l ............í?..
  6. 00000000
  7. BBED> m /x 01004001 offset 4
  8. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  9. Block: 1 Offsets: 4 to 23 Dba:0x01400001
  10. ------------------------------------------------------------------------
  11. 01004001 00000000 00000104 edbc0000 00000000

(2)文件的大小kccfhfsz

  1. BBED> p kcvfhhdr
  2. struct kcvfhhdr, 76 bytes @20
  3. ub4 kccfhswv @20 0x00000000
  4. ub4 kccfhcvn @24 0x0b200000
  5. ub4 kccfhdbi @28 0x0f302c3e
  6. text kccfhdbn[0] @32 P
  7. text kccfhdbn[1] @33 R
  8. text kccfhdbn[2] @34 O
  9. text kccfhdbn[3] @35 D
  10. text kccfhdbn[4] @36
  11. text kccfhdbn[5] @37
  12. text kccfhdbn[6] @38
  13. text kccfhdbn[7] @39
  14. ub4 kccfhcsq @40 0x00000d3d
  15. ub4 kccfhfsz @44 0x00003200
  16. s_blkz kccfhbsz @48 0x00
  17. ub2 kccfhfno @52 0x0004
  18. ub2 kccfhtyp @54 0x0003
  19. ub4 kccfhacid @56 0x00000000
  20. ub4 kccfhcks @60 0x00000000
  21. text kccfhtag[0] @64
  22. ....................
  23. sys@PROD> select name from v$dbfile where file#=5;
  24. NAME
  25. --------------------------------------------------
  26. /u01/app/oracle/oradata/PROD/tp01.dbf
  27. [oracle@jfdb PROD]$ ls -lFtr |grep tp01
  28. -rw-r-----. 1 oracle oinstall 524296192 Jun 8 18:58 tp01.dbf
  29. sys@PROD> select 524296192/8192 from dual;
  30. 524296192/8192
  31. --------------
  32. 64001
  1. BBED> d /v offset 44
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 44 to 63 Dba:0x01400001
  4. -------------------------------------------------------
  5. 00320000 00200000 04000300 00000000 l .2... ..........
  6. 00000000
  7. BBED> m /x 00fa0000 44
  8. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  9. Block: 1 Offsets: 44 to 63 Dba:0x01400001
  10. ------------------------------------------------------------------------
  11. 00fa0000 00200000 04000300 00000000 00000000

(3)修改文件号(4--->5)

ub2 kccfhfno @52 0x0004

  1. BBED> d /v offset 52
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 52 to 71 Dba:0x01400001
  4. -------------------------------------------------------
  5. 04000300 00000000 00000000 00000000 l ................
  6. 00000000
  7. BBED> m /x 05 offset 52
  8. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  9. Block: 1 Offsets: 52 to 71 Dba:0x01400001
  10. ------------------------------------------------------------------------
  11. 05000300 00000000 00000000 00000000 00000000

(4)修改文件创建时SCN

  1. BBED> p kcvfhcrs
  2. struct kcvfhcrs, 8 bytes @100
  3. ub4 kscnbas @100 0x00004b14
  4. ub2 kscnwrp @104 0x0000
  5. sys@PROD> select file#,CREATION_CHANGE# from v$datafile where file#=5;
  6. FILE# CREATION_CHANGE#
  7. ---------- ----------------
  8. 5 363921
  9. sys@PROD> select to_char('363921','xxxxxxxxxxxxx') from dual;
  10. TO_CHAR('36392
  11. --------------
  12. 58d91 ===(倒:918d0500)==》00058d91
  13. BBED> d /v offset 100
  14. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  15. Block: 1 Offsets: 100 to 119 Dba:0x01400001
  16. -------------------------------------------------------
  17. 144b0000 00000000 30cf3e32 a41da532 l .K......0?>2¤.¥2
  18. ec4f1900
  19. BBED> m /x 918d offset 100
  20. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  21. Block: 1 Offsets: 100 to 119 Dba:0x01400001
  22. ------------------------------------------------------------------------
  23. 918d0000 00000000 30cf3e32 a41da532 ec4f1900
  24. BBED> m /x 0500 offset 102
  25. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  26. Block: 1 Offsets: 102 to 121 Dba:0x01400001
  27. ------------------------------------------------------------------------
  28. 05000000 000030cf 3e32a41d a532ec4f 19000000
  29. BBED> d /v offset 100
  30. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  31. Block: 1 Offsets: 100 to 119 Dba:0x01400001
  32. -------------------------------------------------------
  33. 918d0500 00000000 30cf3e32 a41da532 l ........0?>2¤.¥2
  34. ec4f1900

(5)修改文件创建时间

  1. ub4 kcvfhcrt @108 0x323ecf30
  2. BBED> p kcvfhcrt
  3. ub4 kcvfhcrt @108 0x323ecf30
  4. sys@PROD> select file#,to_char(CREATION_TIME,'yyyy-mm-dd hh24:mi:ss') createTime,
  5. 2 (to_char(CREATION_TIME,'yyyy')-1988)*12*31*24*3600+
  6. 3 (to_char(CREATION_TIME,'mm')-1)*31*24*3600+
  7. 4 (to_char(CREATION_TIME,'dd')-1)*24*3600+
  8. 5 to_char(CREATION_TIME,'hh24')*3600+
  9. 6 to_char(CREATION_TIME,'mi')*60+
  10. 7 to_char(CREATION_TIME,'ss') createTimeSCN
  11. 8 from v$datafile WHERE file# in(4,5);
  12. FILE# CREATETIME CREATETIMESCN
  13. ---------- ------------------- -------------
  14. 4 2014-03-23 16:17:52 842977072
  15. 5 2014-03-29 10:32:22 843474742
  16. sys@PROD> select '4' file#, to_char('842977072','xxxxxxxxxxxxxx') from dual;
  17. F TO_CHAR('842977
  18. - ---------------
  19. 4 323ecf30 ===>倒:30cf3e32
  20. sys@PROD> select '5' file#,to_char('843474742','xxxxxxxxxxxxxx') from dual;
  21. sys@PROD> select '5' file#,to_char('843474742','xxxxxxxxxxxxxx') from dual;
  22. F TO_CHAR('843474
  23. - ---------------
  24. 5 32466736 ==》36674632
  25. BBED> d /v offset 108
  26. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  27. Block: 1 Offsets: 108 to 127 Dba:0x01400001
  28. -------------------------------------------------------
  29. 30cf3e32 a41da532 ec4f1900 00000000 l 0?>2¤.¥2ìO......
  30. d713a532
  31. BBED> m /x 36674632 offset 108
  32. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  33. Block: 1 Offsets: 108 to 127 Dba:0x01400001
  34. ------------------------------------------------------------------------
  35. 36674632 a41da532 ec4f1900 00000000 d713a532
  1. sword kcvfhtsn @332 4
  2. sys@PROD> select file#,TS# from v$datafile where file# in(4,5);
  3. FILE# TS#
  4. ---------- ----------
  5. 4 4
  6. 5 5
  7. BBED> d /v offset 332
  8. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  9. Block: 1 Offsets: 332 to 351 Dba:0x01400001
  10. -------------------------------------------------------
  11. 04000000 05005553 45525300 00000000 l ......USERS.....
  12. 00000000 l ....
  13. <16 bytes per line>
  14. BBED> m /x 05 offset 332
  15. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  16. Block: 1 Offsets: 332 to 351 Dba:0x01400001
  17. ------------------------------------------------------------------------
  18. 05000000 05005553 45525300 00000000 00000000

ub4 kcvfhrfn @368 0x00000004

  1. BBED> d /v offset 368
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 368 to 387 Dba:0x01400001
  4. -------------------------------------------------------
  5. 04000000 00000000 00000000 00000000 l ................
  6. 00000000 l ....
  7. <16 bytes per line>
  8. BBED> m /x 05 offset 368
  9. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  10. Block: 1 Offsets: 368 to 387 Dba:0x01400001
  11. ------------------------------------------------------------------------
  12. 05000000 00000000 00000000 00000000 00000000
  1. BBED> p kcvfhtnm
  2. text kcvfhtnm[0] @338 U
  3. text kcvfhtnm[1] @339 S
  4. text kcvfhtnm[2] @340 E
  5. text kcvfhtnm[3] @341 R
  6. text kcvfhtnm[4] @342 S
  7. text kcvfhtnm[5] @343
  8. text kcvfhtnm[6] @344
  9. text kcvfhtnm[7] @345
  10. text kcvfhtnm[8] @346
  11. text kcvfhtnm[9] @347
  12. text kcvfhtnm[10] @348
  13. text kcvfhtnm[11] @349
  14. text kcvfhtnm[12] @350
  15. sys@PROD> select file#,TS# from v$datafile where file# in(4,5);
  16. FILE# TS#
  17. ---------- ----------
  18. 4 4
  19. 5 5
  20. sys@PROD> select TS#,NAME from v$tablespace where ts# in(4,5);
  21. TS# NAME
  22. ---------- --------------------------------------------------
  23. 4 USERS
  24. 5 TP1
  25. BBED> d /v offset 338
  26. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  27. Block: 1 Offsets: 338 to 357 Dba:0x01400001
  28. -------------------------------------------------------
  29. 55534552 53000000 00000000 00000000 l USERS...........
  30. 00000000
  31. sys@PROD> select dump('USERS',16) from dual;
  32. DUMP('USERS',16)
  33. ----------------------------
  34. Typ=96 Len=5: 55,53,45,52,53
  35. sys@PROD> select dump('TP1',16) from dual;
  36. DUMP('TP1',16)
  37. ----------------------
  38. Typ=96 Len=3: 54,50,31
  39. BBED> m /x 54503100 offset 338
  40. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  41. Block: 1 Offsets: 338 to 357 Dba:0x01400001
  42. ------------------------------------------------------------------------
  43. 54503100 53000000 00000000 00000000 00000000
  44. <32 bytes per line>
  45. BBED> m /x 00 offset 342
  46. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  47. Block: 1 Offsets: 342 to 361 Dba:0x01400001
  48. ------------------------------------------------------------------------
  49. 00000000 00000000 00000000 00000000 00000000
  50. <32 bytes per line>
  51. BBED> d /v offset 338
  52. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  53. Block: 1 Offsets: 338 to 357 Dba:0x01400001
  54. -------------------------------------------------------
  55. 54503100 00000000 00000000 00000000 l TP1.............
  56. 00000000

ub2 kcvfhtln @336 0x0005

  1. BBED> d /v offset 336
  2. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  3. Block: 1 Offsets: 336 to 355 Dba:0x01400001
  4. -------------------------------------------------------
  5. 05005450 31000000 00000000 00000000 l ..TP1...........
  6. 00000000 l ....
  7. <16 bytes per line>
  8. BBED> m /x 03 offset 336
  9. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  10. Block: 1 Offsets: 336 to 355 Dba:0x01400001
  11. ------------------------------------------------------------------------
  12. 03005450 31000000 00000000 00000000 00000000
  13. <32 bytes per line>

(10)检查点

  1. BBED> p kcvfhckp
  2. struct kcvfhckp, 36 bytes @484
  3. struct kcvcpscn, 8 bytes @484
  4. ub4 kscnbas @484 0x0019b1a1 --->1683873
  5. ub2 kscnwrp @488 0x0000
  6. ub4 kcvcptim @492 0x32a59921 -->849713441
  7. ub2 kcvcpthr @496 0x0001
  8. union u, 12 bytes @500
  9. struct kcvcprba, 12 bytes @500
  10. ub4 kcrbaseq @500 0x00000002
  11. ub4 kcrbabno @504 0x000002e0
  12. ub2 kcrbabof @508 0x0010
  13. ub1 kcvcpetb[0] @512 0x02
  14. ub1 kcvcpetb[1] @513 0x00
  15. ub1 kcvcpetb[2] @514 0x00
  16. ub1 kcvcpetb[3] @515 0x00
  17. ub1 kcvcpetb[4] @516 0x00
  18. ub1 kcvcpetb[5] @517 0x00
  19. ub1 kcvcpetb[6] @518 0x00
  20. ub1 kcvcpetb[7] @519 0x00
  21. sys@PROD> select file#,rfile#,CREATION_TIME,checkpoint_change#,unrecoverable_change#,offline_change# from v$datafile;
  22. FILE# RFILE# CREATION_ CHECKPOINT_CHANGE# UNRECOVERABLE_CHANGE# OFFLINE_CHANGE#
  23. ---------- ---------- --------- ------------------ --------------------- ---------------
  24. 1 1 23-MAR-14 1683873 0 1658859
  25. 2 2 23-MAR-14 1683873 0 1658859
  26. 3 3 23-MAR-14 1683873 0 1658859
  27. 4 4 23-MAR-14 1683873 0 1658859
  28. 5 5 29-MAR-14 1684251 0 1658859
  29. sys@PROD> select to_number('19b1a1','xxxxxxxxxxxx') from dual;
  30. TO_NUMBER('19B1A1','XXXXXXXXXXXX')
  31. ----------------------------------
  32. 1683873
  33. sys@PROD> select to_number('32a59921','xxxxxxxxxxxx') from dual;
  34. TO_NUMBER('32A59921','XXXXXXXXXXXX')
  35. ------------------------------------
  36. 849713441
  37. sys@PROD> select file#,to_char(CHECKPOINT_TIME,'yyyy-mm-dd hh24:mi:ss') createTime,
  38. 2 (to_char(CHECKPOINT_TIME,'yyyy')-1988)*12*31*24*3600+
  39. 3 (to_char(CHECKPOINT_TIME,'mm')-1)*31*24*3600+
  40. 4 (to_char(CHECKPOINT_TIME,'dd')-1)*24*3600+
  41. 5 to_char(CHECKPOINT_TIME,'hh24')*3600+
  42. 6 to_char(CHECKPOINT_TIME,'mi')*60+
  43. 7 to_char(CHECKPOINT_TIME,'ss') createTimeSCN
  44. 8 from v$datafile WHERE file# in(4,5);
  45. FILE# CREATETIME CREATETIMESCN
  46. ---------- ------------------- -------------
  47. 4 2014-06-08 15:30:41 849713441
  48. 5 2014-06-08 15:38:33 849713913
  49. sys@PROD> sys@PROD> select to_char('1684251','xxxxxxxxxxxxxxx') from dual;
  50. TO_CHAR('1684251
  51. ----------------
  52. 19b31b ====>真正5号文件的检查点SCN
  53. sys@PROD> select to_char('849713913','xxxxxxxxxxxxxxx') from dual;
  54. TO_CHAR('8497139
  55. ----------------
  56. 32a59af9 ====>真正5号文件的检查点时间
  57. ub4 kscnbas @484 0x0019b1a1 ====>真正5号文件的检查点SCN 19b31b (倒:1bb319)
  58. ub4 kcvcptim @492 0x32a59921 ====>真正5号文件的检查点时间32a59af9(倒:f99aa532)
  59. BBED> d /v offset 484
  60. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  61. Block: 1 Offsets: 484 to 503 Dba:0x01400001
  62. -------------------------------------------------------
  63. a1b11900 00000000 2199a532 01000000 l ?±......!.¥2....
  64. 02000000
  65. BBED> m /x 1bb319 offset 484
  66. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  67. Block: 1 Offsets: 484 to 503 Dba:0x01400001
  68. ------------------------------------------------------------------------
  69. 1bb31900 00000000 2199a532 01000000 02000000
  70. BBED> d /v offset 492
  71. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  72. Block: 1 Offsets: 492 to 511 Dba:0x01400001
  73. -------------------------------------------------------
  74. 2199a532 01000000 02000000 e0020000 l !.¥2........à...
  75. 10007261
  76. BBED> m /x f99a offset 492
  77. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  78. Block: 1 Offsets: 492 to 511 Dba:0x01400001
  79. ------------------------------------------------------------------------
  80. f99aa532 01000000 02000000 e0020000 10007261

##################校验块
  1. BBED> sum apply
  2. Check value for File 5, Block 1:
  3. current = 0x4a10, required = 0x4a10
  4. BBED> verify
  5. DBVERIFY - Verification starting
  6. FILE = /u01/app/oracle/oradata/PROD/tp01.dbf
  7. BLOCK = 1
  8. DBVERIFY - Verification complete
  9. Total Blocks Examined : 1
  10. Total Blocks Processed (Data) : 0
  11. Total Blocks Failing (Data) : 0
  12. Total Blocks Processed (Index): 0
  13. Total Blocks Failing (Index): 0
  14. Total Blocks Empty : 0
  15. Total Blocks Marked Corrupt : 0
  16. Total Blocks Influx : 0
  17. Message 531 not found; product=RDBMS; facility=BBED

######################检查物理坏块

  1. [oracle@jfdb PROD]$ dbv file=tp01.dbf start=1 end=2
  2. DBVERIFY: Release 11.2.0.3.0 - Production on Sun Jun 8 21:48:37 2014
  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
  4. DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/PROD/tp01.dbf
  5. DBVERIFY - Verification complete
  6. Total Pages Examined : 2
  7. Total Pages Processed (Data) : 0
  8. Total Pages Failing (Data) : 0
  9. Total Pages Processed (Index): 0
  10. Total Pages Failing (Index): 0
  11. Total Pages Processed (Other): 2
  12. Total Pages Processed (Seg) : 0
  13. Total Pages Failing (Seg) : 0
  14. Total Pages Empty : 0
  15. Total Pages Marked Corrupt : 0
  16. Total Pages Influx : 0
  17. Total Pages Encrypted : 0
  18. Highest block SCN : 1687542 (0.1687542)

############打开数据库报错

  1. sys@PROD> shutdown abort;
  2. ORACLE instance shut down.
  3. sys@PROD> startup
  4. ORACLE instance started.
  5. Total System Global Area 939495424 bytes
  6. Fixed Size 2233960 bytes
  7. Variable Size 251660696 bytes
  8. Database Buffers 679477248 bytes
  9. Redo Buffers 6123520 bytes
  10. Database mounted.
  11. ORA-01122: database file 5 failed verification check
  12. ORA-01110: data file 5: '/u01/app/oracle/oradata/PROD/tp01.dbf'
  13. ORA-01207: file is more recent than control file - old control file

###########怀疑检查点计数器,这里我先用BBED(方法1重建控制文件,方法2利用BBED修改计算器)

ub4 kcvfhcpc @140 0x00000102

  1. idle> alter session set events 'immediate trace name controlf level 8';
  2. Session altered.
  3. DATA FILE #5:
  4. name #4: /u01/app/oracle/oradata/PROD/tp01.dbf
  5. creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1
  6. tablespace 5, index=5 krfil=5 prev_file=0
  7. unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
  8. Checkpoint cnt:226 scn: 0x0000.0019b31b 06/08/2014 15:38:33
  9. Stop scn: 0xffff.ffffffff 06/08/2014 07:44:07
  10. Creation Checkpointed at scn: 0x0000.00058d91 03/29/2014 10:32:22
  11. thread:0 rba:(0x0.0.0)
  12. sys@PROD> select to_char('226','xxxxxxxxxxxxx') from dual;
  13. TO_CHAR('226',
  14. --------------
  15. e2
  16. sys@PROD> select to_char('225','xxxxxxxxxxxxx') from dual;
  17. TO_CHAR('225',
  18. --------------
  19. e1
  20. BBED> d /v offset 140
  21. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  22. Block: 1 Offsets: 140 to 159 Dba:0x01400001
  23. -------------------------------------------------------
  24. 02010000 8bc6a532 01010000 b24f1900 l .....?¥2....2O..
  25. 00000000
  26. BBED> m /x e200 offset 140
  27. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  28. Block: 1 Offsets: 140 to 159 Dba:0x01400001
  29. ------------------------------------------------------------------------
  30. e2000000 8bc6a532 01010000 b24f1900 00000000
  31. <32 bytes per line>
  32. BBED> d /v offset 148
  33. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  34. Block: 1 Offsets: 148 to 167 Dba:0x01400001
  35. -------------------------------------------------------
  36. 01010000 b24f1900 00000000 d713a532 l ....2O......×.¥2
  37. 01000000 l ....
  38. <16 bytes per line>
  39. BBED> m /x e100 offset 148
  40. File: /u01/app/oracle/oradata/PROD/tp01.dbf (5)
  41. Block: 1 Offsets: 148 to 167 Dba:0x01400001
  42. ------------------------------------------------------------------------
  43. e1000000 b24f1900 00000000 d713a532 01000000
  44. <32 bytes per line>
  45. BBED> sum apply
  46. Check value for File 5, Block 1:
  47. current = 0x4a10, required = 0x4a10
  48. BBED> verify
  49. DBVERIFY - Verification starting
  50. FILE = /u01/app/oracle/oradata/PROD/tp01.dbf
  51. BLOCK = 1
  52. DBVERIFY - Verification complete
  53. Total Blocks Examined : 1
  54. Total Blocks Processed (Data) : 0
  55. Total Blocks Failing (Data) : 0
  56. Total Blocks Processed (Index): 0
  57. Total Blocks Failing (Index): 0
  58. Total Blocks Empty : 0
  59. Total Blocks Marked Corrupt : 0
  60. Total Blocks Influx : 0
  61. Message 531 not found; product=RDBMS; facility=BBED

##########再次打开库,OK!

  1. sys@PROD> select status from v$instance;
  2. STATUS
  3. ------------
  4. MOUNTED
  5. sys@PROD> alter database open;
  6. Database altered.

###############################修改数据文件头的注意点:
1、修改数据的DBA,rdba_kcbh

2、修改文件的大小,kccfhfsz

3、修改文件号,kccfhfno

4、修改文件创建时SCN,kcvfhcrs

5、修改文件创建时间,kcvfhcrt

6、修改表空间号,kcvfhtsn

7、修改相对文件号,kcvfhrfn

8、修改表空间的名称, kcvfhtnm

9、修改表空间的长度,kcvfhtln

10、修改检查点的SCN,kcvfhckp

11、修改检查点的时间,kcvcptim

12、修改检查点的计数器,kcvfhcpc

13、修改检查点的控制文件备份的计数器, kcvfhccc

14、如果你修改是1号文件的1号块他的root rdba的地针是指向了bootstrap$

人气教程排行