|
|
|
SSC 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?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 4:00 AM
Points: 229,
Visits: 1,064
|
|
|
|
|
|
SSC-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
|
|
|
|
|
SSC 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.
|
|
|
|
|
SSC-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
|
|
|
|
|
SSC 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
|
|
|
|
|
SSC 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.
|
|
|
|
|
SSC-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
|
|
|
|
|
SSC 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,
|
|
|
|
|
SSC-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
|
|
|
|