SQL Server Learning Notes transaction, locking, blocking, deadlock

Source: Internet
Author: User
Tags session id time in milliseconds

http://blog.csdn.net/sqlserverdiscovery/article/details/7712068

Column name Data Type Description
Blocked smallint ID of the session is blocking the request. If This column is NULL, the request isn't blocked, or the session information of the blocking session is not available (O R cannot be identified).

-2 = The blocking resource is owned by an orphaned distributed transaction.

-3 = The blocking resource is owned by a deferred recovery transaction.

-4 = Session ID of the blocking latch owner could not being determined due to internal latch state transitions.
Waittype Binary (2) Reserved.
Waittime bigint Current wait time in milliseconds.

0 = Process is not waiting.
Lastwaittype NCHAR (32) A string indicating the name of the last or current wait type.
Waitresource NCHAR (256) Textual representation of a lock resource.
dbid smallint ID of the database currently being used by the process.
Uid smallint ID of the user that executed the command. Overflows or returns NULL if the number of users and roles exceeds 32,767.
Cpu Int Cumulative CPU time for the process. The entry is updated for all processes, regardless of whether the SET STATISTICS time option was on or OFF.
Physical_io bigint Cumulative disk reads and writes for the process.
Memusage Int The number of pages in the procedure cache is currently allocated to this process. A negative number indicates that the process was freeing memory allocated by another process.
Login_time Datetime Time at which a client process logged into the server.
Last_batch Datetime Last time a client process executed a remote stored procedure call or an EXECUTE statement.
Ecid smallint Execution context ID used to uniquely identify the Subthreads operating on behalf of a single process.
Open_tran smallint Number of open transactions for the process.
status nchar (+) Process ID status. The possible values are:

dormant = SQL Server is resetting the session.
The
running = The session is running one or more batches. When multiple Active Result sets (MARS) is enabled, a session can run multiple batches. For more information, see using multiple Active Result sets (MARS).

Background = The session is running a background task, such as deadlock detection.
The
rollback = The session has a transaction rollback in process.

Pending = The session is waiting for a worker, thread to become available.

runnable = the task in the session was in the runnable queue of a scheduler while waiting to get a time quantum.
spinloop = The task in the session was waiting for a spinlock to become free.

Suspended = The session is waiting for an event, such as I/O, to complete.
Sid Binary (86) Globally unique identifier (GUID) for the user.
Hostname NCHAR (128) Name of the workstation.
Program_name NCHAR (128) Name of the application program.
Hostprocess NCHAR (10) Workstation process ID number.
Cmd NCHAR (16) Command currently being executed.
Nt_domain NCHAR (128) Windows domain for the client, if using Windows Authentication, or a trusted connection.
Nt_username NCHAR (128) Windows user name for the process, if using Windows Authentication, or a trusted connection.
Net_address NCHAR (12) Assigned Unique identifier for the network adapter in the workstation of each user. When a user logs in, this identifier was inserted in the Net_address column.
Net_Library NCHAR (12) Column in which the client's network library is stored. Every client process comes in on a network connection. Network Connections has a network library associated with them this enables them to make the connection.
Loginame NCHAR (128) Login name.
Context_info Binary (128) Data stored in a batch by using the SET context_info statement.
Sql_handle Binary (20) Represents the currently executing batch or object.

Note This value was derived from the batch or memory address of the object. This value is not a calculated by using the SQL Server hash-based algorithm.
Stmt_start Int Starting offset of the current SQL statement for the specified sql_handle.
Stmt_end Int Ending offset of the current SQL statement for the specified sql_handle.

-1 = Current statement runs to the end of the results returned by the FN_GET_SQL function for the specified sql_handle.
request_id Int ID of request. Used to identify requests running in a specific session.

SQL Server Learning Notes transaction, locking, blocking, deadlock

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.