SQL Server checks whether tasks are not submitted, stops the progress, and removes the table deadlock. the SQL Server process is deadlocked.

Source: Internet
Author: User

SQL Server checks whether tasks are not submitted, stops the progress, and removes the table deadlock. the SQL Server process is deadlocked.

If there are uncommitted tasks in the data warehouse, the related tables will remain in the dead warehouse, affects the query of other processes (unless with (nolock) is used in the query )).
Due to the separation of transactions, other sessions cannot submit transactions through RollBack Transaction. Only the progress of the non-submitted transactions can be terminated, then, the task is terminated by the atomicity of the task, and the task is rolled back.

How can I find uncommitted tasks?
Run the following command:

DBCC OpenTran

The results are as follows:

SPID is the progress ID. Run the following command to stop the progress:

Kill 52 -- 52 is the SPID of the non-submitted event.

Additional references:

-- Query the select object_name (P. object_id) as TableName, resource_type, resource_description, request_session_id, L. resource_database_idfrom sys. dm_tran_locks L join sys. partitions P on L. resource_associated_entity_id = p. hobt_idWHERE L. resource_database_id = DB_ID (); -- query the blocking (Blocked) process SELECT * FROM sys. dm_exec_requests WHERE blocking_session_id <> 0

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.