随记

>alter session set events 'immediate trace name buffers level 10';
>select value from v$diag_info where name='Default Trace File';
 #cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace/ 
 #grep ckptq orcl_ora_23313.trc|grep -v NULL
 >select name,bytes from v$sgastat where upper(name) like '%CHECKPOINT%';
控制文件以及增量检查点的协同工作
控制文件与数据文件头信息:
>shutdown immediate
>startup mount;
>alter session set events 'immediate trace name file_hdrs level 10';
>select value from v$diag_info where name='Default Trace File';
//来自于控制文件
DUMP OF DATA FILES: 5 files in database

DATA FILE #1:
  name #10: +DATA/orcl/datafile/system.256.820818623
creation size=0 block size=8192 status=0xe head=10 tail=10 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:98 scn: 0x0000.000e50ea 07/21/2013 07:04:32//检查点计数98个,最后一次成功完成的检查点scn
 Stop scn: 0x0000.000e50ea 07/21/2013 07:04:32
 Creation Checkpointed at scn:  0x0000.00000007 08/13/2009 23:00:53
 thread:0 rba:(0x0.0.0)

//来自于数据文件
 V10 STYLE FILE HEADER:
        Compatibility Vsn = 186646528=0xb200000
        Db ID=1348600071=0x50620107, Db Name='ORCL'
        Activation ID=0=0x0
        Control Seq=1148=0x47c, File size=87040=0x15400
        File Number=1, Blksiz=8192, File Type=3 DATA
Tablespace #0 - SYSTEM  rel_fn:1
Creation   at   scn: 0x0000.00000007 08/13/2009 23:00:53
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
 reset logs count:0x30ecb597 scn: 0x0000.000b8338
 prev reset logs count:0x296a3120 scn: 0x0000.00000001
 recovered at 07/20/2013 12:47:04
 status:0x2000 root dba:0x00400208 chkpt cnt: 98 ctl cnt:97//检查点计数98个
begin-hot-backup file size: 0
Checkpointed at scn:  0x0000.000e50ea 07/21/2013 07:04:32//最后一次成功完成的检查点scn
 thread:1 rba:(0xc.ece2.10)
//删除数据文件后,重新跟踪事件
//来自于控制文件
DUMP OF DATA FILES: 5 files in database

DATA FILE #1:
  name #10: +DATA/orcl/datafile/system.256.820818623
creation size=0 block size=8192 status=0xe head=10 tail=10 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:98 scn: 0x0000.000e50ea 07/21/2013 07:04:32//最后一次成功完成的检查点scn
 Stop scn: 0x0000.000e50ea 07/21/2013 07:04:32
 Creation Checkpointed at scn:  0x0000.00000007 08/13/2009 23:00:53
 thread:0 rba:(0x0.0.0)
//来自于数据文件头记录的checkpoint at scn 指数据文件中记录的最后一次成功完成的检查点scn,正常情况下是相等的。
ORA-01157:cannot identify/lock data file 4 -see DBWR trace file
ORA-01110:data file 4:' +DATA/orcl/datafile/system.256.820818623
数据库启动过程中的检验包含以下两个步骤:
1.检查数据文件头中的checkpoint cnt 是否与控制文件的checkpoint cnt一致
2.检查数据文件头的开始scn是否与控制文件的stop scn一致
否则alter database open 会报错,提示需要介质恢复
执行恢复:recover datafile 4;
恢复后查看控制文件中checkpoint cnt多了一个,stop scn与数据文件一致
可以打开数据库:alter database open;

 


 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值