当前位置: 首页 > news >正文

Oracle checkpoint 说明

 

 

一. Oracle Checkpoint 说明

 1.1  Checkpoint

(1)A synchronization event at aspecific point in time

(2)Causes some or all dirty blockimages to be written to the database thereby guaranteeing that blocks dirtiedprior to that point in time get written

(3)Brings administration up to date

(4)Several types of checkpoint exist

 

RedoLog Checkpoint 和 SCN关系

http://blog.csdn.net/tianlesoftware/article/details/5251916

 

Oracle 实例恢复时 前滚(roll forward) 后滚(rollback) 问题

http://blog.csdn.net/tianlesoftware/article/details/6286330

 

1.2  the point of Oracle Checkpoints

       The point of Oracle checkpoints is to synchronize all datafiles, some datafiles orsome objects to a point in time for consistency, performance and recoverabilitypurposes.

  

1.3 Buffer Cache

       checkpoint与Buffer Cache 的关系很大,有关Buffer cache,之前整理的相关文章如下:

Oracle Buffer Cache 原理

http://blog.csdn.net/tianlesoftware/article/details/6573438

 

Oracle Buffer Cache 中的Recycle Pool 说明

http://blog.csdn.net/tianlesoftware/article/details/6584110

 

Oracle Buffer Cache 中 KeepPool 说明

http://blog.csdn.net/tianlesoftware/article/details/6581159

 

1.3.1 buffer cache 组成

The buffer cache component structures are:

(1)Buffers

       Eachbuffer may hold an image of one data block at any one time

(2)Buffer headers

       =>Storemetadata about contents of the buffers

       =>Actas cache management structures

(3)Buffer pools

       Collectionof buffers used for the same purpose and managed accordingly

(4)Working set

       =>Allor part of a buffer pool

       =>Assigned to a DBWn process

 

1.3.2 Buffer Management

(1) Cached buffers managed by doublylinked lists:

(2) REPL

              =>Bufferscontaining block images being used

(3) REPL-AUX

             =>Buffersready to be used for I/O or CR build

              关于CR 参考:

              CR (consistent read) blockscreate 说明

              http://blog.csdn.net/tianlesoftware/article/details/6529401

(4) WRITE and CKPT-Q

             =>DirtyBuffers requiring I/O

(5) WRITE-AUX

             =>DirtyBuffers with I/O in progress

(6) Touch count is used to decide theinitial insertion location in the REPL chain

(7) AUX lists avoid wasteful scanning

 

1.3.3 Redo and the Buffer Cache

(1) Block modification dirties thebuffer containing the block image and generates redo

(2) A buffer becomes dirty at aparticular RBA which is a point in the redo stream

       关于RBA,参考我的blog:

       Oracle RBA(Redo Byte Address) 说明

       http://blog.csdn.net/tianlesoftware/article/details/6700080

(3) Redo written by LGWR makes thecorresponding part of the redo log file “active”

(4) Dirty block images written by DBWnmakes the corresponding part of the redo log file “inactive”

(5) Redo is always written priorto the corresponding block images

(6) Size of active redo in the logfile influences instance and crash recovery time

(7) Trade-off between performance andrecovery time

 

1.3.4 Buffer Cache I/O

(1)Servers look for an availablebuffer on REPL-AUX then read a data block into selected buffer

       –Buffer gets moved from REPL-AUX to REPL

       –If block is modified, buffer is added to CKPT-Q

       –Servers move dirty buffers to WRITE during free buffer search

(2) DBWn writes dirty buffer contentsto database

       –Buffer gets moved from WRITE to WRITE-AUX

       –Once block written:

       –Buffer is moved back to REPL-AUX

       –Buffer taken off CKPT-Q

(3) DBWn writes upon request

       –Make free buffers

       –Checkpoint

 

1.4 触发checkpoint 的条件

       与checkpoint 触发相关的视图:v$instance_recovery。 关于这个视图的具体说明可以参考官方文档:

       http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/dynviews_2004.htm#REFRN30106

 

几个相关的字段如下:

(1)WRITES_MTTR:fast_start_mttr_target

(2)WRITES_LOGFILE_SIZE:90% of the smallest online redo logfile

(3)WRITES_LOG_CHECKPOINT_SETTINGS:log_checkpoint_timeout

