How could I reduce the size of log file?

1.3k Views Asked by At

I have done a delete operation on a table with many records, so my log file grew from 15 GB to 58 GB. At some point I canceled the execution of delete query because my hdd was running out of space. I have seen here how to delete this big amount of data. My question is how could I reduce the size of log file back to 15 GB?

1

There are 1 best solutions below

1
On

If you use a full recovery model, then you are essentially preserving all the history of your database in your logs.

Most likely you want to switch to simple recovery model, followed by DBCC SHRINKFILE as others have suggested.

See here: https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/recovery-models-sql-server?view=sql-server-ver15