[Share] rollback mechanism of SQL Server during recovery after system crash

Source: Internet
Author: User

 

From: msdn Forum posts

Create a test table testtable,
Insert the following two rows of data:

Insert
Into testtable values
(1,
'Aaa ')

Insert
Into testtable values
(2,
'Bbbbb ')

Then, perform the following operations.

Update testtable
Set myname =
'Cccc' where myid
= 2

To be more intuitive, we can use some logging tools such as apexsql log (from Ctrl + click the following link "href =" http://www.apexsql.com/"> http://www.apexsql.com/
Can be downloaded to observe the log structure.

At this time, we can see that the update statement contains oldvalue and newvalue. Therefore, when performing rollback, because of oldvalue, the so-called restoration is to change the value back to oldvalue.

At the same time, we can also see the corresponding undo script.

And redo script:

Only records oldvalue and newvalue, rather than record the entire oldpage and Newpage corresponding to that value.

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.