I've recently been involved with a project to migrate a customer's SQL Server environment to a new server. Since the migration, the .ldf
file for a particular database on the new server is growing every night to be at least the same size if not larger than the .mdf
file. It either was not doing this on the old server, or it was growing then automatically shrinking back down so it wasn't noticed.
Some background information:
- The database in question is massive (over 300gb)
- There are a number of scripts (Powershell, batch, SQL Server Agent jobs, dtsx files) which run on this database, including one which does a huge number of deletions/inserts (we know this is not ideal and will need addressing)
- The customer assures me that no significant changes have been made to these scripts since the migration (this is hard to verify given the number of scripts involved and the number of people the customer has making changes on the server)
- The database is set to Simple recovery model
- The database is set to auto-grow but not auto shrink
- Manually shrinking the
.ldf
file brings it back down to just under half the size of the.mdf
file - The old SQL Server was running SQL Server version 2019 (v15.0.2140.1), the new is running version 2022 (v16.0.4210.1)
- The database is not regularly backed up in any way
From what I can tell, there are no differences between how the SQL Servers are configured, or how the database itself is configured. The new server is higher spec than the old in terms of processor and RAM.
The only difference I've found between the scripts on old and new is a move from using SQLNCLI11 as the provider in the connection string to MSOLEDBSQL. The database on the new server currently contains fewer records than the old database.
I'm at a dead-end trying to figure out how to explain why we are seeing this issue on the new server when we weren't on the old - can anyone suggest something I've overlooked?
Edited for additional info in response to comments:
- Autogrowth is already set at 64mb
- There was nothing in the old environment doing backups or trimming files
- Unfortunately there was no benchmarking for the scripts on the old server so unknown whether they have regressed or not
The customer assures me
they always do. But somehow, somewhere, they're running a job that generates a ton of log entries. Rebuilding indexes perhaps? Orone which does a huge number of deletions/inserts
?we weren't on the old
are you sure? You saidautomatically shrinking back down
. We can't guess what's going on, and this question says there are a lot of data modifications which always result in large transaction logs, unknown scripts, differences between the servers, differences between the clients, people making changes without anyone noticing. Perhaps someone runs anUPDATE
that touches half the database?