Cannot Shrink Log File 2 – SQL

When running an SQL script to shrink a log file, you can get the following error:

Cannot shrink log file 2 because requested size is larger than the start of the last logical log file

This can be caused by a number of things and is kind of a generic error message. In my case, I ran the same script again as a new query instead of in a job, which gave me a more useful error message – It turned out that my database name was spelled incorrectly.

My research shows that you can get an error saying that SQL Server cannot shrink the log file if the database is in use. To get around this, you can view queries open against the database and kill any lingering processes that are keeping the database in use. Obviously this has to be done in a scheduled outage and may cause data corruption, so you have to know what you’re doing here.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Leave a comment

Your email address will not be published. Required fields are marked *