Automatic Checkpoint Tuning

作者: Maclean Liu , post on April 19th, 2008 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: Automatic Checkpoint Tuning
本文永久地址: http://www.oracledatabase12g.com/archives/automatic-checkpoint-tuning.html

Applies to:

Oracle Server – Enterprise Edition – Version: 10.1.0.2 to 11.2.0.2 – Release: 10.1 to 11.2
Information in this document applies to any platform.
“Checked for relevance on 04-Dec-2007″
***Checked for relevance on 29-Jul-2010***

Goal

Tuning Automatic Checkpoint in 10G

Solution

Checkpoints are means of synchronizing the data modified in memory with the data files of the database. By periodically
writing modified data to the data files between checkpoints Oracle Database ensures that sufficient amounts of memory are
available, improving the performance of finding free memory for incoming operations.

Checkpointing is of 2 types:

1. Normal checkpoint.
2. Incremental checkpoint.

1. Normal checkpoint will update the control file as well as all datafile headers.
2. Incremental checkpoint will update only the control file.

Incremental checkpoint is:

> Continuously active checkpoint
> no completion RBA
> checkpoint advanced in memory only
> RBA for incremental checkpoint recorded in control file.
> DBW0 writes out dirty buffers to advance the incremental checkpoint.
> Used to reduce recovery time after a failure.

Incremental checkpoint is determined by:

> Upper bound on recovery needs.
> size of the smallest log file
> value of log_checkpoint_interval
> value of log_checkpoint_timeout
> Total numbers of dirty buffers in the cache.

In 8i:
===

Checkpoint tuning is controlled by three parameters :

LOG_CHECKPOINT_INTERVAL
LOG_CHECKPOINT_TIMEOUT
FAST_START_IO_TARGET

The fast-start checkpointing feature limits the number of dirty buffers and thereby limits the amount of time required for
instance recovery. If Oracle must process an excessive number of I/O operations to perform instance recovery, then
performance can be adversely affected. You can control this overhead by setting an appropriate value for the parameter

FAST_START_IO_TARGET.

However, aggressive checkpointing can reduce run-time performance, because checkpointing causes DBWn processes to perform
I/O. The overhead associated with checkpointing is usually small.

In 9i:
===

New parameter is introduced – FAST_START_MTTR_TARGET.

The FAST_START_MTTR_TARGET initialization parameter simplifies the configuration of recovery time from instance or system
failure. This parameter lets you specify the number of seconds crash or instance recovery is expected to take. The
FAST_START_MTTR_TARGET is internally converted to a set of parameters that modify the operation of Oracle such that recovery
time is as close to this estimate as possible.

The maximum value for FAST_START_MTTR_TARGET is 3600, or one hour. If you set the value to more than 3600, then Oracle rounds
it to 3600. There is no minimum value for FAST_START_MTTR_TARGET. However, this does not mean that you can target the
recovery time as low as you want. The time to do a crash recovery is limited by the low limit of the target number of dirty
buffers, which is 1000, as well as factors such as how long initialization and file open take.

In 10g:
=====

Starting with Oracle Database 10g, the database can self-tune checkpointing to achieve good recovery times with low impact on normal throughput. With automatic checkpoint tuning, Oracle Database takes advantage of periods of low I/O usage to write out data modified in memory to the data files without adverse impact on the throughput. Thus, a reasonable crash recovery time can be achieved even if the administrator does not set any checkpoint-related parameter or if this parameter is set to a very large value.

Oracle Database 10g supports automatic checkpoint tuning which takes advantage of periods of low I/O usage to advance
checkpoints and therefore improve availability. Automatic checkpoint tuning is in effect if the FAST_START_MTTR_TARGET
database initialization parameter is set to a nonzero value. Observe the following recommendations to take advantage of automatic checkpoint tuning.

