eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 《深入浅出Oracle》登上排行榜前三甲 | Blog首页 | 江湖传闻-Blogspot再次解封 »

EVENT: FILE_HDRS 的信息来源

准备用几篇稿子来记录一下ITPUB上关于数据库Open的一个问题
具体问题参考ITPUB链接:
http://www.itpub.net/609499.html

我们知道,可以通过一个内部事件来转储数据文件头信息,这个常用的命令是:

alter session set events 'immediate trace name file_hdrs level 10';

那么我们来看一下这个命令得到的trace文件及内容。
immediate关闭数据库,在mount状态下执行该命令: 

SQL> startup mount;
ORACLE instance started.

Total System Global Area  139531744 bytes
Fixed Size                   452064 bytes
Variable Size             121634816 bytes
Database Buffers           16777216 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> alter session set events 'immediate trace name file_hdrs level 10';

Session altered.

选取一个文件的信息,这里选择eygle01.dbf文件,我们注意,以下就是trace文件摘录的信息:

DATA FILE #4:
  (name #4) /opt/oracle/oradata/eygle/eygle01.dbf
creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1
 tablespace 4, index=4 krfil=4 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:53 scn: 0x0000.002ac5f9 08/10/2006 20:58:21
 Stop scn: 0x0000.002ac5f9 08/10/2006 20:58:21
 Creation Checkpointed at scn:  0x0000.0015078d 06/06/2006 09:41:54
 thread:0 rba:(0x0.0.0)
 enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
 Offline scn: 0x0000.00000000 prev_range: 0
 Online Checkpointed at scn:  0x0000.00000000
 thread:0 rba:(0x0.0.0)
 enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
 Hot Backup end marker scn: 0x0000.00000000
 aux_file is NOT DEFINED
 FILE HEADER:
        Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000
        Db ID=1407686520=0x53e79778, Db Name='EYGLE'
        Activation ID=0=0x0
        Control Seq=973=0x3cd, File size=1280=0x500
        File Number=4, Blksiz=8192, File Type=3 DATA
Tablespace #4 - EYGLE  rel_fn:4
Creation   at   scn: 0x0000.0015078d 06/06/2006 09:41:54
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
 reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/10/2006 20:57:53
 status:0x0 root dba:0x00000000 chkpt cnt: 53 ctl cnt:52
begin-hot-backup file size: 0
Checkpointed at scn:  0x0000.002ac5f9 08/10/2006 20:58:21
 thread:1 rba:(0x35.1275.10)
 enabled  threads:  01000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
Backup Checkpointed at scn:  0x0000.00000000
 thread:0 rba:(0x0.0.0)
 enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
External cache id: 0x0 0x0 0x0 0x0
Absolute fuzzy scn: 0x0000.00000000
Recovery fuzzy scn: 0x0000.00000000 08/10/2006 10:46:03
Terminal Recovery Stamp scn: 0x0000.00000000 01/01/1988 00:00:00

注意,这其中"FILE HEADER"开始的信息就是来自数据文件头,之前的相关内容来自控制文件。

我们可以在mount状态下将eygle01.dbf文件移除:

[oracle@jumper eygle]$ mv eygle01.dbf eygle01.dbf.n
[oracle@jumper eygle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Thu Aug 10 21:44:10 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> alter session set events 'immediate trace name file_hdrs level 10';

Session altered.

SQL> !

则"FILE HEADER"部分信息将无法获得。

DATA FILE #4:
  (name #4) /opt/oracle/oradata/eygle/eygle01.dbf
creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1
 tablespace 4, index=4 krfil=4 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:53 scn: 0x0000.002ac5f9 08/10/2006 20:58:21
 Stop scn: 0x0000.002ac5f9 08/10/2006 20:58:21
 Creation Checkpointed at scn:  0x0000.0015078d 06/06/2006 09:41:54
 thread:0 rba:(0x0.0.0)
 enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
 Offline scn: 0x0000.00000000 prev_range: 0
 Online Checkpointed at scn:  0x0000.00000000
 thread:0 rba:(0x0.0.0)
 enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000
 Hot Backup end marker scn: 0x0000.00000000
 aux_file is NOT DEFINED
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/opt/oracle/oradata/eygle/eygle01.dbf'
*** Error 1157 in open/read file # 4 ***
DUMP OF TEMP FILES: 0 files in database

此时报出的错误是,文件无法找到,也就是说当我们执行trace file_hdrs时需要读取数据文件头,获得相关信息。


历史上的今天...
    >> 2009-08-10文章:
    >> 2008-08-10文章:
    >> 2007-08-10文章:
    >> 2005-08-10文章:
           超女,贴吧

无觅

By eygle on 2006-08-10 21:59 | Comments (1) | Internal | 859 |

1 Comment

数据库启动报类似错误(SYSTEM01.DBF):
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/opt/oracle/oradata/eygle/eygle01.dbf'
通过FILE_HDRS事件可以查看原因何在。如果确认是SCN不同步而数据文件有无损坏。请问大师有没有什么工具或者方法修正呢?虽然_ALLOW_RESETLOGS_CORRUPTION参数忽略SCN同步问题,但是有时不启作用。是否能手动修改数据文件和控制文件内的SCN信息??


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com