(4)WRITES_OTHER_SETTINGS:fast_start_io_target

(5)WRITES_AUTOTUNE:10g self tuning checkpoints

(6) WRITES_FULL_THREAD_CKPT:Manual checkpoints

 

CKPT发送CHECKPOINT信号的触发条件有如下几条:

       1.log_checkpoint_timeout时间达到
       2. 当前redo日志已经写够log_checkpoint_internavl*操作系统块大小
       3. redo log switch
       4. alter system checkpoint
       5. alter tablespace XXX begin backup,end backup的時候
       6. alter tablespace , datafileoffline, shutdown immediate, direct read的時候;

 

       Oracle DBWR,LGWR,CKPT,ARCH 触发条件 总结

       http://blog.csdn.net/tianlesoftware/article/details/6574584

 

       在下面具体的checkpoint 分类时有更详细的说明。

 

二. Checkpoint 分类

Checkpoint 可以分为以下几类:

(1) Full Checkpoint

(2) Thread Checkpoint

(3) File Checkpoint

(4) Object “Checkpoint”

(5) Parallel Query Checkpoint

(6) Incremental Checkpoint

(7) Log Switch Checkpoint

 

       如果想看到具体的checkpoint 类型,可以设置log_checkpoints_to_alert 参数为true。 设置为true之后,checkpoint 发生时会写入alert log里。

如:

SYS@dave2(db2)>alter system set log_checkpoints_to_alert=true scope=both;

System altered.

SYS@dave2(db2)> alter system switchlogfile;

System altered.

 

log里的信息如下:

Thu Aug 18 18:46:18 2011

ALTER SYSTEM SETlog_checkpoints_to_alert=TRUE SCOPE=BOTH;

Thu Aug 18 18:48:07 2011

Beginning logswitch checkpoint up to RBA [0xa.2.10], SCN: 2148380730

Thread 1 advanced to log sequence 10

 Current log# 3 seq# 10 mem# 0: /u01/app/oracle/oradata/dave2/redo03.log

 

 

2.1 Full Checkpoint

• Writes block images to the database forall dirty buffers from all instances

• Statistics updated:

– DBWR checkpoints

– DBWR checkpoint buffers written

– DBWR thread checkpoint buffers written

• Caused by:

– Alter system checkpoint [global]

– Alter database close

– Shutdown

• Controlfile and datafile headers areupdated

– CHECKPOINT_CHANGE#

 

2.2 Thread Checkpoint

• Writes block images to the database forall dirty buffers from one instance

• Statistics updated:

– DBWR checkpoints

– DBWR checkpoint buffers written

– DBWR thread checkpoint buffers written

• Caused by:

– Alter system checkpoint local

• Controlfile and datafile headers areupdated

– CHECKPOINT_CHANGE#

 

2.3 File Checkpoint

• Writes block images to the database forall dirty buffers for all files of a tablespace from all instances

• Statistics updated:

– DBWR tablespace checkpoint bufferswritten

– DBWR checkpoint buffers written

– DBWR checkpoints

• Caused by:

– Alter tablespace XXX offline

– Alter tablespace XXX begin backup

– Alter tablespace XXX read only

• Controlfile and datafile headers areupdated

– CHECKPOINT_CHANGE#

 

2.4 Parallel Query Checkpoint

• Writes block images to the database forall dirty buffers belonging to objects accessed by the query from all instances

• Statistics updated:

– DBWR checkpoint buffers written

– DBWR checkpoints

• Caused by:

– Parallel Query

– Parallel Query component of PDML or PDDL

– Mandatory for consistency

 

2.5 Object “Checkpoint”

• Writes block images to the database forall dirty buffers belonging to an object from all instances

• Statistics updated:

– DBWR object drop buffers written

– DBWR checkpoints

• Caused by:

– Drop table XXX

– Drop table XXX purge

– Truncate table XXX

• Mandatory for media recovery purposes

 

2.6 Incremental Checkpoint

• Writes the contents of “some” dirty buffers to the database from CKPT-Q

• Block images written in SCN order

• Checkpoint RBA updated in SGA

• Statistics updated:

– DBWR checkpoint buffers written

• Controlfile is updated every 3 seconds byCKPT

– Checkpoint progress record

 

Definition of “Some”

• Every 3 seconds CKPT calculates thecheckpoint

target RBA based on:

– The most current RBA

– log_checkpoint_timeout

– log_checkpoint_interval

– fast_start_mttr_target

– fast_start_io_target

– 90% of the size of the smallest onlineredo log file

• All buffers dirtied prior to the timecorresponding to the target RBA are written to the database

 

2.7 Log Switch Checkpoint

• Writes the contents of “some” dirtybuffers to the database

• Statistics updated:

– DBWR checkpoints

– DBWR checkpoint buffers written

– background checkpoints started

– background checkpoints completed

• Controlfile and datafile headers areupdated

– CHECKPOINT_CHANGE#

 

2.8 Checkpoint Administration

• Useful checkpoint administration views:

– V$INSTANCE_RECOVERY

– V$SYSSTAT

– V$DATABASE

– V$INSTANCE_LOG_GROUP

– V$THREAD

– V$DATAFILE

– V$DATAFILE_HEADER

 

 

 

 

 

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

Blog: http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(满);   DBA2 群:62697977(满)  DBA3 群:62697850(满)  

DBA 超级群:63306533(满);  DBA4 群: 83829929  DBA5群: 142216823   

DBA6 群:158654907  聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

转载于:https://www.cnblogs.com/Hiberniane/archive/2011/08/19/2488377.html

相关文章:

  • 在线生成条码代码
  • 以太网波道平衡(通道绑定)
  • 如何用快捷方式打开我的电脑
  • 新手玩Linux ---- 从Linux From Scratch开始学习Linux (四)
  • 艾伟:WCF从理论到实践(1):揭开神秘面纱
  • PS快捷键大全收藏
  • OAF—如何设计Page导航
  • 一起谈.NET技术,带你走进缓存世界
  • LLBL Gen 3.x 源代码追踪与解析 认识框架结构
  • win7 64位创建wifi热点
  • Celine Dion - A New Day Has Come
  • gns小技巧
  • 李开复谈开放平台时代的创业机会
  • 为什么oracle在AIX有空闲内存的情况下使用SWAP
  • 配置WANem限制网络(点对点)
  • 【翻译】babel对TC39装饰器草案的实现
  • axios请求、和返回数据拦截,统一请求报错提示_012
  • ComponentOne 2017 V2版本正式发布
  • Electron入门介绍
  • HTTP那些事
  • Java 11 发布计划来了,已确定 3个 新特性!!
  • Linux学习笔记6-使用fdisk进行磁盘管理
  • Mybatis初体验
  • Promise初体验
  • Redis 懒删除(lazy free)简史
  • Redux 中间件分析
  • scala基础语法(二)
  • scrapy学习之路4(itemloder的使用)
  • Shadow DOM 内部构造及如何构建独立组件
  • TypeScript实现数据结构(一)栈,队列,链表
  • vue从创建到完整的饿了么(18)购物车详细信息的展示与删除
  • Yeoman_Bower_Grunt
  • 前端知识点整理(待续)
  • 浅谈Golang中select的用法
  • 如何优雅的使用vue+Dcloud(Hbuild)开发混合app
  • 中国人寿如何基于容器搭建金融PaaS云平台
  • 1.Ext JS 建立web开发工程
  • ​2020 年大前端技术趋势解读
  • ​ubuntu下安装kvm虚拟机
  • #DBA杂记1
  • (04)Hive的相关概念——order by 、sort by、distribute by 、cluster by
  • (4)事件处理——(6)给.ready()回调函数传递一个参数(Passing an argument to the .ready() callback)...
  • (zz)子曾经曰过:先有司,赦小过,举贤才
  • (附源码)springboot掌上博客系统 毕业设计063131
  • (篇九)MySQL常用内置函数
  • (十三)Flask之特殊装饰器详解
  • (算法)前K大的和
  • (学习日记)2024.01.09
  • (原创)Stanford Machine Learning (by Andrew NG) --- (week 9) Anomaly DetectionRecommender Systems...
  • (转) 深度模型优化性能 调参
  • (转)大道至简,职场上做人做事做管理
  • (转)关于如何学好游戏3D引擎编程的一些经验
  • *Django中的Ajax 纯js的书写样式1
  • ./indexer: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object fil
  • .L0CK3D来袭:如何保护您的数据免受致命攻击