Solved

SQL 2000:  cannot Shrink Transaction Log File

Posted on 2008-10-13
4
1,172 Views
Last Modified: 2012-05-05
Greetings, Experts.  I am in need to shrink my stubborn transaction log file.  A lot of space is being eaten up by my DB's transaction log and it needs to go down in size on my server.  For the last month, I've seen "a lot of growth" (for our company anyway) with the transaction log.  The MDF file is 234MB and the LDF is 5.1GB.

I am familiar with SQL Server, but not to the degree that will allow me to shrink this log and not bust something in the process.  This is a production database and as a result I am a nervous newbie to the idea of shrinking the log file.

So far, I've tried the following in Query Analyzer:  DBCC SHRINKFILE (databasename_Log, 0)

The above action took down my transaction file about a 1/2 GB.  

I seek dialog and solutions related to first taking my transaction log down in size.  Once at a lower level, I'd like to see how to keep it down.

In closing, I'm not highly versed in the intricate nature of the transaction log, although I do understand its purpose.  Can you assist me?  I thank you kindly.
0
Comment
Question by:todjklki
  • 2
4 Comments
 

Author Comment

by:todjklki
ID: 22707426
Update:  I just ran the DBCC SHRINKFILE (databasename_Log, 0) again, and noticed that the file size went to 1MB.  I'm not sure just what happened, but it would appear that I have lost my transaction log?  
Can anyone help me decipher what just happened?


0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 250 total points
ID: 22707519
Well you have file size set to 0 there, so it reduced to the minimum.  If you wanted to keep a certain size then specify in the DBCC SHRINKFILE.  

I usually find I have to run DBCC SHRINKFILE twice to get it to work anyway, so now that you ran on the second time it just worked and did what it was told and reduce transaction log.  To maintain the size of the log to manageable level you can do frequent backups of transaction logs.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22707522
0
 
LVL 41

Assisted Solution

by:graye
graye earned 250 total points
ID: 22713823
If you're up to a little bit of reading... take a look at this article that explains how log backups are used to curb the growth of the log file.   You'll need to start doing periodic log backups to prevent this from happening again.
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm 
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now