Question : SQL Server 2000 Log File Grown to Excessive Size

What's the proper way to reduce the size of a SQL Server log file.  I have a database that is about 500MB in size but the log file on disk has grown to over 20GB and still climbing.  It was my understanding that backups should purge the logfile and allow the log file on disk to be shrunk.  This, however, does not seem to be the case.

1) The data in the database is not being grown by much at all.  There are probably only 75k-100k records of all types and there are perhaps 25 to 50 records being added or modified each day.  (Actually, that's probably a gross OVER estimate.  I'd be surprised if it's more than 10/day on average.)

2) The database is backed up 2X a day using a scheduled backup database in Enterprise Manager. The backup file is about 500MB on disk.

3) The scheduled maintenance happens once daily in the middle of the night when nobody is working on the database.  But this doesn't seem to do anything useful.

4) If I try to run DBCC SHRINKDATABASE() on it, the process runs for 10 minutes or so and then says:

Cannot shrink log file 2 (Some filename here) because all logical log files are in use

Any tips here would be appreciated.

Answer : SQL Server 2000 Log File Grown to Excessive Size

>>It was my understanding that backups should purge the logfile and allow the log file on disk to be shrunk. <<
That is true, if you mean log transaction backups.  However, I suspect you just mean database backups.

One thing you may be able to do in order to solve this is to temporarily change the Recovery Model to Simple.  You should then be able to shrink.
Random Solutions  
 
programming4us programming4us