sql出现lock request time out period exceeded是怎么回事

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql出现lock request time out period exceeded是怎么回事相关的知识,希望对你有一定的参考价值。

参考技术A sql出现lock request time out period exceeded是怎么回事
可能是有其他进行在操作数据库,先将相关的应用关闭
用SELECT @@TRANCOUNT 查看下
或者

select distinct object_name(a.rsc_objid), a.req_spid, b.loginame
from master.dbo.syslockinfo a (nolock) join
master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid
where object_name(a.rsc_objid) is not null

查看下是否有其他进程在操作数据库

sql 此SQL函数用于使用Machine FQDN或OU通过ResourceID获取Machine Company。

/*
*********************************************************************************************************
* Created by Ioan Popovici, 2015-08-18       | Requirements: CM_Tools Database                          *
* ======================================================================================================*
* Modified by                   |    Date    | Revision | Comments                                      *
*_______________________________________________________________________________________________________*
* Ioan Popovici                 | 2015-08-18 | v1.0     | First version                                 *
*-------------------------------------------------------------------------------------------------------*
* Credit to: Michelle Ufford http://sqlfool.com.                                                        *
*********************************************************************************************************

    .SYNOPSIS
        This SQL Function is used to get the Machine Company by ResourceID.
    .DESCRIPTION
        This SQL Function is used to get the Machine Company by ResourceID using Machine FQDN or OU.
*/

/*##=============================================*/
/*## QUERY BODY
/*##=============================================*/
/* #region QueryBody */

USE [CM_Tools]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO

IF EXISTS (
    SELECT  [OBJECT_ID]
    FROM    SYS.OBJECTS
    WHERE   NAME = 'ufn_GetCompany_by_ResourceID'
    )
    DROP FUNCTION dbo.ufn_GetCompany_by_ResourceID;
GO

CREATE FUNCTION [dbo].[ufn_GetCompany_by_ResourceID](@pResourceID INT)
RETURNS VARCHAR(200)
AS
    BEGIN
        DECLARE @RET VARCHAR(200);
        SELECT @RET =
        (
            SELECT TOP 1
                CASE
                    WHEN ([ou].[System_OU_Name0] LIKE '%XXX%' OR [rn].[Resource_Names0] LIKE '%XXX%') THEN 'XXX'
                    WHEN ([ou].[System_OU_Name0] LIKE '%YYY%' OR [rn].[Resource_Names0] LIKE '%YYY%') THEN 'YYY'
                    ELSE '0-UNKNOWN'
                END
        FROM [CM_A01].[dbo].[v_RA_System_ResourceNames] [rn]
        LEFT JOIN [CM_A01].[dbo].[v_RA_System_SystemOUName] AS [ou] ON @pResourceID = [ou].[ResourceID]
        WHERE [rn].[Resource_Names0] IS NOT NULL
            AND [rn].[ResourceID] = @pResourceID
        )
        IF @RET IS NULL SET @RET = '0-UNKNOWN'
        RETURN @RET;
    END;

/* #endregion */
/*##=============================================*/
/*## END QUERY BODY                              */
/*##=============================================*/

以上是关于sql出现lock request time out period exceeded是怎么回事的主要内容,如果未能解决你的问题,请参考以下文章

Fatal NI connect error 12170,TNS-12535: TNS:operation timed out,WARNING: inbound connection timed ou

Oracle里面的用户smsdb无法登录 LOCKED(TIMED)

PING中出现request timed out 啥意思?

电脑网络出现request timed out 这么回事?

Python进阶_进程与线程中的lock(互斥锁递归锁信号量)

锁对象Lock