How does the modification of data in SQL Server fall on disk?

Source: Internet
Author: User

To understand how the Write-ahead log works, it's important for what know how modified data are written to disk.

SQL Server maintains a buffer cache into which it reads data pages then data must be retrieved.

Data modifications is not made directly to disk, but is made to the copy of the page in the buffer cache.

The modification is not written to disk until a checkpoint occurs in the database, or the modification must being written to Disk so the buffer can is used to hold a new page.

Writing a modified data page from the buffer cache to disk is called flushing the page. A page modified in the cache, but not yet written to disk, is called a dirty page.

At the time a modification was made to a page in the buffer, a log record was built in the log cache that records the Modifi cation.

This log record must was written to disk before the associated dirty page was flushed from the buffer cache to disk.

If The dirty page is flushed before the log record was written, the dirty page creates a modification on the disk that Cann OT be rolled back if the server fails before the log record was written to disk.

SQL Server has logic this prevents a dirty page from being flushed before the associated log record is written.

Log Records is written to disk when the transactions is committed.

Data sources

=====================

Write-ahead Transaction Log

http://technet.microsoft.com/en-us/library/ms186259 (v=sql.105). aspx

How are changes to data in SQL Server dropped?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.