Get the App
SLTechnology News&Howtos  ›  Database  › 

How sqlserver encounters a rollback transaction

Shulou Source: shulou.com Published: 2022-05-31 18:37:19 10月05日 Update

This article mainly explains how sqlserver encounters a rollback transaction. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how sqlserver encounters a rollback transaction.

Sometimes we use the "KILL" command to end a pending process. Once this happens, if SQL knows how to roll back the work, it will start the "real" rollback process and undo the work done. In some cases, SQL does not know and cannot control completed work, nor can it roll back work, in which case it will always be in a terminated / rollback state. How do you decide what action to take? It all depends on the actions taken by the SPID who was killed. You can only do a few things:

1. Wait patiently for the rollback to be completed. Some large operations may take a long time to roll back. Such a SPID shows changes in CPU, memory, and IO column sizes in sys.sysprocesses.

2. If SPID does not show any changes in the CPU, memory, and IO columns, it does nothing but find out which client machine spid comes from, enter the client machine, and end the process in the task manager.

3. If the client process has been killed on the client machine, but the database server still displays the process information and does nothing, you can only restart the SQL service

Thank you for your reading. The above is the content of "how sqlserver encounters rollback transactions". After the study of this article, I believe you have a deeper understanding of how sqlserver encounters rollback transactions, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Transaction mode client client situation process work machine learning memory content state change service action patience task information depending on command Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia Shulou Technology Shulou Tech Info Docker