oracle实验记录(恢复-checkpoint cnt)

The checkpoint count is used to detect when a backup of a file has been
   restored. It is incremented every time there is an attempt to advance
   the checkpoint in the file header of the current file. It is incremented
   even if the checkpoint is not advanced because it is already greater.
   The most recent value of this counter is also kept in the controlfile.
   If the counter in the controlfile is greater than that in the file
   header then the file must be a backup. The value in the file header can
   be greater than the controlfile if the controlfile transaction aborts
   after the file header write.
  
  
    The controlfile checkpoint count is used to detect old controlfiles. When
     updating the checkpoint count in the file header, the old checkpoint
     count from the controlfile record is saved here. Thus this value is
     known to be committed to the current controlfile. If the value in the
     controlfile is ever less than this value then the controlfile must be
     a backup or the resetlogs stamp must be different.

 

checkpoint count
1. allow detection of a restored data file or control file
2. incremented at every checkpoint~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~这个应该理解成 递增 而不是 增量checkpoint

SQL> show parameter check

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------------------------
db_block_checking                    string      FALSE
db_block_checksum                    string      TRUE
log_checkpoint_interval              integer     0
log_checkpoint_timeout               integer     1800
log_checkpoints_to_alert             boolean     FALSE

SQL> alter system set log_checkpoints_to_alert=true;

系统已更改。

SQL> alter system set log_checkpoint_timeout=10;

系统已更改。
SQL> startup force;

Mon Aug 24 23:38:03 2009
Incremental checkpoint up to RBA [0x5.43.0], current log tail at RBA [0x5.5d.0]

Mon Aug 24 23:38:15 2009
Incremental checkpoint up to RBA [0x5.7f.0], current log tail at RBA [0x5.112.0]
Mon Aug 24 23:38:30 2009
Incremental checkpoint up to RBA [0x5.140.0], current log tail at RBA [0x5.140.0]


SQL> alter session set events 'immediate trace name controlf level 8';

会话已更改。
DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:117 scn: 0x0000.000d7ae8 08/24/2009 23:37:36

SQL> alter session set events 'immediate trace name controlf level 8';

会话已更改。
DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:117 scn: 0x0000.000d7ae8 08/24/2009 23:37:36
 Stop scn: 0xffff.ffffffff 08/22/2009 00:01:16


SQL> alter session set events 'immediate trace name controlf level 8';~~~~~~~~~~~~~~发现 incremenal checkpoint的发生 checkpoint cnt并没有变化

会话已更改。
DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:117 scn: 0x0000.000d7ae8 08/24/2009 23:37:36


SQL> alter system set log_checkpoint_timeout=1800;

系统已更改。


SQL> alter system checkpoint;

系统已更改。
alter session set events 'immediate trace name controlf level 8';
DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:120 scn: 0x0000.000dd211 08/24/2009 23:43:32

 

alter session set events 'immediate trace name controlf level 8';
DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1~~~~~~~~~~~~~~~~checkpoint cn~~~~~~~~~~~~~~~~~~~~~~~~~~针对full checkpoint 变化
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:121 scn: 0x0000.000dd2f0 08/24/2009 23:45:50

 

oracle open时候用 checkpoint 来判断 数据文件(控制文件) 版本
SQL>  alter session set events 'immediate trace name file_hdrs level 10';

会话已更改。


DATA FILE #1:
  (name #7) F:\ORACLE\PRODUCT\10.2.0\ORADATA\XHTEST\SYSTEM01.DBF
creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1
 tablespace 0, index=1 krfil=1 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~来自controlfile  Checkpoint cnt:122
 Checkpoint cnt:122 scn: 0x0000.000dd323 08/24/2009 23:47:16
 Stop scn: 0xffff.ffffffff 08/24/2009 23:43:21
 Creation Checkpointed at scn:  0x0000.00000009 08/30/2005 13:50:22
 thread:0 rba:(0x0.0.0)

Tablespace #0 - SYSTEM  rel_fn:1
Creation   at   scn: 0x0000.00000009 08/30/2005 13:50:22
Backup taken at scn: 0x0000.000cf888 08/21/2009 22:58:45 thread:1
 reset logs count:0x2974adb9 scn: 0x0000.000cc406 reset logs terminal rcv data:0x0 scn: 0x0000.00000000
 prev reset logs count:0x296ccca0 scn: 0x0000.0008297b prev reset logs terminal rcv data:0x0 scn: 0x0000.00000000
 recovered at 08/24/2009 23:43:30
 status:0x2004 root dba:0x00400179 chkpt cnt: 122 ctl cnt:121


来自 datafile chkpt cnt: 122  比较这 两部分

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12020513/viewspace-613113/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12020513/viewspace-613113/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值