Tablets How to shrink SQL 2008 Tempdb and other Database Files | BLOG IT

How to shrink SQL 2008 Tempdb and other Database Files

Recently I was trying to shrink a database file (extension mdf) for a database which size was 120GB, I tried with Microsoft tools like DBCC ShrinkFile, and with the SSMS (by selecting Task/Shrink/Files) and none of these works for me.

My database is in Full Mode and my server is a Microsoft Windows Server Standard 2008 with Microsoft SQL Server Enterprise 2008.

In order to know the free disk space database had I used SSMS selecting Task/Shrink/Files and taking note about "Available free space:".

Then  I select database properties and on "Files" option I go to the file which I want to reduce size, in this case the main database file (extension mdf) and over the "Initial Size (MB)" column I put the New size I want to the file has(Initial Size (MB) - Available free Space). I did this on steps, I decreased size around 3GB on each step, each one delays around four minutes.

Also I did this with TempDB database and works fine.

My database is working fine and I recovered the lost space.

I hope It could help you.

About Robert SA

    Blogger Comment
    Facebook Comment

0 comentarios: