Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

transactional Replication- Two log files Expand / Collapse
Author
Message
Posted Friday, December 07, 2012 11:39 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229, Visits: 1,064
For some reason we have two log files on one of our production database. We have transactional replication setup on it. We are experiencing a latency issue during index rebuild/heavy inserts/ heavy deletes operation. I think it's expected. My question is as there will be a increase in the log file size during the above operations, both the logs are growing at the same rate. Not sure why. As log files are written sequentially why both the log files are growing at the same rate? Does the log reader agent tries to search for replicated transactions in both the log files?
Post #1394183
Posted Tuesday, December 11, 2012 8:27 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229, Visits: 1,064
Post #1395153
Posted Tuesday, December 11, 2012 8:48 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 37,660, Visits: 29,912
SQL will grow one then the other, that's why you see them both growing. They're still used sequentially, the log reader reads sequentially (by LSN), all writes are sequential. There's no advantage to having 2 log files.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1395164
Posted Tuesday, December 11, 2012 8:50 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229, Visits: 1,064
But the log is set to grow to 2TB. How come it's not growing to 2TB and then taking over the second log file.
Post #1395166
Posted Tuesday, December 11, 2012 9:02 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 37,660, Visits: 29,912
Because that's not the way SQL is designed to work with its files. If there are two log files, both will fill up, that will trigger the autogrow and they'll both grow.
As I said, you don't need that second log file, better to find some time when that log is idle and remove it.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1395179
Posted Tuesday, December 11, 2012 1:12 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, May 16, 2013 10:05 PM
Points: 99, Visits: 98
I agree with gail you will not get any gain if the database have more than one log file. Sql server writes and fills transaction log the file sequentially where as in the case of data file it will perform proportional fill.

http://www.sqlskills.com/blogs/jonathan/post/looking-at-multiple-data-files-and-proportional-fill-with-extended-events.aspx

RamaSankar
MCTS,MCITP Sql Server 2008
Post #1395298
Posted Tuesday, December 11, 2012 1:40 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229, Visits: 1,064
I also agree with Gila. But the problem here is I am not observing the sequential increase in the file growth.
Post #1395308
Posted Tuesday, December 11, 2012 1:50 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 37,660, Visits: 29,912
As I already explained, SQL will fill one file, then fill the other, and if there's no reusable space, both will grow.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1395312
Posted Thursday, December 13, 2012 7:59 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229, Visits: 1,064
Gila,
It's not working like that in our environment. Please find the attached document for the log sizes captured at different times.
Thanks,


  Post Attachments 
Capture.JPG (15 views, 23.29 KB)
Post #1396202
Posted Thursday, December 13, 2012 8:08 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 37,660, Visits: 29,912
What am I supposed to be seeing there, other than 2 files of the same size?

You said in your initial post "both the logs are growing at the same rate. " I've explained repeatedly why both log files will grow at the same rate.

p.s. If the files reduced in size you have a shrink job or autoshrink on.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1396211
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse