2016-06-23 1 views
0

proc 실행 중 오류가 발생했습니다. SSIS를 통해 .. 오류 : 테이블SQLSERVER - LOCK 오류

UPDATE ta   
     SET ta.id = 
     CASE 
      WHEN ta.id=tmp.MergeoldId THEN tmp.MergenewId 
      ELSE ta.id 
     END, 
     ta.Id2= 
     CASE 
     WHEN ta.Id2=tmp.MergeoldId THEN tmp.MergenewId 
     ELSE ta.Id2 
     END, 
     ta.Id3= 
     CASE 
      WHEN ta.Id3=tmp.MergeoldId THEN tmp.MergenewId 
      ELSE ta.Id3 
     END 
     --SELECT ta.id ,ta.Id2,ta.Id3, tmp.MergeoldId,* 
     FROM tel.TranAssemble ta WITH (ROWLOCK) 
     INNER JOIN clk.id_Process tmp WITH (NOLOCK) on (ta.id = tmp.MergeoldId OR ta.Id2=tmp.MergeoldId OR ta.Id3=tmp.MergeoldId) 
     WHERE tmp.Id >= @MinId AND tmp.Id < @MINID + @BatchSize 

모든 솔루션을 업데이트하는 동안

[Execute SQL Task] Error: Executing the query "Exec clk.id_Process ? ,? ,?" failed with the following error: "The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

내가

"sys.dm_exec_sessions AS s 
INNER JOIN sys.dm_exec_requests AS r ON r.session_id = s.session_id 
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st" 

에 가입하여 문제를 추적하기 위해 노력하고 그 발견은 strucked 지?

+0

를 조회 할 수 있습니다 .. – TheGameiswar

답변

1

이 문제는 The lock manager will not use more than 60 percent of the memory available to SQL Server부터 메모리 부족으로 인한 것입니다. 각각은 (96 바이트) 보유 잠금

SQL Server cannot obtain a lock resource. This can be caused by either of the following reasons:
SQL Server cannot allocate more memory from the operating system, either because other processes are using it, or because the server is operating with the max server memory option configured.
The lock manager will not use more than 60 percent of the memory available to SQL Server.

일반적 SQL 서버는 모든 쿼리 (심지어 선택) 및 적은 양의 메모리를위한 잠금 사용 이용한다. 위의 지식을 바탕으로

, 아래 사용하여 문제를 해결하는 시작에 대한 질문에 DMV의 출력을 게시하시기 바랍니다

--this gives you currently running queries holding more locks 
select * from sys.dm_exec_requests ec 
cross apply 
(SELECT request_session_id, COUNT (*) num_locks 
FROM sys.dm_tran_locks trn 
where ec.session_id=trn.request_session_id 
GROUP BY request_session_id 
)b 

--this gives you locks for allsessions 
SELECT request_session_id, COUNT (*) num_locks 
FROM sys.dm_tran_locks trn 
where ec.session_id=trn.request_session_id 
GROUP BY request_session_id