Lock:Timeout (timeout > 0) 事件类Lock:Timeout (timeout > 0) Event Class

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

Lock:Timeout (timeout > 0) 事件类指示由于其他事务持有所需资源的阻塞锁而使对资源(例如页)锁的请求超时。The Lock:Timeout (timeout > 0) event class indicates that a request for a lock on a resource, such as a page, has timed out because another transaction is holding a blocking lock on the required resource. 此事件类除了不包括超时值为 0 的任何事件外,其行为与 Lock:Timeout 事件类相同。This event class behaves the same as the Lock:Timeout event class, except it does not include any events where the timeout value is 0.

包括你正在其中使用超时值为零的锁探测或其他进程的跟踪中的 Lock:Timeout (timeout > 0) 事件类。Include the Lock:Timeout (timeout > 0) event class in traces where you are using lock probes or other processes that have timeout values of zero. 这样您可以查看实际超时发生的位置而无需查看超时值是否为零。This allows you to see where actual time-outs are occurring without seeing time-out values of zero.

Lock:Timeout (timeout > 0) 事件类的数据列Lock:Timeout (timeout > 0) Event Class Data Columns

数据列名称Data column name 数据类型Data type 说明Description 列 IDColumn ID 可筛选Filterable
ApplicationNameApplicationName nvarcharnvarchar 客户端应用程序的名称,该客户端应用程序创建了指向 SQL ServerSQL Server实例的连接。Name of the client application that created the connection to an instance of SQL ServerSQL Server. 此列由应用程序传递的值填充,而不是由所显示的程序名填充。This column is populated with the values passed by the application rather than the displayed name of the program. 1010 Yes
BinaryDataBinaryData 图像image 锁资源标识符。Lock resource identifier. 22 Yes
ClientProcessIDClientProcessID intint 主机为运行该客户端应用程序的进程分配的 ID。ID assigned by the host computer to the process where the client application is running. 如果客户端提供了客户端进程 ID,则填充此数据列。This data column is populated if the client provides the client process ID. 99 Yes
DatabaseIDDatabaseID intint 发生超时的数据库的 ID。ID of the database in which the timeout occurred. SQL Server ProfilerSQL Server Profiler 数据列而且服务器可用,则 ServerName 将显示数据库名。displays the name of the database if the ServerName data column is captured in the trace and the server is available. 可使用 DB_ID 函数来确定数据库的值。Determine the value for a database by using the DB_ID function. 33 Yes
DatabaseNameDatabaseName nvarcharnvarchar 发生超时的数据库的名称。Name of the database in which the time-out occurred. 3535 Yes
DurationDuration bigintbigint 事件占用的时间(微秒)。Amount of time (in microseconds) taken by the event. 1313 Yes
EndTimeEndTime datetimedatetime 事件结束的时间。Time at which the event ended. 启动事件类(如 SQL:BatchStartingSP:Starting)不填充此列。This column is not populated for starting event classes, such as SQL:BatchStarting or SP:Starting. 1515 Yes
EventClassEventClass intint 事件类型 = 189。Type of event=189. 2727 No
EventSequenceEventSequence intint 给定事件在请求中的顺序。Sequence of a given event within the request. 5151 No
GroupIDGroupID intint 在其中激发 SQL 跟踪事件的工作负荷组的 ID。ID of the workload group where the SQL Trace event fires. 6666 Yes
HostNameHostName nvarcharnvarchar 正在运行客户端的计算机的名称。Name of the computer on which the client is running. 如果客户端提供了主机名,则填充此数据列。This data column is populated if the client provides the host name. 若要确定主机名,请使用 HOST_NAME 函数。To determine the host name, use the HOST_NAME function. 88 Yes
IntegerData2IntegerData2 intint 标识为仅供参考。Identified for informational purposes only. 不支持。Not supported. 不保证以后的兼容性。Future compatibility is not guaranteed. 5555 Yes
IsSystemIsSystem intint 指示事件是发生在系统进程中还是发生在用户进程中。Indicates whether the event occurred on a system process or a user process. 1 = 系统,0 = 用户。1 = system, 0 = user. 6060 Yes
LoginNameLoginName nvarcharnvarchar 用户的登录名( SQL ServerSQL Server 安全登录名或 MicrosoftMicrosoft Windows 登录凭据,格式为“DOMAIN\username”)。Name of the login of the user (either SQL ServerSQL Server security login or the MicrosoftMicrosoft Windows login credentials in the form of DOMAIN\username). 1111 Yes
LoginSidLoginSid 图像image 登录用户的安全标识号 (SID)。Security identification number (SID) of the logged-in user. 您可以在 sys.server_principals 目录视图中找到此信息。You can find this information in the sys.server_principals catalog view. 服务器中的每个登录名都具有唯一的 SID。Each SID is unique for each login in the server. 4141 Yes
“模式”Mode intint 事件已接收的或正在请求的状态。State that the event has received or is requesting.


