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 «««12345

Log Growing Pains Expand / Collapse
Author
Message
Posted Thursday, March 11, 2010 9:45 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
Oleg Netchaev (3/11/2010)
This is a very good article Jason, thank you.

When recovery model is full, proper handling of the log file growth is of utmost importance, and your article is going to be a great help. It can be somewhat frustrating to run dbcc loginfo() just to discover that there are thousands of segments in the beast yet the value of the last record's status is 2 and, therefore, it cannot be immediately tamed, so it is nice to have a way to quickly identify who done it.

Oleg



Thanks Oleg.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #881141
Posted Friday, March 12, 2010 6:41 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:55 AM
Points: 5,989, Visits: 12,927
Jason, excellent article, in particular your second method for tracking growth. Thanks for taking the time to develop this and then share it with the community.

In your SQL running code do you feel there is any advantage to be had in trapping the actual SQL running at the time rather than the last batch, which I think yours traps. I am thinking of something like this (I take no credit for this code)

SELECT SDER.[session_id], SDER.[request_id],SDER.[statement_start_offset],   
SDER.[statement_end_offset],
CASE
WHEN SDER.[statement_start_offset] > 0 THEN
--The start of the active command is not at the beginning of the full command text
CASE SDER.[statement_end_offset]
WHEN -1 THEN
--The end of the full command is also the end of the active statement
SUBSTRING(DEST.TEXT, (SDER.[statement_start_offset]/2) + 1, 2147483647)
ELSE
--The end of the active statement is not at the end of the full command
SUBSTRING(DEST.TEXT, (SDER.[statement_start_offset]/2) + 1, (SDER.[statement_end_offset] - SDER.[statement_start_offset])/2)
END
ELSE
--1st part of full command is running
CASE SDER.[statement_end_offset]
WHEN -1 THEN
--The end of the full command is also the end of the active statement
RTRIM(LTRIM(DEST.[text]))
ELSE
--The end of the active statement is not at the end of the full command
LEFT(DEST.TEXT, (SDER.[statement_end_offset]/2) +1)
END
END AS [executing statement],
DEST.[text] AS [full statement code]
FROM sys.[dm_exec_requests] SDER CROSS APPLY sys.[dm_exec_sql_text](SDER.[sql_handle]) DEST
WHERE SDER.session_id > 50
ORDER BY SDER.[session_id], SDER.[request_id]



---------------------------------------------------------------------

Post #881709
Posted Friday, March 12, 2010 9:13 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
george sibbald (3/12/2010)
Jason, excellent article, in particular your second method for tracking growth. Thanks for taking the time to develop this and then share it with the community.

In your SQL running code do you feel there is any advantage to be had in trapping the actual SQL running at the time rather than the last batch, which I think yours traps. I am thinking of something like this (I take no credit for this code)



Yes, it is beneficial to trap the actual running code. I will have to compare and contrast the two.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #881893
Posted Thursday, May 27, 2010 7:50 PM


SSC-Dedicated

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

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 36,995, Visits: 31,517
That'll teach me... look at the SSC homepage everyday because I might have missed the email. That's the only excuse I have for not seeing this article until today and I'm sticking to it.

Nice article and methods, Jason.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #929406
Posted Thursday, May 27, 2010 7:53 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
Jeff Moden (5/27/2010)
That'll teach me... look at the SSC homepage everyday because I might have missed the email. That's the only excuse I have for not seeing this article until today and I'm sticking to it.

Nice article and methods, Jason.


Thanks Jeff.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #929408
Posted Thursday, May 27, 2010 8:55 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Saturday, August 30, 2014 4:20 PM
Points: 11,194, Visits: 11,142
Jeff Moden (5/27/2010)
That's the only excuse I have for not seeing this article until today and I'm sticking to it.

I know this isn't as funny as I think it is, but whenever comes late to something, I always think it's because of Jeff's "300 baud" Modem.




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #929420
Posted Tuesday, November 1, 2011 7:36 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
Jack Corbett (3/11/2010)
Nice article Jason. I'll be interested in what you find from Event Notifications.



Wow, this has been some time coming. I have not forgotten about the need to do that article. I was just now reviewing my articles and list of age old to-dos and this one popped back up. It might be as a part of a different project at this point - but it should be coming soon.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1199057
Posted Tuesday, February 19, 2013 11:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 4, 2013 7:22 PM
Points: 32, Visits: 217
Hello,

Very good article Jason, I will use it to monitor the growth of the tempdb database.

I have a question, for my case should only change the line SET @ instanceName = 'tempdb' in SpaceUsed_perfmon procedure, is this correct?

Regards


Fernando Casas Osorio
Post #1421786
Posted Tuesday, February 19, 2013 11:31 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
fercasas (2/19/2013)
Hello,

Very good article Jason, I will use it to monitor the growth of the tempdb database.

I have a question, for my case should only change the line SET @ instanceName = 'tempdb' in SpaceUsed_perfmon procedure, is this correct?

Regards


Thank you.

Yes, change @instanceName to whichever DB you are monitoring. In hindsight, this really should have been more aptly named @DBName.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1421788
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse