If you cannot get that d@mn log file to shrink, here’s a neat trick I learned from Christian Arheim:
- Make a backup of the files. MS Backup will do if you do not have anything else or if you are in a hurry.
- Open
MS SQL Enterprise Manager - Open the tree on the left hand side to reveal the database owning the offending log file
- Right-click it and select
Properties - In the left-hand-side of the window appearing, select
Options - To the right, locate
Recovery modeland selectSimple(and – important – make a note of what it was) - Select
OK - Right-click the database again and this time select
Tasks–Shrink–Files - In the window appearing select
File typeto beLogand selectOK - After shinking finishes, you must now reset the recovery model. Do this:
- Right-click database and select
Properties - In the left-hand-side of the window appearing, select
Options - To the right, locate
Recovery modeland select what noted it to be in #5 above. You forgot to write it down? You FAIL! - Select
OK
The log should now be down to an absolute minimum for this database.
No Comments