一触发ora-01190错误的原因1先抛出一个ora-01190错误,此错误用bbed工具构造sqlstartuporacleinstancestarted.totalsystemglobalarea322961408bytesfixedsize&nb
一 触发ora-01190错误的原因
1 先抛出一个ora-01190错误,此错误用bbed工具构造
sql> startup
oracle instance started.
total system global area 322961408 bytes
fixed size 2020480 bytes
variable size 96471936 bytes
database buffers 218103808 bytes
redo buffers 6365184 bytes
database mounted.
ora-01190: control file or data file 11 is from before the last resetlogs
ora-01110: data file 11: '/oracle/test/jiujian1.dbf'
2 oerr ora 01190 给出这个错误的解释
[oracle@oracle ~]$ oerr ora 01190
01190, 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:45
2 2781464667 804808305 01/15/2013 21:51:45
3 2781464667 804808305 01/15/2013 21:51:45
4 2781464667 804808305 01/15/2013 21:51:45
5 2781464667 804808305 01/15/2013 21:51:45
6 2781464667 804808305 01/15/2013 21:51:45
7 2781464667 804808305 01/15/2013 21:51:45
8 2781464667 804808305 01/15/2013 21:51:45
11 2781455194 804803925 01/15/2013 20:38:45
12 2781464667 804808305 01/15/2013 21:51:45
13 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 112
kcvfh.kcvfhrlc
--------------