Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change MDF Space Allocated

Status
Not open for further replies.

navshiv

MIS
Feb 15, 2002
91
US
Hi

We have a database which is rarely used now but taking a lot of disk space (19Gb). I have truncated a lot of tables and ran the Shrink Database option (right click on database) but db is still 19GB. When I go into the properties for the Data File the Space Allocated (MB) says 19494. When I try to change this here it to say 30000 I get the error file 'Cognos Data Warehouse_Data does not exist (I notice no ' at the end of the name). I can see the name to the left of the path reads Cognos Data Warehouse_Data so I cannot see why it tells me it cannot find it. I can also see the .mdf file in the correct path

When I run the command below I get the same error.

ALTER DATABASE Cognos
MODIFY FILE
(NAME = [Cognos Data Warehouse_Data],
SIZE = 3GB)
GO

Anyone have any ideas at all where I am going wrong? Any help would be appreciated.

Cheers
 
Sounds like the DB really is 19GB but it would probably compress quite well so why not try putting it into a compressed folder? If necessary, detach it first, move it to the new compressed folder and then reattach it.

Since the DB is only used rarely the overheads of using a compressed file should be acceptable.



Bob Boffin
 
Check logical file names in sysfiles:

select *
from sysfiles.

Is there any row with name='Cognos Data Warehouse_Data' (exactly)?

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
Thanks for that Bob. In the end I exported all the data into a new DB, deleted the old one, re-created it and imported the data back in. Not sure why I didn't do that in the first place.

It has now gone from 19Gb to 3Gb.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top