SQL Server 检查点

发布于 2024-07-19 05:03:23 字数 33 浏览 2 评论 0原文

谁能解释一下 SQL Server 何时发出检查点?

can anyone explain when SQL Server issues a checkpoint?

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

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

发布评论

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

评论(1

浮光之海 2024-07-26 05:03:23

来自: http://msdn.microsoft.com/en-us/library/ms188748 .asp

导致检查点的事件
在数据库备份之前,数据库引擎会自动执行检查点,以便对数据库页的所有更改都包含在备份中。 此外,当发生以下任一情况时,检查点会自动发生:

  • 日志的活动部分超过
    服务器可以容纳的大小
    在一定时间内恢复
    指定恢复间隔
    服务器配置选项。
  • 日志已满 70%,并且
    数据库处于日志截断模式。
    数据库处于日志截断模式
    当这两个条件都为真时:
    数据库使用简单
    恢复模型,以及执行后
    最后一个 BACKUP DATABASE 语句的
    引用数据库之一
    发生以下事件:
  • 最小记录操作
    在数据库中执行,例如
    最少记录的大容量复制操作
    或最少记录的 WRITETEXT
    语句被执行。 改变
    执行 DATABASE 语句
    添加或删除
    中的文件
    数据库。

此外,停止服务器会在服务器上的每个数据库中发出一个检查点。 以下停止 SQL Server 的方法会对每个数据库执行检查点:

使用 SQL Server 配置管理器。
使用 SQL Server Management Studio。
使用 SHUTDOWN 语句。

from: http://msdn.microsoft.com/en-us/library/ms188748.asp

Events That Cause Checkpoints
Before a database backup, the Database Engine automatically performs a checkpoint so that all changes to the database pages are contained in the backup. In addition, checkpoints occur automatically when either of the following conditions occur:

  • The active portion of the log exceeds
    the size that the server could
    recover in the amount of time
    specified in the recovery interval
    server configuration option.
  • The log becomes 70 percent full, and
    the database is in log-truncate mode.
    A database is in log truncate mode
    when both these conditions are TRUE:
    the database is using the Simple
    recovery model, and, after execution
    of the last BACKUP DATABASE statement
    that referenced the database, one of
    the following events occurs:
  • A minimally logged operation is
    performed in the database, such as a
    minimally logged bulk copy operation
    or a minimally logged WRITETEXT
    statement is executed. An ALTER
    DATABASE statement is executed that
    adds or deletes a file in the
    database.

Also, stopping a server issues a checkpoint in each database on the server. The following methods of stopping SQL Server perform checkpoints for each database:

Using SQL Server Configuration Manager.
Using SQL Server Management Studio.
Using the SHUTDOWN statement.

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