473,412 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Transaction log file size - does it do any harm?

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?

May 21 '07 #1
4 4192
"Trevor Best" <go**********@besty.org.ukwrote in message
news:11**********************@b40g2000prd.googlegr oups.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?

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.

While it's there, considering the database is backed up daily, does it
actually do any good?
"it depends"
>
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.

>


--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
May 21 '07 #2
On May 21, 12:36 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@greenms.comwrote:
"Trevor Best" <googlegro...@besty.org.ukwrote in message

news:11**********************@b40g2000prd.googlegr oups.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 :-)
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.

May 21 '07 #3
"Trevor Best" <go**********@besty.org.ukwrote in message
news:11**********************@y2g2000prf.googlegro ups.com...
On May 21, 12:36 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@greenms.comwrote:
>"Trevor Best" <googlegro...@besty.org.ukwrote in message

news:11**********************@b40g2000prd.googleg roups.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.

>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....

May 21 '07 #4
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

May 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: TZoner | last post by:
1) Can one find the location of the 'Transaction Log' at: <Hard Disk>\Program Files\Microsoft SQL Server\MSSQL\Data\MyDb_Log.ldf? 2) Is it safe to delete it, as SQL will create a new Transaction...
7
by: enigma | last post by:
Just wondering if you could help me on this one. I'm not sure if my transaction logs are behaving oddly or what. I've successfuly managed to shrink my transaction logs from 7GB down to 1MB and now...
5
by: Jay Chan | last post by:
The transaction log in a database in our SQLSERVER-2000 server has grown to 16GB. I cannot shrink the transaction log manually because it says that the entire 16GB log size is not free. This is...
3
by: Daniel Xiao | last post by:
I have set the initial size of the log file for a database to 1M, the maximum size is unrestricted, and the increase rate is 10%. However, when I attempt to delete thousands of rows, the error is...
5
by: BashiraInTrouble | last post by:
Hi Friends, I have tried almost everything but I cant seem to shrink the transaction log. Executing DBCC SQLPERF(LOGSPACE) gives me this info: Database Log Size (MB) Log Space Used (%) ...
1
by: jeffreyv | last post by:
Hi! I'm studying to have my MCSE 70-228 certification and I'm trying some things with backing up transaction logs and shrinking it. Here's what I do: There is no activity in the database by...
2
by: Wolfgang B. | last post by:
Hi. I have a problem with many transaction logs generated by DB2 Version 7.2 on Redhat 7.3. Log file size (4KB) (LOGFILSIZ) = 1000 Number of primary log files ...
4
by: yashgt | last post by:
Hi, We have created a SQL server 2000 database. We observe that the transaction log keeps growing over time. We are now about to run out of space. We have been periodically shrinking the...
3
by: sifrah | last post by:
Hi All, My SQL server transaction log is getting bigger every day and my HDD if running out of space. So i follow the MS KB about how to Shrinking the Transaction Log. After doing so the log is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.