oracle跳过文件头检查,转储数据文件头 分析 ORACLE的启动验证

oradebug dump file_hdrs 3

DATA FILE #5:

(name #8) /dev/raw/raw12

creation size=64000 block size=8192 status=0xe head=8 tail=8 dup=1

tablespace 5, index=6 krfil=5 prev_file=0

unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00

Checkpoint cnt:43 scn: 0x0000.000a5310 09/13/2018 06:18:03

Stop scn: 0x0000.000a5310 09/13/2018 06:18:03

Creation Checkpointed at scn:  0x0000.00002249 08/29/2018 09:27:02

thread:1 rba:(0x1.7a18.10)

enabled  threads:  01000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 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 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000

Hot Backup end marker scn: 0x0000.00000000

aux_file is NOT DEFINED

above information from ctl

------------------------------------------------------------------------------------------

V10 STYLE FILE HEADER:

Compatibility Vsn = 169870592=0xa200500

Db ID=880153879=0x34761517, Db Name='NGKF'

Activation ID=0=0x0

Control Seq=280=0x118, File size=64000=0xfa00

File Number=5, Blksiz=8192, File Type=3 DATA

Tablespace #5 - USERS  rel_fn:5

Creation   at   scn: 0x0000.00002249 08/29/2018 09:27:02

Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0

reset logs count:0x3abc6817 scn: 0x0000.00000001 reset logs terminal rcv data:0x0 scn: 0x0000.00000000

prev reset logs count:0x0 scn: 0x0000.00000000 prev reset logs terminal rcv data:0x0 scn: 0x0000.00000000

recovered at 09/13/2018 06:11:32

status:0x0 root dba:0x00000000 chkpt cnt: 43 ctl cnt:42

begin-hot-backup file size: 0

Checkpointed at scn:  0x0000.000a5310 09/13/2018 06:18:03

thread:1 rba:(0xb.185.10)

enabled  threads:  01100000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 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 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 00000000 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 01/01/1988 00:00:00

Terminal Recovery Stamp  01/01/1988 00:00:00

Platform Information:    Creation Platform ID: 13

Current Platform ID: 13 Last Platform ID: 13

DUMP OF TEMP FILES: 1 files in database

当使用 file_hdrs 事件来转储数据文件头信息时,Oracle 会转储两部分信息,一部分来自控制文件,一部分来自数据文件,在数据库启动过程中,这两部分信息要用来进行启动验证。

验证过程:

第一次检查数据文件头中的 Checkpoint cnt 是否与对应控制文件中的 Checkpoint cnt

一致,如果相等,进行第二次检查;

file_hdrs.chkpt.cnt=ctl.chkpt.cnt

第二次检查数据文件头的开始SCN和对应控制文件中的结束SCN是否一致如果结束

SCN 等于开始 SCN,则不需要对那个文件进行恢复。

file_hdrs.start_scn = clt.stop.scn

对每个数据文件都完成检查后,打开数据库.同时将每个数据文件的结束 SCN 设置为无穷

大。

以上面的转储信息为例:

clt中(横线上半部分中)最重要的几个地方

这部分中包含的重要信息有:

检查点计数: Checkpoint cnt:检查点 SCN: scn:

Checkpoint cnt:43 scn: 0x0000.000a5310 09/13/2018 06:18:03

数据文件 Stop SCN

Stop scn: 0x0000.000a5310 09/13/2018 06:18:03

数据文件头的信息(横线上半部分中)最重要的几个地方

u 检查点 SCN: Checkpointed at scn

u 检查点计数: chkpt cnt

Checkpointed at scn:  0x0000.000a5310 09/13/2018 06:18:03

chkpt cnt: 43 ctl cnt:42

这两者都和控制文件中所记录的一致。如果这两者一致,数据库启动时就能通过验证,启动数据库。

如果不一致,启动的时候,会有报错

ERROR at line 1:

ORA-01113: file 4 needs media recovery

ORA-01110: data file 4: '/opt/oracle/oradata/eygle/eygle01.dbf'

执行恢复

recover datafile 4;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值