vlf 用法_什么是SQL虚拟日志文件(又名SQL Server VLF)?

vlf 用法

In this article we’ll review SQL Virtual Log files aka SQL Server VLFs, providing an overview and review topics related to size, performance, monitoring and troubleshooting.

在本文中,我们将回顾SQL虚拟日志文件(又名SQL Server VLF),提供概述并回顾与大小,性能,监视和故障排除有关的主题。

In a previous article of this series, SQL Server Transaction Log Architecture, we described the internal architecture of the SQL Server transaction log, why and how the SQL Server Engine uses the transaction log and finally how the transaction log truncation process occurs. In this article, we will discuss the Virtual Log File concept in-depth.

在本系列的上一篇文章“ SQL Server事务日志体系结构”中 ,我们描述了SQL Server事务日志的内部体系结构,SQL Server Engine为什么以及如何使用事务日志以及最终如何进行事务日志截断过程。 在本文中,我们将深入讨论虚拟日志文件的概念。

虚拟日志文件概述 (Virtual Log File Overview)

In SQL Server, each transaction log is logically divided into smaller segments, in which the log records are written. These small segments are called SQL Virtual Log Files, also known as VLFs. When the transaction log file is created or extended, the number of SQL Server VLFs in the transaction log and the size of each Virtual Log File are determined dynamically. On the other hand, the size that is determined for the first Virtual Log File will be used for all newly created SQL Virtual Log Files on the same transaction log.

在SQL Server中,每个事务日志在逻辑上分为较小的段,在这些段中写入了日志记录。 这些小段称为SQL 虚拟日志文件 ,也称为VLF。 创建或扩展事务日志文件时,将动态确定事务日志中SQL Server VLF的数量和每个虚拟日志文件的大小。 另一方面,为第一个虚拟日志文件确定的大小将用于同一事务日志上所有新创建SQL虚拟日志文件。

When a new log record is written, the SQL Server Engine will use the existing unused SQL Server VLFs. If all the existing SQL Virtual Log Files are active and the transaction log file extend is required, new SQL Server VLFs will be created based on the size of the transaction log to be written.

写入新的日志记录时,SQL Server引擎将使用现有的未使用SQL Server VLF。 如果所有现有SQL虚拟日志文件均处于活动状态,并且需要扩展事务日志文件,则将根据要写入的事务日志的大小来创建新SQL Server VLF。

事务日志文件大小 (Transaction Log File Size )

When a new SQL user database is created, two database files will be created, a database data file, with MDF extension, in which the tables data will be written and a database log file, with LDF extension, in which all the database transactions will be written for recovery purposes.

创建新SQL用户数据库时,将创建两个数据库文件,一个扩展名为MDF的数据库数据文件(将在其中写入表数据)和一个扩展名为LDF的数据库日志文件,其中将包含所有数据库事务。为恢复目的而编写。

By default, the initial size and the auto-growth settings for the transaction log file will meet the initial size and auto-growth settings of the model system database. For example, in SQL Server 2016, the initial size of the transaction log file is 8MB, that can be increased with the auto-growth amount of 64MB, with no limitation for the maximum file size, as shown below:

默认情况下,事务日志文件的初始大小和自动增长设置将满足模型系统数据库的初始大小和自动增长设置。 例如,在SQL Server 2016中,事务日志文件的初始大小为8MB,可以随着64MB的自动增长量而增加,而对最大文件大小没有限制,如下所示:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值