Tuesday, March 27, 2012

DBCC Shrinkdatabase and Shrinkfile

I am trying to shrink the data file of one of my databases
but somehow dbcc shrinkdatabase and shrinkfile does not
seem to work.. There is like 14000MB of free space. i
originally created the database as 2 MB and did a restore.
Does sql server not allow you to shrink the data file.
This is on SQL Server 7.0The space is probably in the log file not the data file.
Run a tlog backup the do a shrinkfile on the log file.
Also read up on "truncate" in BOL.
>--Original Message--
>I am trying to shrink the data file of one of my
databases
>but somehow dbcc shrinkdatabase and shrinkfile does not
>seem to work.. There is like 14000MB of free space. i
>originally created the database as 2 MB and did a
restore.
>Does sql server not allow you to shrink the data file.
>This is on SQL Server 7.0
>.
>|||Funny enough I had the same problem last week, and posted
to this forum.
I can't remember the reasons why but I was advised to
leave it for 24 hours and try again. I did, it worked and
I removed 4.5 gb of unnessary space.
Peter
>--Original Message--
>The space is probably in the log file not the data file.
>Run a tlog backup the do a shrinkfile on the log file.
>Also read up on "truncate" in BOL.
>>--Original Message--
>>I am trying to shrink the data file of one of my
>databases
>>but somehow dbcc shrinkdatabase and shrinkfile does not
>>seem to work.. There is like 14000MB of free space. i
>>originally created the database as 2 MB and did a
>restore.
>>Does sql server not allow you to shrink the data file.
>>This is on SQL Server 7.0
>>.
>.
>|||Ive never heard of that shrink method before. Learn
something new every day. Did the person that gave you that
idea specify what to do if you dont have 24 hours to spare?
>--Original Message--
>Funny enough I had the same problem last week, and posted
>to this forum.
>I can't remember the reasons why but I was advised to
>leave it for 24 hours and try again. I did, it worked and
>I removed 4.5 gb of unnessary space.
>Peter
>
>>--Original Message--
>>The space is probably in the log file not the data file.
>>Run a tlog backup the do a shrinkfile on the log file.
>>Also read up on "truncate" in BOL.
>>--Original Message--
>>I am trying to shrink the data file of one of my
>>databases
>>but somehow dbcc shrinkdatabase and shrinkfile does not
>>seem to work.. There is like 14000MB of free space. i
>>originally created the database as 2 MB and did a
>>restore.
>>Does sql server not allow you to shrink the data file.
>>This is on SQL Server 7.0
>>.
>>.
>.
>

No comments:

Post a Comment