If it is necessary to control the time to recover from an instance or node failure, then set FAST_START_MTTR_TARGET to the
desired MTTR in seconds. If targeting a specific MTTR is unnecessary, then set FAST_START_MTTR_TARGET to a nonzero value to enable automatic checkpoint tuning. Fast-start checkpointing can be disabled by setting FAST_START_MTTR_TARGET=0. Disable fast-start checkpointing only when system I/O capacity is insufficient with fast-start checkpointing enabled and achieving a target MTTR is not important.Enabling fast-start checkpointing increases the average number of writes per transaction that DBWn issues for a given workload (when compared with disabling fast-start checkpointing). However, if the system is not already near or at its maximum I/O capacity, then fast-start checkpointing has a negligible impact on performance. The percentage of additional DBWn writes with very aggressive fast-start checkpointing depends on many factors, including the workload, I/O speed and capacity, CPU speed and capacity, and the performance of previous recoveries.

If FAST_START_MTTR_TARGET is set to a low value, then fast-start checkpointing is more aggressive, and the average number of
writes per transaction that DBWn issues is higher in order to keep the thread checkpoint sufficiently advanced to meet the
requested MTTR. Conversely, if FAST_START_MTTR_TARGET is set to a high value, or if automatic checkpoint tuning is in effect
(that is, FAST_START_MTTR_TARGET is set to a nonzero value), then fast-start checkpointing in less aggressive, and the average number of writes per transaction that DBWn issues is lower.

Fast-start checkpointing can be explicitly disabled by setting FAST_START_MTTR_TARGET=0. Disabling fast-start checkpointing
leads to the fewest average number of writes per transaction for DBWn for a specific workload and configuration, but also
results in the highest MTTR.

Scope

Automatic Checkpoint Tuning
===========================
Oracle Database 10g supports automatic checkpoint tuning. It is enabled if fast_start_mttr_target is explicitly set to an non-zero value, or if fast_start_mttr_target is not set at all.

It is an advancement over the MTTR related parameter introduced in earlier versions. The idea is to use the periods of low I/O usage to advance checkpoints and therefore improve availability.

How to enable:
==============
Automatic checkpoint tuning is enabled by default. If it is disabled, by setting the parameter to zero explicitly, you can enable it by unsetting FAST_START_MTTR_TARGET or set it to a nonzero value. If you set this parameter to zero this feature will be disabled.
Note: this is different from defaulting (i.e. not setting) fast_start_mttr_target to 0.

It can be done statically using the initialization files or dynamically using
SQL> alter system set FAST_START_MTTR_TARGET=10;

Note: This is measured in seconds

When to enable
==============
- system I/O capacity is insufficient with fast-start checkpointing
- If it is necessary to control the time to recover from an instance or node failure, then set FAST_START_MTTR_TARGET to the desired MTTR in seconds.

How it works
============
Enabling fast-start checkpointing increases the average number of writes per transaction that DBWn issues for a given workload. However, if the system is not already near or at its maximum I/O capacity, then
fast-start checkpointing has a negligible impact on performance

How to monitor
==============
View V$MTTR_TARGET_ADVICE will give information on the additional I/O’s on various values of FAST_START_MTTR_TARGET.

PROs and CONs:
=============
- FAST_START_MTTR_TARGET is set to a low value :
Fast-start checkpointing is more aggressive. The average number of writes per transaction that DBWn issues is higher in order to keep the thread checkpoint sufficiently advanced to meet the requested MTTR.

- FAST_START_MTTR_TARGET is set to a high value:
Fast-start checkpointing in less aggressive, and the average number of writes per transaction that DBWn issues is lower.

In both cases automatic checkpoint is enabled.

- FAST_START_MTTR_TARGET is unset:
automatic checkpoint tuning is in effect. Average number of writes per transaction is reduced but at the same time MTTR is highest.

Point to Note:
==============
When you enable fast-start checkpointing, remove or disable (set to 0) the following initialization parameters:
- LOG_CHECKPOINT_INTERVAL
- LOG_CHECKPOINT_TIMEOUT
- FAST_START_IO_TARGET

© 2008 – 2011, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.

相关文章 | Related posts:

  1. AUTOMATIC UNDO INTERNALS
  2. RMAN Performance Tuning Using Buffer Memory Parameters
  3. TROUBLESHOOTING: Tuning Queries That Cannot be Modified
  4. Scripts for Oracle Streams Performance Tuning Best Practice: Oracle 10g Release 10.2

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>