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
 db file wont shrink
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

albertkohl
Aged Yak Warrior

USA
740 Posts

Posted - 06/20/2013 :  15:00:38  Show Profile  Visit albertkohl's Homepage  Reply with Quote
for some odd reason, i can not get this file to shrink.

this is currently what im doing:



ALTER DATABASE CONSUMER SET RECOVERY SIMPLE
GO
ALTER DATABASE CONSUMER SET RECOVERY FULL
GO

EXEC	dba.[dbo].[isp_Backup]
		@path = N'\\n8800\mssql\BACKUPS\DBSERVER02',
		@dbType = '-CONSUMER',
		@bkpType = N'FULL',
		@retention = 30,
		@bkpSwType = N'NC'
GO

Checkpoint 
GO

DBCC SHRINKFILE ('CONSUMER_201306_04',100000,Truncateonly)
go

ALTER DATABASE CONSUMER SET RECOVERY SIMPLE


all other files (1,2,3,5) shrink fine, but this one has about twice as much space as it needs, and i cant shrink it. any ideas?

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 06/24/2013 :  18:21:34  Show Profile  Visit tkizer's Homepage  Reply with Quote
Shrink in small increments instead. I use MVJ's script that he posted here a while ago. His I think shrinks in 50MB chunks, but I always change that to a higher value such as 500MB or even 1024MB.

And if that doesn't work, try rebuilding the indexes and then shrinking in small chunks.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 06/24/2013 :  18:24:27  Show Profile  Visit tkizer's Homepage  Reply with Quote
Here's the script: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80355

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

ditch
Flowing Fount of Yak Knowledge

South Africa
1466 Posts

Posted - 06/24/2013 :  23:45:04  Show Profile  Visit ditch's Homepage  Reply with Quote
Hi Tara, I read about your approach about shrinking in blocks of 100MB last week, and I must feedback that it works perfectly.
Thanks.


Duane.
http://ditchiecubeblog.wordpress.com/
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.08 seconds. Powered By: Snitz Forums 2000