andrew slaughter
andrew slaughter

Reputation: 1117

sqlserver 2012 320gb log file

just been looking on our sqlserver running mssql 2012 and the c drive is filling up quick. I've had a look around and there is a "LogLiveV2.log" file which just over 320gb in

C:\Program Files\Microsoft SQL Server\MSSQL11.AA9SQLSERVER\MSSQL\DATA.

does anyone know what it is and how I can either shrink it or delete it "

Upvotes: 0

Views: 89

Answers (3)

Ricky
Ricky

Reputation: 2374

The log file holds the database transaction log.

Just set the database recovery mode to SIMPLE, then forget about LDF - it will be small. This is the recommended solution for most of the cases.

Note The transaction logs are very important for maintaining the transnational integrity of the database. You can shrink the transnational log file but do not delete the transaction log files, even after you make a backup of your database and the transaction logs.

Upvotes: 0

Raj
Raj

Reputation: 10843

The .log file and the .ldf files are two different things. If it is the .ldf file, then all answers posted about SIMPLE RECOVERY and SHRINKFILE are correct. However, if you are referring to a .log file, it would be an event log file of some sort.

Upvotes: 0

Pred
Pred

Reputation: 9042

If your database is not in simple recovery model, the log files are not reclaimed automatically, so you have to backup the log files to truncate them.

If you do not want to backup them, you have to set the recovery model to Simple, then run a DBCC SHRINKFILE command to shrink the logfile.

You can read more at http://msdn.microsoft.com/en-us/library/ms186865.aspx (Transaction Log Truncation section)

To avoid filling up the transaction log of a database, routine backups are essential. Under the simple recovery model, log truncation occurs automatically after you back up the database, and under the full recovery model, after you back up the transaction log. However, sometimes the truncation process can be delayed. For information about factors that can delay log truncation, see The Transaction Log (SQL Server).

About recovery models: http://msdn.microsoft.com/en-us/library/ms189275.aspx

Upvotes: 0

Related Questions