Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Unable to Shrink Database Size

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-07 : 08:09:43
Nandip writes "Hello Friends,
I am having a problem when reducing the size of my database.
I am working in an ISP and the size of our database grows
at a considerable rate. As a result we decided to move the old
information in the table in a summarize ways. Thus a number of records were removed from the database.Before moving the records the size of my database was around 8 GB and after moving the records the size was same. We tried to shrink the database as well as files with the respect commands and proper parameter.
i.e DBCC SHRINKDATABASE and DBCCSHRINKFILE , but even after doing so there was no much change in the size of our transaction log. The log file(.ldf) has now grown upto 8.5 GB while the
physical file(.mdf) is 1.5 GB. So we are nearing to the full harddisk space day by day. I also noticed that even the log file of tempdb database has been grown upto 1 GB.
I read the articles that you have posted in you side and
tried to implement it but in vain.
Please let me know what exact steps should i take to solve this problem.
If you have any place where i would be able to get the information then please let me know.
Thank you."

chadmat
The Chadinator

1974 Posts

Posted - 2003-05-07 : 11:55:35
What version of SQL Server?

In 2000 Shrinkfile works like a champ. In 7.0 you have to do some things to get it to work.

For log files, make sure you do a backup first, then backup the log with NO_LOG or TRUNCATE_ONLY then run the dbcc shrinkfile.

If there is free space in the database, you can just run the shrinkfile on the data file, and it should shrink as much as it can.

For 7.0:
http://support.microsoft.com/default.aspx?scid=kb;en-us;256650

For 2000:
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

Konrad
Starting Member

2 Posts

Posted - 2003-05-07 : 12:55:14
I had similar problem and I found excellent script (creating stored procedure sp_force_shrink_log )

http://www.pinnaclepublishing.com/SQ/SQmag.nsf/0/F36C151BD80FAD8F852568D0007799BE

Go to Top of Page
   

- Advertisement -