Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Log shipping and truncating log

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-18 : 15:39:16
is there any way to truncate the log of a database that's involved in a log shipping relationship

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-18 : 16:02:22
No. You can not truncate the transaction log if you are using log shipping as it breaks the transaction log chain.

Why do you need to truncate it though? It is really a bad idea.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-18 : 16:17:51
The log file size on the destination size is super large
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-18 : 16:33:52
take log backups more frequently
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-18 : 16:54:15
so your suggesting that we do log backups locally as well as continuing the log shipping?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-18 : 17:26:05
how often are you backking up/shipping?

and how long does it take to apply on target server?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-18 : 19:28:00
quote:
Originally posted by duhaas

so your suggesting that we do log backups locally as well as continuing the log shipping?



No. You can not run tlog backups outside of the log shipping maintenance plan or you'll break log shipping. What is being suggested is to change the job schedule of the tlog backup for log shipping so that it runs more frequently. We run our tlog backups every 15 minutes.

So just how big is the file? How often do you currently run tlog backups? And how big is the mdf file?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-19 : 15:04:46
the log ships every 30 minutes and db is 3.3GB the log is 4.9GB on the destination side
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-19 : 15:28:12
Changing interval to 15 will help.

Are you running every 30 min all day/night or just in a certain window? Are all logs that big or just say 1st one of the day?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-19 : 15:28:17
There is no reason to truncate the log then. Have you instead thought about shrinking it a little? 4.9GB is not a big file for a tlog when the db is 3.3GB. I've seen tlogs be 1.5 times bigger than the data file, although that was more typical on SQL 2000.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-19 : 16:06:42
im talking about the transaction log of the database it self, not the backed up tlogs.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-19 : 16:39:35
You've missed my point. I was not referring to the tlog backups.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2009-11-19 : 21:59:13
my apologizes about the confusion. so basically, my only option is to shrink the log?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-20 : 12:18:03
Yes that's the only way to reduce the size of the files. Truncating does not shrink files.

But be warned that you could cause performance and fragmentation issues by shrinking them. They got to that size for a reason, so that size may be needed again in the future.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -