SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 resize database file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Wrangler
Starting Member

USA
35 Posts

Posted - 01/23/2012 :  12:55:51  Show Profile  Reply with Quote
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

USA
44 Posts

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

Sr Sql server DBA/Artitech

Edited by - biswajitdas on 01/23/2012 13:34:18
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 01/23/2012 :  14:20:36  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
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

Edited by - Transact Charlie on 01/23/2012 14:21:21
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000