Here is a quick tip on how to recoup some space on you SQL server.
Make sure you have shrunk all your databases and logs, maybe set a task to do it periodically.
This procedure will make sure all database have enough space to process transactions.
What it does not do is to physically shrink the logs, so you might end up running out of space anyway.
I found the following procedure simple and it saves me from having to add more disk space to my servers.
· Identify all databases that have growing log files.
· You need to have admin rights to the server and MS SQL.
· Schedule and outage for the affected databases, make sure no users are connecting to these databases. There is no need to stop/start SQL. I prefer to stop MS SQL services.
· Identify the location of your MDF and LDF files.
· Detach the databases using sp_detach_db N'<Database Name>'
· Find the LDF file for the detached database and delete it. You can copy or rename the file, but move it away from it current location since you are trying to recuperate space.
· Re-attach the database. Use the following command to perform this operation: sp_attach_single_file_db ‘<database name>’, ‘<database mdf file location>’
· Restart SQL Services.
· Update stats for all databases
This will reattach the database and create a new LDF file. Depending on how the database is used this operation might need to be done frequently which could help make an argument to increase disk space on the server. You could also have a dba look at the procedures of the database and identify what could be causing the log files to grow.
NOTE: Remember to backup all databases before any changes are made.