SQL Lock request Error 1222
Time period exceeded
Today we got request from user , user are not able to access the database . They asked us to check the database health , when I trying to open database , I got error msg Error 1222 .
I opened new query window and executed the following query to find out the active transaction on this database .
DBCC opentran()
I could see there is one open active transaction is running on same database and we can see the SPID ids details . we get the detail about the SPID using following commands
sp_who2 <SPID>
sp_lock <SPID>
For example, if SPID is 188 then execute the command as
sp_who2 188
sp_lock 188
I have informed user SPID 188 has the culprit of LOCK TIME OUT request and provided the details of SPID to user . I got confirmation user to killing the process ID 188 .
I have executed blow command to kill the process 188 .
KILL 188.
This issue has been resloved ,Now the database is accessible for all users .
=========================================
MSDN
Time period exceeded
Today we got request from user , user are not able to access the database . They asked us to check the database health , when I trying to open database , I got error msg Error 1222 .
I opened new query window and executed the following query to find out the active transaction on this database .
DBCC opentran()
I could see there is one open active transaction is running on same database and we can see the SPID ids details . we get the detail about the SPID using following commands
sp_who2 <SPID>
sp_lock <SPID>
For example, if SPID is 188 then execute the command as
sp_who2 188
sp_lock 188
I have informed user SPID 188 has the culprit of LOCK TIME OUT request and provided the details of SPID to user . I got confirmation user to killing the process ID 188 .
I have executed blow command to kill the process 188 .
KILL 188.
This issue has been resloved ,Now the database is accessible for all users .
=========================================
MSDN
Product Name | SQL Server |
Event ID | 1222 |
Event Source | MSSQLSERVER |
Component | SQLEngine |
Symbolic Name | LK_TIMEOUT |
Message Text | Lock request time out period exceeded. |
Explanation
Another transaction held a lock on a required resource longer than this query could wait for it.
User Action
Perform the following tasks to alleviate the problem:
- Locate the transaction that is holding the lock on the required resource, if possible. Use sys.dm_os_waiting_tasks and sys.dm_tran_locks dynamic management views.
- If the transaction is still holding the lock, terminate that transaction if appropriate.
- Execute the query again.