1 = Sch-S1=Sch-S

2 = Sch-M2=Sch-M

3 = S3=S

4 = U4=U

5 = X5=X

6 = IS6=IS

7 = IU7=IU

8 = IX8=IX

9 = SIU9=SIU

10 = SIX10=SIX

11 = UIX11=UIX

12 = BU12=BU

13 = RangeS-S13=RangeS-S

14 = RangeS-U14=RangeS-U

15 = RangeI-N15=RangeI-N

16 = RangeI-S16=RangeI-S

17 = RangeI-U17=RangeI-U

18 = RangeI-X18=RangeI-X

19 = RangeX-S19=RangeX-S

20 = RangeX-U20=RangeX-U

21 = RangeX-X21=RangeX-X
3232 Yes
NTDomainNameNTDomainName nvarcharnvarchar 用户所属的 Windows 域。Windows domain to which the user belongs. 77 Yes
NTUserNameNTUserName nvarcharnvarchar Windows 用户名。Windows user name. 66 Yes
ObjectIDObjectID intint 对象的 ID(如果可用且适用)。ID of the object, if available and applicable. 2222 Yes
ObjectID2ObjectID2 bigintbigint 相关对象或实体的 ID(如果可用且适用)。ID of the related object or entity, if available and applicable. 5656 Yes




5858 Yes
RequestIDRequestID intint 包含该语句的请求的 ID。ID of the request containing the statement. 4949 Yes
ServerNameServerName nvarcharnvarchar 所跟踪的 SQL ServerSQL Server 实例的名称。Name of the instance of SQL ServerSQL Server being traced. 2626 No
SessionLoginNameSessionLoginName nvarcharnvarchar 发起会话的用户的登录名。Login name of the user who originated the session. 例如,如果你使用 Login1 连接到 SQL ServerSQL Server ,再以 Login2 的身份执行语句,则 SessionLoginName 将显示 Login1,而 LoginName 将显示 Login2。For example, if you connect to SQL ServerSQL Server using Login1 and execute a statement as Login2, SessionLoginName shows Login1 and LoginName shows Login2. 此列将同时显示 SQL ServerSQL Server 登录名和 Windows 登录名。This column displays both SQL ServerSQL Server and Windows logins. 6464 Yes
SPIDSPID intint 发生该事件的会话的 ID。ID of the session on which the event occurred. 1212 Yes
StartTimeStartTime datetimedatetime 该事件(如果存在)的启动时间。Time at which the event started, if available. 1414 Yes
TextDataTextData ntextntext 依赖于跟踪中捕获的事件类的文本值。Text value dependent on the event class captured in the trace. 11 Yes
TransactionIDTransactionID bigintbigint 系统分配的事务 ID。System-assigned ID of the transaction. 44 Yes





7 = KEY7=KEY


9 = RID9=RID




13 = HOBT13=HOBT

5757 Yes

另请参阅See Also

Lock:Timeout 事件类 Lock:Timeout Event Class
sp_trace_setevent (Transact-SQL) sp_trace_setevent (Transact-SQL)
sys.dm_tran_locks (Transact-SQL)sys.dm_tran_locks (Transact-SQL)