Re: Tran Log Growth high tried truncating and shrinking

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 01/05/05


Date: Wed, 5 Jan 2005 09:44:21 -0500


> I am not shrinking the database - only the T log. And only after trans
> have been committed and a full backup taken. I can't see the harm in
> removing the old transaction data.

It is not the shrinking that is harmful it is the growth that will
inevitably happen that can cause problems. At best it will hamper
performance as the growing of the file is resource intensive and will
temporarily halt any new transactions until the growth is complete. If you
shrink your file to say 1 GB and it grows to 7GB you will have many periods
where the autogrow will kick in and cause potential performance issues. You
can even force the timeout of queries that can not happen in the time it
takes the file to grow. You can use profiler to trace your system and
there are events for file growth. You can then see what was going on in the
system around the time that an autogrow happened. You can even set up an
alert so you can have a look if you are around.

-- 
Andrew J. Kelly  SQL MVP
"Simon" <reply@togroup.com> wrote in message 
news:%23BEevGz8EHA.3368@TK2MSFTNGP10.phx.gbl...
> Many thanks Andrew / Olu,
>
> I am looking to find the cause of the growth but no luck as yet.
>
> I am not shrinking the database - only the T log. And only after trans 
> have been committed and a full backup taken. I can't see the harm in 
> removing the old transaction data.
>
> Even if maintenance / input tasks are causing a large number of 
> trtansactions to be written to the db I can't believe the log should reach 
> 7Gb+ in only a few days.
>
> Is there any way of seeing when the trans log growth occurs? Does the time 
> / date get logged anywhere?
>
> Thanks again for your help it is appreciated, Simon.
>
> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message 
> news:uw600sy8EHA.3596@TK2MSFTNGP12.phx.gbl...
>> Simon,
>>
>> Shrinking the db all the time is a bad thing.  If it keeps growing then 
>> all you do by shrinking is cause more overhead and potential problems. As 
>> Olu mentioned you need to determine why it is growing so much before you 
>> do anything and I too believe the optimizations of the tables are most 
>> likely causing this and that is normal.
>>
>> -- 
>> Andrew J. Kelly  SQL MVP
>>
>>
>> "Simon" <reply@togroup.com> wrote in message 
>> news:uXnYrTy8EHA.808@TK2MSFTNGP10.phx.gbl...
>>> Hello all, I have a problem with a SQL 2000 DB LDF growing to 7-8Gb. The 
>>> DB itself is around 8.5Gb.
>>>
>>> I have truncated the log and shrunk it back to 500Mb but in 3 - 4 days 
>>> it returns to its monsterous size.
>>>
>>> I do a full backup each night and regular backups of the log during the 
>>> day. A maintenance plan should shrink and tidy every Sunday (the default 
>>> setting I believe.)
>>>
>>> All advice is greatly appreciated, rgds, Simon.
>>>
>>
>>
>
> 


Relevant Pages

  • Re: Fragmentation Issues
    ... My backup schedule is a full each night in the early morning. ... if I do a full backup and then trucate the tran log I have all I need to ... Do you recommend never shrinking the DB -or- when would you recommend ...
    (microsoft.public.sqlserver.server)
  • Re: Fragmentation Issues
    ... Tibor Karaszi, SQL Server MVP ... > backup is run each day at 1:00p. ... >>> dbcc checkdb ... > Do you recommend never shrinking the DB -or- when would you recommend ...
    (microsoft.public.sqlserver.server)
  • Re: Transaction log too big
    ... For SQL Server backups, the file size is not what determines the size of the backup. ... and I also agree that shrinking has a place for "unregular" operations. ... > that's empty though - the physical file will still have the same size on ...
    (microsoft.public.sqlserver.server)
  • 2 Qs: DB Shrink and Agent step
    ... Q1: shrinking transaction log ... backup log file with successfully, ... SQL Server Agent only runs step 1 ...
    (microsoft.public.sqlserver.server)
  • Re: Tran Log Growth high tried truncating and shrinking
    ... Thank you for explaining the effect my shrinking the T Log is having on ... I will run a trace and see what shows up - thanks for all your help Andrew, ... >> removing the old transaction data. ... > temporarily halt any new transactions until the growth is complete. ...
    (microsoft.public.sqlserver.server)