Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 resize database file

Author  Topic 

Wrangler
Starting Member

35 Posts

Posted - 2012-01-23 : 12:55:51
I have a database file size is 42GB, space used is 25GB, and free space is 17GB. The file only contains 4 non clustered indexes and is associated with it's own filegroup.

I'm wondering what the best way to reclaim about 10GB of the datafile? I'm thinking about creating a temp datafile with a temp file group and create the indexes there with drop existing then resize the empty file. Then I can reverse the process and move them back. That seems like a lot of work but I'm trying to do it the "right way."

Any other suggestions?

Thanks,

biswajitdas
Starting Member

44 Posts

Posted - 2012-01-23 : 13:23:39
http://blog.winind.in/index.php/2011/06/29/reduse-size-of-database-in-sqlserver/

Sr Sql server DBA/Artitech
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2012-01-23 : 14:20:36
I'm sorry but I think the advice in that link is incredibly dangerous and very naive.

If your database has grown to a certain size, it has grown for a reason. Truncating some tables and then screwing with the db by shrinking it (and then, god forbid, deleting the transaction log) is not a good idea(TM). I note, at no point in the list of ill advised actions does it suggest taking a backup until the very end...... The transaction log is NOT a dumb log file. It is critically important for the transactional integrity of your database.

Wrangler. before you f**k about with your database, make sure you have a recoverable backup.

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
   

- Advertisement -