Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- Spring
- GIT
- SQL
- MSSQL
- window
- R
- plugin
- hadoop
- xPlatform
- Sqoop
- SPC
- 공정능력
- mybatis
- Python
- react
- vaadin
- tomcat
- mapreduce
- Android
- Kotlin
- Express
- table
- IntelliJ
- es6
- JavaScript
- Java
- SSL
- Eclipse
- 보조정렬
- NPM
Archives
- Today
- Total
DBILITY
mssql lock확인 본문
반응형
- EXEC SP_LOCK
Mode가 X(Exclusive Lock)인 경우 SPID를 확인 - DBCC INPUTBUFFER(SPID)
Client의 마지막 statement를 표시 - EXEC SP_WHO SPID
STATUS, LOINGNAME, DBNAME등 SPID정보를 출력 - KILL SPID
SPID에 해당하는 프로세스를 종료
#ACTIVE SESSION QUERY
SELECT
sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext;
#LOCK LIST
SELECT DISTINCT
name AS database_name,
session_id,
host_name,
login_time,
login_name,
reads,
writes
FROM sys.dm_exec_sessions
LEFT OUTER JOIN sys.dm_tran_locks ON sys.dm_exec_sessions.session_id = sys.dm_tran_locks.request_session_id
INNER JOIN sys.databases ON sys.dm_tran_locks.resource_database_id = sys.databases.database_id
WHERE resource_type <> 'DATABASE'
AND request_mode LIKE '%X%'
AND name ='DATABASE NAME'
ORDER BY name;
반응형
'database > mssql' 카테고리의 다른 글
mssql table column add after backup insert identity data (0) | 2022.08.25 |
---|---|
sql server unpivot string separate characters to row (0) | 2021.09.29 |
mssql server "clr enabled" 구성 옵션을 설정하십시오" (0) | 2020.06.17 |
mssql connection 확인 (0) | 2020.02.06 |
sqlserver connect by (0) | 2019.04.25 |
Comments