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)
 Shrinking an LDF without breaking Log Shipping

Author  Topic 

noneil277
Starting Member

13 Posts

Posted - 2008-10-02 : 16:41:45
Greetings,

I've been trolling these forums for quite some time and finally took the time to register, so hello.

My first question after searching for an answer here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=43966
is how to successfully manage a database with a rapidly growing 100+GB daily LDF size without interupting the transaction log shipping?

apprecaite any feedback, thank you.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-02 : 16:57:55
Questions

1)Are you backing up your Transaction log frequently?
2)Are you rebuilding all indexes? Use Tara's script for it.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-02 : 17:15:43
Yes you can shrink the LDF without breaking log shipping, however I wouldn't recommend it. How often are you backing up your transaction log in the log shipping maintenance plan? How big is the database?

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

Subscribe to my blog
Go to Top of Page

noneil277
Starting Member

13 Posts

Posted - 2008-10-03 : 12:02:53
Hi,

Thank you very much for the responses, i appreciate the support from the community.
In regards to the questions asked.

The size of the database is about 150GB.
The transaction logs are being backed up every 30 minutes.
The size of each 30 minute transaction log backup is about 30MB, and the log file (LDF) is about 100GB.

In regards to rebuilding all indexes, there are no maintenance plans to rebuild indexes but the script from Tara does sound very interesting, if we could have a copy of that and a brief explanation, thanks again.
Go to Top of Page

lordicarus
Starting Member

3 Posts

Posted - 2008-10-03 : 12:22:58
I am actually working with noneil277 on this issue. The defrag index job is the one here correct? http://weblogs.sqlteam.com/tarad/archive/2008/09/03/Defragmenting-Indexes-in-SQL-Server-2005.aspx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-03 : 13:09:57
Yes that's the one. Always grab it from this link as if I update my code I create a new blog and then update this one with the new link: http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

You should also check this out: http://weblogs.sqlteam.com/tarad/archive/2008/06/30/SQL-Server-jobs-on-production-instances.aspx

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

Subscribe to my blog
Go to Top of Page

lordicarus
Starting Member

3 Posts

Posted - 2008-10-03 : 14:20:31
I actually read your article here http://weblogs.sqlteam.com/tarad/archive/2008/09/11/File-Growth-Settings-for-SQL-Server-Databases.aspx and I am guessing this relates to the reason why you do not recommend shrinking the log file. Are there any other reasons against doing this?

Also, in regards to the process of shrinking the log file, I was under the impression that you either have to truncate the log or switch to simple and back to full recovery before you can run the dbcc command. I thought that doing this would break the log chain and cause log shipping to fail when it tries to restore the log on the standby server. Could you or someone else please explain this in a little bit more detail?

Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-03 : 14:43:36
Yes that's the reason. You receive a huge performance penalty each time the file needs to grow.

You do not need to truncate the log or switch to simple and then full to shrink it. You just need free space inside the file that you are shrinking.

Shrinking does not impact log shipping. Truncating does. Once impacts the transaction log chain, the other doesn't.

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

Subscribe to my blog
Go to Top of Page

lordicarus
Starting Member

3 Posts

Posted - 2008-10-03 : 16:06:20
Thank you much for the assistance!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-03 : 16:21:21
Also If you are using Bulk-Insert task, always use Batch_size so you don't fill up Tran log again.
Go to Top of Page
   

- Advertisement -