Chinaunix首页 | 论坛 | 博客
  • 博客访问: 593095
  • 博文数量: 78
  • 博客积分: 2196
  • 博客等级: 大尉
  • 技术积分: 826
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-29 12:46
文章分类

全部博文(78)

文章存档

2012年(7)

2011年(42)

2010年(29)

我的朋友

分类: Oracle

2011-04-13 17:23:27

Checkpoints
During a checkpoint:
• DBWn writes a number of dirty database buffers, which are covered by the log that is
being checkpointed, to the data files.
• The checkpoint background process CKPT updates the control file to reflect that it has
completed a checkpoint successfully. If the checkpoint is caused by a log switch,
CKPT also updates the headers of the data files.
Checkpoints can occur for all data files in the database or only for specific data files.
A checkpoint occurs, for example, in the following situations:
• At every log switch
• When an instance has been shut down with the normal, transactional, or immediate
option
• When forced by setting the FAST_START_MTTR_TARGET initialization parameter
• When manually requested by the database administrator
• When the ALTER TABLESPACE [OFFLINE NORMAL|READ ONLY|BEGIN
BACKUP]command causes checkpointing on specific data files
Information about each checkpoint is recorded in the alert_SID.log file if the
LOG_CHECKPOINTS_TO_ALERT initialization parameter is set to TRUE. The default
value of FALSE for this parameter does not log checkpoints.
--------

ORACLE触发CHECKPOINT的条件

1.当发生日志组切换的时候
2.当符合LOG_CHECKPOINT_TIMEOUT,LOG_CHECKPOINT_INTERVAL,fast_start_io_target,fast_start_mttr_target参数设置的时候
3.当运行ALTER SYSTEM SWITCH LOGFILE的时候
4.当运行ALTER SYSTEM CHECKPOINT的时候
5.当运行alter tablespace XXX begin backup,end backup的时候
6.当运行alter tablespace ,datafile offline的时候

----------

Database Writer (DBWn)
The server process records changes to undo and data blocks in the Database Buffer Cache.
DBWn writes the dirty buffers from the Database Buffer Cache to the data files. It ensures
that a sufficient number of free buffers (buffers that can be overwritten when server
processes need to read in blocks from the data files) are available in the Database Buffer
Cache. Database performance is improved because server processes make changes only in
the Database Buffer Cache.
DBWn defers writing to the data files until one of the following events occurs:
• Incremental or normal checkpoint
• The number of dirty buffers reaches a threshold value
• A process scans a specified number of blocks when scanning for free buffers and
cannot find any
• Timeout occurs
• A ping request in Real Application Clusters (RAC) environment
• Placing a normal or temporary tablespace offline
• Placing a tablespace in read-only mode
• Dropping or truncating a table
• ALTER TABLESPACE tablespace name BEGIN BACKUP

===

The DBWn Process and the Database Buffer Cache

DBWn manages the buffer cache by writing dirty blocks to the data files to ensure that there are free blocks for servers. DBWn responds to different events in the instance. Some of the events that can trigger DBWn to write to disk are:

Checkpoint Queue Exceeds Threshold: A server process finds that the checkpoint queue has exceeded its size threshold, so it signals DBWn to flush. DBWn writes out the buffers on the checkpoint queue.

Search Threshold Exceeded: A server process that cannot find a free buffer on the LRU list within the search threshold signals DBWn to flush checkpoint queue.DBWn writes out dirty buffers directly from the checkpoint queue.

Alter Tablespace Offline or Alter Tablespace Begin Backup: When a tablespace is altered offline or its online backup is started, DBWn copies the dirty buffers for that tablespace from the checkpoint queue to disk.

Drop a Segment: When a segment is dropped, DBWn first flushes the segment's dirty buffers to disk.

Clean Shutdown: (Normal, Immediate, or Transactional)


阅读(1306) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~