Thursday, February 16, 2012

am I using SHRINKFILE correctly?

I created some huge tables over the weekend for testing and I have since
dropped them since I don't need them however my database is still over 3
gig. (pre testing size was a few hundred meg)
I'm doing
DBCC SHRINKFILE(mydatabase_Data,TRUNCATEONLY )
DBCC SHRINKFILE(mydatabase_v1_Log,1)
and it seems to be working but the file size of the mdf file remains over 3
gig.
What am I missing here ?
Thanks alot.Hi
It seems that there is still data in one of the later extents and
TRUNCATEONLY does not re-allocate this to an earlier free extent. Try
specifying a target size instead.
John
"D" wrote:

> I created some huge tables over the weekend for testing and I have since
> dropped them since I don't need them however my database is still over 3
> gig. (pre testing size was a few hundred meg)
> I'm doing
> DBCC SHRINKFILE(mydatabase_Data,TRUNCATEONLY )
> DBCC SHRINKFILE(mydatabase_v1_Log,1)
> and it seems to be working but the file size of the mdf file remains over
3
> gig.
> What am I missing here ?
> Thanks alot.
>
>|||That did it. Cool ! Thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:085AADB1-D52A-488D-BE04-E5976C34D4DA@.microsoft.com...[vbcol=seagreen]
> Hi
> It seems that there is still data in one of the later extents and
> TRUNCATEONLY does not re-allocate this to an earlier free extent. Try
> specifying a target size instead.
> John
> "D" wrote:
>

No comments:

Post a Comment