Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Checkpoints in

DBMS
Presented by Shubham Kumar
Table of contents
Checkpoints : definition
01

Classification of Checkpoints
02

Importance of Checkpoints
03

04. Conclusion
01

Checkpoints: Definition
What are Checkpoints?
What are Checkpoints?

A checkpoint is a process that saves the current state of the database to disk. This includes all transactions
that have been committed, as well as any changes that have been made to the database but not yet
committed. The checkpoint process also includes a log of all transactions that have occurred since the last
checkpoint. This log is used to recover the database in the event of a system failure or crash.

When a checkpoint occurs, the DBMS will write a copy of the current state of the database to disk. This is
done to ensure that the database can be recovered quickly in the event of a failure. The checkpoint process
also includes a log of all transactions that have occurred since the last checkpoint. This log is used to recover
the database in the event of a system failure or crash.
02

Classification of Checkpoints
Two main types of
Checkpoints:-
1.Automatic Checkpoints

Automatic checkpoints occur at regular intervals, such as every hour or every day. The interval can be
configured by the database administrator. Automatic checkpoints are useful for large databases that are
constantly being updated, as they ensure that the database can be recovered quickly in the event of a failure.

For example, in SQL Server, the default interval for automatic checkpoints is every minute, but this can be
configured to occur at different intervals.

Example

-- To configure automatic checkpoint in SQL Server

ALTER DATABASE [MyDB] SET AUTO_SHRINK ON


2.Manual
Checkpoints
Manual checkpoints are triggered by the database administrator, rather than occurring at regular
intervals. Manual checkpoints are useful for smaller databases that are updated less frequently, as
they allow the administrator to choose when the checkpoint occurs.

For example, in Oracle, you can trigger a manual checkpoint using the following command −

-- To trigger a manual checkpoint in Oracle

ALTER SYSTEM CHECKPOINT ;


03

Importance of Checkpoints
….
1.Checkpoints and Recovery
Checkpoints play a crucial role in the recovery process of a DBMS. In the event of a system failure
or crash, the DBMS uses the information stored in the checkpoint and transaction log to recover the
database to its last known state. The recovery process begins by reading the transaction log and
replaying any committed transactions that occurred after the last checkpoint. This process is known
as "roll forward." The DBMS then applies any changes that were made to the database but not yet
committed, also known as "rollback."

The recovery process can be further optimized by configuring the checkpoint intervals appropriately.
For example, if the checkpoint interval is set to a shorter duration, the recovery process will have to
roll forward a shorter period of time, hence faster recovery. However, this also means that more
frequent checkpoints will have to be written to disk, which can impact the overall performance of the
system.
2.Performance Optimization
Checkpoints not only play a crucial role in recovery, but they can also be used to improve the
performance of a DBMS. One way in which they do this is by reducing the amount of work that
needs to be done during recovery. As the DBMS writes a copy of the current state of the database
to disk during a checkpoint, it also discards any unnecessary information, such as old data or
temporary files. This helps to keep the database clean and optimized for performance.

Another way in which checkpoints can be used to improve performance is by reducing the
amount of data that needs to be read from disk during recovery. When a system failure occurs,
the DBMS reads the data from the checkpoint and transaction log to rebuild the database. By
configuring the checkpoint intervals appropriately, the DBMS can minimize the amount of data
that needs to be read from disk, which can significantly improve the recovery time.
3.Auditing

Checkpoints can also be used for auditing purposes. By creating a checkpoint at regular intervals, the
DBMS can track changes to the database over time. This allows administrators to view the history of the
database and identify any issues or problems that may have occurred. For example, if a data breach
occurs, an administrator can use the checkpoint and transaction log to determine when the breach
occurred and what data was affected.

Additionally, the ability to track changes over time can also be useful for compliance purposes. Many
industries are subject to regulations that require them to maintain detailed records of their data. By using
checkpoints to track changes to the database, organizations can demonstrate compliance with these
regulations.
Conclusion

Checkpoints are an essential aspect of database management systems.They allow for


faster recovery in the event of a system failure or crash, improve performance, and
can be used for auditing and compliance purposes. It is important for database
administrators to understand the concept of checkpoints and how to configure them
appropriately to ensure the best performance and recovery for their systems.
Thanks!
Do you have any questions?
+91 9693819185
kumshubham9870@gmail.com

CREDITS: This presentation template was created by


Slidesgo, and includes icons by Flaticon, infographics &
images by Freepik and content by Sandra Medina

Please keep this slide for attribution

You might also like