SQL Server:什么是虚拟日志文件?

发布于 2024-10-05 22:23:21 字数 32 浏览 0 评论 0原文

SQL Server 中的虚拟事务日志文件是什么?

What is the Virtual Transaction Log file in SQL Server?

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

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

发布评论

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

评论(1

呆° 2024-10-12 22:23:21

来自 MSDN

SQL Server 数据库引擎划分
每个物理日志文件内部
许多虚拟日志文件。虚拟的
日志文件没有固定大小,并且
虚拟的数量没有固定的
物理日志文件的日志文件。这
数据库引擎选择的大小
动态虚拟日志文件
在创建或扩展日志时
文件。数据库引擎尝试
维持少量虚拟
文件。虚拟文件的大小
日志文件扩展后是
现有大小的总和
日志和新文件的大小
增量。尺寸或数量
无法配置虚拟日志文件
或由管理员设置。


事务日志是一个环绕日志
文件。例如,考虑一个数据库
划分一个物理日志文件
分为四个虚拟日志文件。当
数据库创建完毕,逻辑日志
文件开始于
物理日志文件。新的日志记录是
添加在逻辑日志的末尾
并向末尾扩展
物理日志。日志截断可以释放任何
记录全部出现的虚拟日志
最小恢复日志前面
序列号(MinLSN)。

替代文本

当逻辑日志结束时
到达物理日志末尾
文件中,新的日志记录环绕
到物理日志文件的开头。

替代文本

From MSDN:

The SQL Server Database Engine divides
each physical log file internally into
a number of virtual log files. Virtual
log files have no fixed size, and
there is no fixed number of virtual
log files for a physical log file. The
Database Engine chooses the size of
the virtual log files dynamically
while it is creating or extending log
files. The Database Engine tries to
maintain a small number of virtual
files. The size of the virtual files
after a log file has been extended is
the sum of the size of the existing
log and the size of the new file
increment. The size or number of
virtual log files cannot be configured
or set by administrators.


The transaction log is a wrap-around
file. For example, consider a database
with one physical log file divided
into four virtual log files. When the
database is created, the logical log
file begins at the start of the
physical log file. New log records are
added at the end of the logical log
and expand toward the end of the
physical log. Log truncation frees any
virtual logs whose records all appear
in front of the minimum recovery log
sequence number (MinLSN).

alt text

When the end of the logical log
reaches the end of the physical log
file, the new log records wrap around
to the start of the physical log file.

alt text

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