Bobcares

Checkpoint process in SQL server – Types in detail

by | Mar 11, 2021

Wondering what the Checkpoint process in SQL server is? We can help you.

Checkpoints are the useful repositories of information and serve best for the recovery of SQL server databases.

When the SQL database server faces an unexpected shutdown or crash, the checkpoint creates a known good point from which the SQL Server Database Engine can start applying changes contained in the log during recovery.

Here at Bobcares, we handle SQL database servers of our customers as a part of our Server Management Services.

Today, we will discuss in detail the types of Checkpoint process in SQL server.

Types of Checkpoint process in SQL server

SQL Server performs many modifications to any database pages in memory/buffer cache. It will not write these modified pages to disk after every change. Rather, SQL Server Database Engine periodically issues a checkpoint on each database.

A checkpoint writes the current in-memory modified pages (known as dirty pages). After that, it transactions log information from memory to disk along with recording the information in the transaction log.

Using a better checkpoint method will enhance the server performance along with rendering a better recovery plan.

SQL Server supports four types of checkpoints. They are given below:

1. Automatic Checkpoints
2. Indirect Checkpoints
3. Manual Checkpoints
4. Internal Checkpoints

Now we will see each type of checkpoint in detail.

Automatic Checkpoints

An automatic checkpoint occurs each time the number of log records reaches the number the Database Engine estimates it can process during the time specified in the recovery interval server configuration option.

We can set the value of recovery interval using the following:

sp_configure 'recovery interval','seconds'

The recovery interval is the maximum time that a server instance should use to recover a database during a system restart.

When a database using automatic checkpoints reaches this maximum number of log records, the Database Engine issues a checkpoint on the database.

The frequency depends on the value of the recovery interval option of server configuration.

Database Engine generates automatic checkpoints for every database when we don’t define a value for target recovery time for a database. Usually, in a simple recovery model, an automatic checkpoint is queued if the log becomes 70 percent full.

Indirect Checkpoints

This checkpoint was introduced in SQL Server 2012. Indirect checkpoints provide a configurable database-level alternative to automatic checkpoints.

When a system crash, indirect checkpoints provide potentially faster, more predictable recovery time than automatic checkpoints.

We can set the TARGET_RECOVERY_TIME in the Indirect checkpoint for any database using the following ALTER DATABASE statement.

ALTER DATABASE DBNAME SET TARGET_RECOVERY_TIME =target_recovery_time {SECONDS | MINUTES}

Here the recovery interval configuration option uses the number of transactions to determine the recovery time as opposed to indirect checkpoints which make use of the number of dirty pages.

Indirect checkpoints allow us to reliably control database recovery time by factoring in the cost of random I/O during REDO. It also reduces checkpoint-related I/O spiking by continuously writing dirty pages to disk in the background.

Manual Checkpoints

The manual checkpoint is issued when we execute a T-SQL CHECKPOINT command for a database. By default, manual checkpoints run to completion and its Throttling works the same way as that of automatic checkpoints.

Internal Checkpoints

Internal Checkpoints are generated by various server components to guarantee that disk images match the current state of the log. They generate in response to the following events:

1. Adding or removing database files using ALTER DATABASE.
2. Backup of the database is taken
3. Creating a database snapshot, either explicitly or internally for DBCC CHECK.
4. Any activities leading to database shutdown.
5. An instance of SQL Server stops by stopping the SQL Server (MSSQLSERVER) service. Either action causes a checkpoint in each database in the instance of SQL Server.
6. Bringing a SQL Server failover cluster instance (FCI) offline.

[Need assistance with your SQL server? – We can help you]

Conclusion

In short, in today’s article, we saw the Checkpoint process in SQL server and the four types of checkpoints available.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF