Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Checkpoint Duration


Checkpoint Duration

Author
Message
Sarab_SQLGeek
Sarab_SQLGeek
SSC-Addicted
SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)

Group: General Forum Members
Points: 436 Visits: 558
Is there any way to know, what is the duration set for Checkpoint.

I know we can set\customize it, but i want to know the current duration, if someone has changed it.

Also i want to know if there is any default duration for checkpoint.
As per my understanding SQL Server manage this automatically.

Is it related to REcovery Interval Setting?

Regards,
Sarabpreet Singh Cool
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
ps.
ps.
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2467 Visits: 3668
As per my knowledge, there is no default duration for checkpoint to happen. It happens based on certain events.
here are some excerpts from BOL.
Events That Cause Checkpoints
Before a database backup, the Database Engine automatically performs a checkpoint so that all changes to the database pages are contained in the backup. In addition, checkpoints occur automatically when either of the following conditions occur:

The active portion of the log exceeds the size that the server could recover in the amount of time specified in the recovery interval server configuration option.

The log becomes 70 percent full, and the database is in log-truncate mode.
A database is in log truncate mode when both these conditions are TRUE: the database is using the Simple recovery model, and, after execution of the last BACKUP DATABASE statement that referenced the database, one of the following events occurs:

A minimally logged operation is performed in the database, such as a minimally logged bulk copy operation or a minimally logged WRITETEXT statement is executed.

An ALTER DATABASE statement is executed that adds or deletes a file in the database.

Also, stopping a server issues a checkpoint in each database on the server. The following methods of stopping SQL Server perform checkpoints for each database:

Using SQL Server Configuration Manager.

Using SQL Server Management Studio.

Using the SHUTDOWN statement.


Refer HERE
The page also explains the factors affecting the duration of checkpoint operations.



Pradeep Singh
Sarab_SQLGeek
Sarab_SQLGeek
SSC-Addicted
SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)

Group: General Forum Members
Points: 436 Visits: 558
Unsure but i want to know the current duration

Regards,
Sarabpreet Singh Cool
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
ps.
ps.
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2467 Visits: 3668
you can query fn_dblog undocumented command to browse through the transaction log to find out when it was last run. I'm unaware about the exact search string for checkpoint but perhaps u'll need to place the condition on the context or operation column. just query this command to look out for exact detail u need.
see if this helps.



Pradeep Singh
GilaMonster
GilaMonster
SSC Guru
SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)

Group: General Forum Members
Points: 58027 Visits: 44709
There's no default duration or setting that affects a checkpoint's duration. You can change the recovery interval, which affects how often the checkpoint runs, nothing else.

How long a checkpoint takes depends totally on how many changes have occurred in the database since the previous checkpoint ran.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Sarab_SQLGeek
Sarab_SQLGeek
SSC-Addicted
SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)

Group: General Forum Members
Points: 436 Visits: 558
Ok, so if i want to commit all the changes at a rapid speed i can request a checkpoint with a small duration & SQL will put all the required resources to complete checkpoint within the requested time.

Got It.

But lets say i am changing the Recovery Interval(I know its not the best practice, i am just taking an example) to a duration of 90Secs then whether this setting will be applied for the checkpoint (which SQL runs at the time of startup) or the setting will be applied for each and every Checkpoint which happens at some specific intervals?

Thanks

Regards,
Sarabpreet Singh Cool
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
GilaMonster
GilaMonster
SSC Guru
SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)

Group: General Forum Members
Points: 58027 Visits: 44709
Sarab (8/16/2009)
Ok, so if i want to commit all the changes at a rapid speed i can request a checkpoint with a small duration & SQL will put all the required resources to complete checkpoint within the requested time.


No, not at all.

You cannot control the duration of checkpoint. It runs for as long as it takes to write all dirty data pages to disk. SQL will write those pages as fast as it can, depending on the throughput of the IO subsystem.

But lets say i am changing the Recovery Interval(I know its not the best practice, i am just taking an example) to a duration of 90Secs then whether this setting will be applied for the checkpoint (which SQL runs at the time of startup) or the setting will be applied for each and every Checkpoint which happens at some specific intervals?


Recovery interval indirectly controls how often checkpoint runs.

By setting the recovery interval to 90 sec, you're saying to SQL run the checkpoint process often enough that should the SQL service restart unexpectedly, the duration of the restart recovery will not exceed 90 seconds.

The higher the restart interval is set, in general, the less often checkpoint will run and the longer it'll take each time. But you cannot directly control checkpoint interval or duration.

This blog post may help a bit - http://sqlinthewild.co.za/index.php/2009/06/26/the-lazy-writer-and-the-checkpoint/

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Sarab_SQLGeek
Sarab_SQLGeek
SSC-Addicted
SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)SSC-Addicted (436 reputation)

Group: General Forum Members
Points: 436 Visits: 558
Thanks.
now its Clear to me.

Regards,
Sarabpreet Singh Cool
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
farooq2408
farooq2408
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 106
HiGail,

Can you please explain "By setting the recovery interval to 90 sec, you're saying to SQL run the checkpoint process often enough that should the SQL service restart unexpectedly, the duration of the restart recovery will not exceed 90 seconds."

Does it mean that SQL Server will automatically apply Checkpoint command to the database after 90 seconds?

Thanks in advance!!!
Jacob Wilkins
Jacob Wilkins
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2668 Visits: 7698
Well, just to be clear, there's no way to control the duration of an automatic checkpoint.

For a manual checkpoint, you can specify a target duration. From https://msdn.microsoft.com/en-us/library/ms188748.aspx:


checkpoint_duration
Specifies the requested amount of time, in seconds, for the manual checkpoint to complete. When checkpoint_duration is specified, the SQL Server Database Engine attempts to perform the checkpoint within the requested duration. The checkpoint_duration must be an expression of type int and must be greater than zero. When this parameter is omitted, the Database Engine adjusts the checkpoint duration to minimize the performance impact on database applications. checkpoint_duration is an advanced option.


I've never really found a good use case for it (I suppose IF you had to run manual checkpoints and IF you wanted the writes to be distributed over either a shorter or longer time period than SQL Server was choosing, that would be the use, but those are some really big ifs), but it technically does exist :-)

Cheers!

EDIT: Just noticed how old this thread is...that's what I get for responding before a cup of coffee :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search