| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 121257 | 2011-10-18 08:20:00 | SQL Server log files | jwil1 (65) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 1238246 | 2011-10-18 08:20:00 | Hi all, We use Microsoft SQL Server at work (a mix of 2000 and 2005) and have recently discovered that a couple of our databases have massive log files (.ldf), filling up the disk. In one case it's a 7GB log file for a 200MB database!! Is there a way to safely reduce the size of them so we can reclaim some disk space? I notice that most of our other databases have 1-5MB log files. TIA :) |
jwil1 (65) | ||
| 1238247 | 2011-10-18 11:56:00 | I would probably leave it. If the files are not important, you could delete them, or back them up somewhere to save space. I've never used SQL Server so i am probably wasting my time posting this, but i hope this gets sorted. |
goodiesguy (15316) | ||
| 1238248 | 2011-10-18 17:36:00 | I would probably leave it. If the files are not important, you could delete them, or back them up somewhere to save space. I've never used SQL Server so i am probably wasting my time posting this, but i hope this gets sorted.Please do not give advice on things when you have no idea what you are talking about. Deleting the entire log file (not just contents) in some set-ups can render a system dead in the water, and this isn't someone's home server being discussed. jwil1, I would wait for advice from an experienced SQL server user. |
Jen (38) | ||
| 1238249 | 2011-10-18 18:26:00 | Definitely DON'T delete those files. Are you guys backing up these databases, and if so, how? |
somebody (208) | ||
| 1238250 | 2011-10-18 20:31:00 | Some Server 3rd party backup programs will commit/flush the log files. Doesnt allways work thou. in 2003 there is a reg hack to reduce the log file size (you'll have to google it) In 2008 there is a setting in the SQL management. |
1101 (13337) | ||
| 1238251 | 2011-10-19 00:07:00 | Thanks for the input guys. In the end I asked a friend who has been a DBA and he advised to set the databases in question to use Simple Recovery mode, then shrink the log files. This worked and it's all good now :) |
jwil1 (65) | ||
| 1238252 | 2011-10-19 06:33:00 | Good to hear. Be aware that running in Simple Recovery mode limits the recoverability of your database, should you ever need to restore from backup. | somebody (208) | ||
| 1 | |||||