Solved

SQL 2000:  cannot Shrink Transaction Log File

Posted on 2008-10-13
4
1,187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 60

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 60

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

691 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