如何控制日志开关和检查点频率?

发布于 2024-09-16 13:26:19 字数 165 浏览 2 评论 0原文

LOG_CHECKPOINT_INTERVAL 和 LOG_CHECKPOINT_TIMEOUT 之间有什么区别?我需要清楚地了解基于交易量的间隔和基于时间的间隔。 LOG_CHECKPOINT_TIMEOUT、LOG_CHECKPOINT_INTERVAL和FAST_START_IO_TARGET之间有什么关系?

What are the differences between LOG_CHECKPOINT_INTERVAL and LOG_CHECKPOINT_TIMEOUT? I need a clear picture of volume based intervals and time based interval. What are the relations among LOG_CHECKPOINT_TIMEOUT,LOG_CHECKPOINT_INTERVAL and FAST_START_IO_TARGET?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2024-09-23 13:26:19

检查点是数据库将缓冲区高速缓存中的脏块与数据文件同步的时间。也就是说,它将更改的数据写入磁盘。您提到的两个 LOG_CHECKPOINT 参数控制此活动发生的频率。

问题的核心是:如果检查点很少出现,那么在崩溃时恢复数据库将需要更长的时间,因为它必须应用重做日志中的大量数据。另一方面,如果检查点出现得太频繁,数据库可能会被占用,因为各种后台进程会成为瓶颈。

两者之间的区别在于,INTERVAL 指定检查点之间可以存在的最大重做块数,而 TIMEOUT 指定检查点之间的最大秒数。我们需要设置这两个参数来适应剧烈活动的高峰。请注意,LOG_CHECKPOINT_INTERVAL 是在操作系统块而不是数据库块中测量的。

FAST_START_IO_TARGET 是一个不同的提议。它指定恢复数据库所需的 I/O 数量的目标。然后,数据库智能地管理其检查点以实现这一目标。同样,这是恢复时间和后台活动量之间的权衡,尽管对正常处理的影响应该小于错误设置的 LOG_CHECKPOINT 参数。该参数仅适用于企业版。它在 9i 中已被弃用,取而代之的是 FAST_START_MTTR_TARGET,Oracle在10g中删除了它。有一个视图 V$MTTR_TARGET_ADVICE其中,呃,提供了有关设置 FAST_START_MTTR_TARGET 的建议。

我们应该设置 FAST_START%TARGET 或 LOG_CHECKPOINT_% 参数,但不能同时设置两者。设置 LOG_CHECKPOINT_INTERVAL 将覆盖 FAST_START_MTTR_TARGET 的设置。

A checkpoint is when the database synchronizes the dirty blocks in the buffer cache with the datafiles. That is, it writes changed data to disk. The two LOG_CHECKPOINT parameters you mention govern how often this activity occurs.

The heart of the matter is: if the checkpoint occurs infrequently it will take longer to recover the database in the event of a crash, because it has to apply lots of data from the redo logs. On the other hand, if the checkpoint occurs too often the database can be tied up as various background processes become a bottleneck.

The difference between the two is that the INTERVAL specifies the maximum amount of redo blocks which can exist between checkpoints and the TIMEOUT specifies the maximum number of seconds between checkpoints. We need to set both parameters to cater for spikes of heavy activity. Note that LOG_CHECKPOINT_INTERVAL is measured in OS blocks not database blocks.

FAST_START_IO_TARGET is a different proposition. It specifies a target for the number of I/Os required to recover the database. The database then manages its checkpoints intelligently to achieve this target. Again, this is a trade-off between recovery times and the amount of background activity, although the impact on normal processing should be less than badly set LOG_CHECKPOINT paremeters. This parameter is only available withe the Enterprise Edition. It was deprecated in 9i in favour of FAST_START_MTTR_TARGET, and Oracle removed it in 10g. There is a view V$MTTR_TARGET_ADVICE which, er, provides advice on setting the FAST_START_MTTR_TARGET.

We should set either the FAST_START%TARGET or the LOG_CHECKPOINT_% parameters but not both. Setting the LOG_CHECKPOINT_INTERVAL will override the setting of FAST_START_MTTR_TARGET.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文