RE: Unused space in DB

RE: Unused space in DB

 

  

Hi Ruan,

Thanks for your reply. I ran this query, but the result is still the
same. The mdf size is still 36GB and unused space is still 22GB.

Thanks
Gaurav

-----Original Message-----
From: Ruan Crafford [mailto:[Email address protected]
Sent: Tuesday, July 31, 2007 11:06 AM
To: Gaurav Kohli
Subject: RE: Unused space in DB

**A LazyDBA.com subscriber has responded to your lazydba.com post**
**LazyDBA.com mail shield has forwarded you this email,
**and removed any attachments, and kept your email address secret
**from this person, and any viruses/trojans.
**If you reply to this email, the person will see your email address as
normal
**Anything below this line is the original email text


Hi Gaurav

I once had the same problem, and ran the query below and it worked, you
can try it out.


dump tran DATABASENAME with no_log
Checkpoint
dbcc checkdb
DBCC SHRINKDATABASE (DATABASENAME, 0,TRUNCATEONLY )

Cheers
R



-----Original Message-----
From: Gaurav Kohli
[Email address protected]
Sent: 2007-07-31 07:32
To: LazyDBA Discussion
Subject: Unused space in DB

Hi Experts,

Below is the result of "sp_SpaceUsed" on one of our database in SQL
Server 2000.

Reserved: 35926800 KB
Data: 10906952 KB
Index Size: 2400560 KB
Unused: 22619288 KB

It shows 22GB of unused space. The mdf file size is 36 GB out o which 22
GB is unused.

Is there anyway I can reduce the size of this file so that the mdf file
size gets reduced by 22GB?

I tried DBCC SHRINKFILE, but it reduces the size by only 2GB and after a
few minutes the size gets back to 36 GB.

Pls advise.

Thanks
Gaurav



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html








MS Sql Server LazyDBA home page