Re: Restore Database Size



Demian,

It depends on your file sizes. The BOL on DBCC SHRINKDATABASE says:

The database cannot be made smaller than the minimum size of the database.
The minimum size is the size specified when the database is originally
created, or the last size explicitly set by using a file size changing
operation such as DBCC SHRINKFILE or ALTER DATABASE.

However, as you might infer from that note, it is possible to use DBCC
SHRINKFILE to make the files smaller. So, why don't you try:

DBCC SHRINKFILE ('datafile', sizeyouwant)

RLF


"Demian" <Demian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0D9AA514-B9A9-4185-BFB5-11EE83D48713@xxxxxxxxxxxxxxxx
I have made a copy of a SQL Server 2000 database for testing puposes. Most
of the data in the original database is in one gigantic table. To reduce
the
size of the test database, I have truncated the table in the test
database.
I also did a "shrink database" on the test database, so the database
should
be much smaller. However, the test database is still almost the same size
as
the original. What else can I try to reduce the size of the test
database?

Thanks.


.



Relevant Pages

  • Re: Disaster freeing space in 200GB database
    ... > unindexed ones) are empty so there should be plenty of unused space." ... > This will tell you which indexes have been reserved the most database pages. ... >> DBCC SHRINKFILE since it gives me a finer degree of control. ... >> doesn't take up much log space at all. ...
    (microsoft.public.sqlserver.server)
  • Re: Backup/restore
    ... Columnist, SQL Server Professional ... The database is already shrunk. ... multiple parts, so that I can put it on multiple disks. ... First, use DBCC SHRINKFILE ...
    (microsoft.public.sqlserver.server)
  • Re: Disaster freeing space in 200GB database
    ... If you do have a lot of free data and log space, then you can proceed to recapture that empty space. ... I strongly prefer DBCC SHRINKFILE since it gives me a finer degree of control. ... Senior Database Administrator ... Using shrink> database on the data file didn't seem to work - kept running and running with> the system idle so I eventually stopped it. ...
    (microsoft.public.sqlserver.server)
  • Re: Trying to shrink MDF, but it grew used instead
    ... Based on the output you can shrink the MDF file. ... Alter database set single_user with rollback immediate ... Now execute sp_helpdb to see the size of MDF file. ... DBCC ShrinkFile and the db now is still 17.5GB in size, ...
    (microsoft.public.sqlserver.server)
  • DBCC SHRINKFILE
    ... This caused the mdf file size to increase from 82GB to 109GB. ... Transaction was deadlocked on lock resources with ... Our database is running transactional replication. ... executing the DBCC SHRINKFILE ...
    (microsoft.public.sqlserver.server)

Loading