Learning never stops for a consultant. In this blog, I would share another learning and discuss message: cannot shrink log file because the logical log file located at the end of the file is in use.


SQL SERVER   Cannot Shrink Log File 2 (SQLAuthorityDB_log) Because the Logical  ...

Here are some earlier blogs on the same topic where I received messages while trying to shrink the LDF files of the database.

SQL SERVER Cannot Shrink Log File Because Total Number of Logical Log Files Cannot be Fewer than 2 SQL SERVER Information Message: Cannot shrink file in the database to xxxx pages as it only contains yyyy pages.

The whole shrink story started from below blog.

How to Shrink All the Log Files for SQL Server? Interview Question of the Week #203

Many readers have sent me emails with various messages they have seen, and I am writing a blog on them. Following is the information message which might come when you try to shrink the LDF file.

Cannot shrink log file 2 (SQLAuthorityDB_log) because the logical log file located at the end of the file is in use.

DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages ------ ----------- ----------- ----------- ----------- -------------- 10 2 1817448 128 1817448 128 WORKAROUND/SOLUTION

We need to use check the status column of VLFs using

USE DATABASE_NAME
GO
DBCC LOGINFO
GO

More information can be found here.

SQL SERVER Detect Virtual Log Files (VLF) in LDF

Mostly you would see last VLF having status column value as 2, which means active VLF and can’t be released. Next, we should use the following query:

select name, log_reuse_wait_desc
from sys.databases

Based on the output you need to take action and free up the active VLF located at the end. Refer SQL SERVER How to Stop Growing Log File Too Big

Reference: Pinal Dave ( https://blog.sqlauthority.com )


SQL SERVER   Cannot Shrink Log File 2 (SQLAuthorityDB_log) Because the Logical  ...

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

代码区博客精选文章
分页:12
转载请注明
本文标题:SQL SERVER Cannot Shrink Log File 2 (SQLAuthorityDB_log) Because the Logical ...
本站链接:https://www.codesec.net/view/628271.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(95)