SQL Server log files (LDF files) are growing large. How can I shrink them?
Last modified on 11 August 2020 01:01 PM
|
|
The log file is maintained by SQL server, and managing its size is a SQL Server administration issue. The LDF file is the transaction log that allows you to perform “point in time” restores if you have system failures. The way it works is that you can restore from your last full backup and “replay” the transactions from the transaction log file. All of this sounds great, but you really need to be geared up to support it. For example, if your transaction log files are stored on the same disk as your database, then if something goes wrong you’ll lose the database and the logs. So if you really want to use these, then you need to implement “transaction log shipping” which moves transaction logs to another system. If you don’t want to use point-in-time recovery then you can disable it completely. This means that SQL won’t bother to create the transaction logs at all. You can do this by changing the recovery model to ![]()
Disk Full ErrorsIf your log files are full or you’ve run out of disk space on your database server you may receive errors like the following within PaperCut:
or
or
| |
|