Welcome 微信登录

首页 / 数据库 / MySQL / 修改Datafile Header规避ORA-01190

一 触发ORA-01190错误的原因1 先抛出一个ora-01190错误,此错误用bbed工具构造SQL> startupOracle instance started. Total System Global Area 322961408 bytesFixed Size 2020480 bytesVariable Size 96471936 bytesDatabase Buffers 218103808 bytesRedo Buffers 6365184 bytesDatabase mounted.ORA-01190: control file or data file 11 is from before the last RESETLOGSORA-01110: data file 11: "/oracle/test/jiujian1.dbf" 2 oerr ora 01190 给出这个错误的解释 [oracle@oracle ~]$ oerr ora 0119001190, 00000, "control file or data file %s is from before the last RESETLOGS"// *Cause: Attempting to use a data file when the log reset information in// the file does not match the control file. Either the data file// or the control file is a backup that was made before the most// recent ALTER DATABASE OPEN RESETLOGS.// *Action: Restore file from a more recent backup.以上英文大体意思是调用数据文件时发现数据文件的resetlogs信息和控制文件中resetlogs信息不匹配。 3 查询数据文件头部和控制文件中关于resetlogs的信息控制文件中关于resetlogs的相关信息如下:SQL> select resetlogs_change#, to_char(resetlogs_time,"mm/dd/yyyy hh24:mi:ss") time from v$database;RESETLOGS_CHANGE# TIME----------------- ------- -------------------2781464667 01/15/2013 21:51:45各数据文件头中resetlogs的信息如下:Fhrls:resetlogs scn值Fhrlc:resetlogs count值fhrlc_i:resetlogs count 转换成10进制的值对于resetlogs count 的描述如下:reset logs count and scn: The counter with the SCN is called the Reset Log Stamp,and is a unique identification. The counter is in fact a timestamp  SQL> select hxfil,fhrls change#,fhrlc_i,fhrlc time from x$kcvfh; HXFIL CHANGE# FHRLC_I TIME---------- ---------------- ---------- -------------------- -----------------------1 2781464667 804808305 01/15/2013 21:51:452 2781464667 804808305 01/15/2013 21:51:453 2781464667 804808305 01/15/2013 21:51:454 2781464667 804808305 01/15/2013 21:51:455 2781464667 804808305 01/15/2013 21:51:456 2781464667 804808305 01/15/2013 21:51:457 2781464667 804808305 01/15/2013 21:51:458 2781464667 804808305 01/15/2013 21:51:4511 2781455194 804803925 01/15/2013 20:38:4512 2781464667 804808305 01/15/2013 21:51:4513 2781464667 804808305 01/15/2013 21:51:45 11 rows selected.通过对比11号文件的resetlogs scn及resetlogs count值不难发现触发ora-01190的原因:即数据文件头部的 resetlogs scn 、resetlogs count 和控制文件中的resetlogs信息不匹配造成的。所以,如果要规避ora-01190错误,我们可以通过bbed修改数据文件头部resetlogs相关值 二 通过bbed修改数据文件头部规避此错误 1 resetlogs count 和resetlogs scn 在数据文件头部的位置 resetlogs count 位于数据文件头部偏移量112处resetlogs scn 位于数据文件头部偏移量116处BBED> p offset 112kcvfh.kcvfhrlc--------------ub4 kcvfhrlc @112 0x2ff85555 resetlogs count  BBED> p offset 116kcvfh.kcvfhrls.kscnbas----------------------ub4 kscnbas @116 0xa5c9a35a resetlogs scn 2 用bbed 调整这两处的值调整resetlogs count如下BBED> dump /v dba 1,1 offset 112 count 30File: /oracle/test/system1.dbf (1)Block: 1 Offsets: 112 to 141 Dba:0x00400001-------------------------------------------------------7166f82f 5bc8c9a5 00000000 00000000 l qf?[壬?.......00000000 00000000 00000420 dc07 l ........... ? <16 bytes per line> BBED> dump /v dba 11,1 offset 112 count 30File: /oracle/test/jiujian1.dbf (11)Block: 1 Offsets: 112 to 141 Dba:0x02c00001-------------------------------------------------------5555f82f 5aa3c9a5 00000000 00000000 l UU?ZI?.......00000000 00000000 00000400 9b02 l .............. <16 bytes per line> BBED> modify /x 7166File: /oracle/test/jiujian1.dbf (11)Block: 1 Offsets: 112 to 141 Dba:0x02c00001------------------------------------------------------------------------7166f82f 5aa3c9a5 00000000 00000000 00000000 00000000 00000400 9b02 <32 bytes per line> 调整 resetlogs scn值如下 BBED> dump /v dba 1,1 offset 116 count 30File: /oracle/test/system1.dbf (1)Block: 1 Offsets: 116 to 145 Dba:0x00400001-------------------------------------------------------5bc8c9a5 00000000 00000000 00000000 l [壬?...........00000000 00000420 dc070000 df70 l ....... ?..遬 <16 bytes per line> BBED> dump /v dba 11,1 offset 116 count 30File: /oracle/test/jiujian1.dbf (11)Block: 1 Offsets: 116 to 145 Dba:0x02c00001-------------------------------------------------------5aa3c9a5 00000000 00000000 00000000 l ZI?...........00000000 00000400 9b020000 b155 l ............盪 <16 bytes per line> BBED> modify /x 5bc8File: /oracle/test/jiujian1.dbf (11)Block: 1 Offsets: 116 to 145 Dba:0x02c00001------------------------------------------------------------------------5bc8c9a5 00000000 00000000 00000000 00000000 00000400 9b020000 b155 <32 bytes per line> 最后sum apply 使更改生效BBED> sum applyCheck value for File 11, Block 1:current = 0x77a2, required = 0x77a2接下来请看第2页精彩内容: http://www.linuxidc.com/Linux/2013-08/89060p2.htm
  • 1
  • 2
  • 3
  • 下一页
非归档下Oracle的备份和恢复Oracle用控制文件旧备份恢复后数据库恢复总结相关资讯      ORA-01190 
  • 通过BBED修复ORA-01190错误  (11/16/2015 10:51:13)
本文评论 查看全部评论 (0)
表情: 姓名: 字数