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
 General SQL Server Forums
 Data Corruption Issues
 log file 80gigs + wont shrink

Author  Topic 

brandonjelinek
Starting Member

6 Posts

Posted - 2007-07-25 : 10:01:16
i have a log file for a 200 meg database that is now over 80gigs. It is way out of control but DBCC shrink file just reports... the file is not part of a replication set.


Cannot shrink log file 2 (Database_log) because all logical log files are in use.

(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.



I have read around and seen the suggestion to make a new database file and copy all the data to it. How is that done? I am using SQL 2005 Express with microsoft SQL server management Studio express.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-07-25 : 10:36:57
Run 'backup log db_name with truncate_only' first, then shrink it.
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-07-25 : 10:43:00
Here is a good thread to read regarding this error http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/f660efcd6611b537/4f4497c5e9b26190



-ec

Go to Top of Page

brandonjelinek
Starting Member

6 Posts

Posted - 2007-07-25 : 11:33:19
I have done the backup and i read that link. I have only 1 log file for that database, but that is the structure of a DotNetNuke database and i am able to shrink my other dotnetnuke databases just fine.
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-07-25 : 11:42:48
quote:
Originally posted by brandonjelinek

I have done the backup and i read that link. I have only 1 log file for that database, but that is the structure of a DotNetNuke database and i am able to shrink my other dotnetnuke databases just fine.



do you have open transactions in that database? try running DBCC OPENTRAN(dbname) and see if there are any.

read Tibor's article too http://www.karaszi.com/SQLServer/info_dont_shrink.asp (which was linked to in the thread I posted above). This explains how the log files work. Read the section about shrinking the log file and about 'virtual log files'. this is most likely the reason you cannot shrink your current log file.


-ec
Go to Top of Page

brandonjelinek
Starting Member

6 Posts

Posted - 2007-07-25 : 14:11:48
since i have to down the web server to mess with this.. sadly it will have to wait till tonight. i will do some reading in the mean time..
Go to Top of Page
   

- Advertisement -