dbTalk Databases Forums  

Transaction log file size - does it do any harm?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Transaction log file size - does it do any harm? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Trevor Best
 
Posts: n/a

Default Transaction log file size - does it do any harm? - 05-21-2007 , 05:25 AM






I have a client with 150MB database, the transaction log file is
nearly 23GB. It's a PITA for me to backup his data and restore it on
my server as it takes about 30 minutes to restore as it re-creates a
23GB file with no transactions in it :-\

As well as the space taken up by it, does it do any harm being that
size? e.g. does it decrease performance?

While it's there, considering the database is backed up daily, does it
actually do any good?

I know how to truncate and shrink logs, is it advisable / safe /
worthwhile to do this on a regular basis?


Reply With Quote
  #2  
Old   
Greg D. Moore \(Strider\)
 
Posts: n/a

Default Re: Transaction log file size - does it do any harm? - 05-21-2007 , 06:36 AM






"Trevor Best" <googlegroups (AT) besty (DOT) org.uk> wrote

Quote:
I have a client with 150MB database, the transaction log file is
nearly 23GB. It's a PITA for me to backup his data and restore it on
my server as it takes about 30 minutes to restore as it re-creates a
23GB file with no transactions in it :-\

Why is it that large?


Quote:
As well as the space taken up by it, does it do any harm being that
size? e.g. does it decrease performance?

Most likely not.


Quote:
While it's there, considering the database is backed up daily, does it
actually do any good?
"it depends"

Quote:
I know how to truncate and shrink logs, is it advisable / safe /
worthwhile to do this on a regular basis?
No.

http://www.karaszi.com/SQLServer/info_dont_shrink.asp

I'd find out first why it's a 23GB transaction log file. If it's a fluke,
then yes, a single shrink to a more reasonable size is probably ok. My guess
is at some point they simply were NOT doing transaction log backups and as a
result it just kept growing. So they either instituted transaction log
backups (good) or put the database into "SIMPLE" recovery mode (potentially
bad) and just left the log file the size it was.


Quote:


--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html




Reply With Quote
  #3  
Old   
Trevor Best
 
Posts: n/a

Default Re: Transaction log file size - does it do any harm? - 05-21-2007 , 09:05 AM



On May 21, 12:36 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet... (AT) greenms (DOT) com> wrote:
Quote:
"Trevor Best" <googlegro... (AT) besty (DOT) org.uk> wrote in message

news:1179743114.957187.301860 (AT) b40g2000prd (DOT) googlegroups.com...

I have a client with 150MB database, the transaction log file is
nearly 23GB. It's a PITA for me to backup his data and restore it on
my server as it takes about 30 minutes to restore as it re-creates a
23GB file with no transactions in it :-\

Why is it that large?
I think it has 18 months worth of transactions in it. (I'm not their
dba :-)

Quote:
I'd find out first why it's a 23GB transaction log file. If it's a fluke,
then yes, a single shrink to a more reasonable size is probably ok. My guess
is at some point they simply were NOT doing transaction log backups and as a
result it just kept growing. So they either instituted transaction log
backups (good) or put the database into "SIMPLE" recovery mode (potentially
bad) and just left the log file the size it was.
I did set up backup of db and logs and maintenance plans on their
server when it first installed (Aug 05), I just checked and Agent
isn't running so I guess he normal maintenance plan hasn't run. I hope
they backup the database some other way :-\ Thanks for your comments.



Reply With Quote
  #4  
Old   
Greg D. Moore \(Strider\)
 
Posts: n/a

Default Re: Transaction log file size - does it do any harm? - 05-21-2007 , 11:28 AM



"Trevor Best" <googlegroups (AT) besty (DOT) org.uk> wrote

Quote:
On May 21, 12:36 pm, "Greg D. Moore \(Strider\)"
mooregr_deletet... (AT) greenms (DOT) com> wrote:
"Trevor Best" <googlegro... (AT) besty (DOT) org.uk> wrote in message

news:1179743114.957187.301860 (AT) b40g2000prd (DOT) googlegroups.com...

I have a client with 150MB database, the transaction log file is
nearly 23GB. It's a PITA for me to backup his data and restore it on
my server as it takes about 30 minutes to restore as it re-creates a
23GB file with no transactions in it :-\

Why is it that large?

I think it has 18 months worth of transactions in it. (I'm not their
dba :-)

So doesn't sound like it has NO transactions in it.


Quote:
I'd find out first why it's a 23GB transaction log file. If it's a
fluke,
then yes, a single shrink to a more reasonable size is probably ok. My
guess
is at some point they simply were NOT doing transaction log backups and
as a
result it just kept growing. So they either instituted transaction log
backups (good) or put the database into "SIMPLE" recovery mode
(potentially
bad) and just left the log file the size it was.

I did set up backup of db and logs and maintenance plans on their
server when it first installed (Aug 05), I just checked and Agent
isn't running so I guess he normal maintenance plan hasn't run. I hope
they backup the database some other way :-\ Thanks for your comments.

I'd somehow doubt it....





Reply With Quote
  #5  
Old   
barlowedward@hotmail.com
 
Posts: n/a

Default Re: Transaction log file size - does it do any harm? - 05-22-2007 , 07:32 AM



If your tran log gets that big you should decide if you care about
tran logs

either

set recovery mode to simple, dump tran with nolog, shrink the database
log file, and take a backup

-or-

set up incrementals using your maintenance plan

-or-

both

if you need point in time recovery, i recommend doing both. Eliminate
the old junk and redump your
database after setting up a plan that dumps tran logs.

Ed


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.