# Lock Monitoring

글로벌 내비게이션 바에서 **\[Realtime] > \[Lock Monitoring]** 메뉴를 클릭 시, Lock Monitoring 화면이 열린다.&#x20;

Lock Monitoring 화면에서는 세션간의 Lock 정보를 Tree 형식으로 보여준다. 따라서 Lock을 점유하고 있는 Holder Session과 Lock을 획득하기 위해 기다리고 있는 Waiter Session을 모니터링 할 수 있다. 그리고Lock을 점유하고 있는 세션을 모니터링할 수 있으며, 특정 세션을 종료 시킬 수 있다.

<figure><img src="/files/WLTt5Z7F75jA9LNfH0KC" alt=""><figcaption></figcaption></figure>

다음은 Lock Tree Table 화면에서 제공하는 항목에 대한 설명이다.

<table><thead><tr><th width="205">항목</th><th>설명</th></tr></thead><tbody><tr><td>Instance</td><td>SysMaster DB에 등록된 해당 인스턴스 이름</td></tr><tr><td>PID</td><td>PostgreSQL 백엔드 프로세스 PID</td></tr><tr><td>DB Name</td><td>접속한 데이터베이스 이름</td></tr><tr><td>Elapsed Time</td><td>현재 수행 중인 SQL의 경과 시간</td></tr><tr><td>Status</td><td>세션의 Holder 및 Waiter 정보</td></tr><tr><td>Session Status</td><td><p>세션의 상태</p><p></p><ul><li>starting: 접속 생성·인증 등 초기화 중</li><li>active: SQL 실행 중(락/I/O 대기 포함)</li><li>idle: SQL 없음, 다음 요청 대기 중</li><li>idle in transaction: 트랜잭션 열고 쿼리 없이 대기</li><li>idle in transaction (aborted): 에러로 중단, ROLLBACK 대기</li><li>fastpath function call: SQL 대신 Fastpath 함수 호출 처리</li><li>disabled: 상태 추적 비활성/표기 불가 상태</li></ul></td></tr><tr><td>User Name</td><td>세션 사용자명</td></tr><tr><td>Type</td><td><p>락이 걸려 있는 대상의 유형을 표시</p><ul><li>relation</li><li>extend</li><li>frozenid</li><li>page</li><li>tuple</li><li>transactionid</li><li>virtualxid</li><li>spectoken</li><li>object</li><li>userlock</li><li>advisory</li><li>applytransaction</li></ul></td></tr><tr><td>Relation</td><td>해당 Lock이 걸려 있는 Relation OID를 실제 객체 이름으로 변환한 값(ex. users). 원본 OID 값</td></tr><tr><td>Page</td><td>잠금 대상 페이지 번호</td></tr><tr><td>Tuple</td><td>잠금 대상 튜플(행) 번호</td></tr><tr><td>Transaction Id</td><td>잠금 관련 트랜잭션 ID 번호</td></tr><tr><td>Mode</td><td><p>이 프로세스가 점유한 Lock 모드</p><ul><li>ACCESS SHARE</li><li>ROW SHARE</li><li>ROW EXCLUSIVE</li><li>SHARE UPDATE EXCLUSIVE</li><li>SHARE</li><li>SHARE ROW EXCLUSIVE</li><li>EXCLUSIVE</li><li>ACCESS EXCLUSIVE</li></ul></td></tr><tr><td>Wait Event</td><td>현재 세션이 기다리고 있는 대기 이벤트</td></tr><tr><td>SQL Text</td><td><ul><li>컬럼에 노출되는 SQL Text 최대 길이는 글자 수 기준(공백 포함) 100자로 제한 (영문/한글 관계없이)</li><li>원본 쿼리의 길이가 100자를 초과할 경우, 100자까지만 표시하고 텍스트 끝에 말줄임표(""..."")를 붙여 텍스트가 잘렸음을 표시</li></ul></td></tr><tr><td>Query ID</td><td>쿼리 식별자</td></tr><tr><td>Application Name</td><td>클라이언트 애플리케이션 이름</td></tr><tr><td>IP Address</td><td>클라이언트 IP</td></tr><tr><td>Client Hostname</td><td>클라이언트 호스트명</td></tr></tbody></table>

## Kill Session

Lock을 점유하고 있는 세션을 종료시켜 Lock을 해제할 수 있는 기능이다.

우선 Lock Tree Table에서 해제할 세션을 선택한 후 Lock Tree Table 화면 오른쪽 상단의 **\[Kill Session]** 버튼을 클릭하면 Kill Session 팝업창이 열린다. 이때 해당 세션을 Kill하여 Lock을 해제할 수 있다.&#x20;

{% hint style="info" %}
Configurable Privileges 중 선택한 인스턴스에 대해 \[Kill Session] 권한이 부여된 사용자에 한해 사용할 수 있는 기능이다.
{% endhint %}

{% hint style="info" %}
**참고**

팝업창 정보에 대해서 Session Monitoring의 '[Kill Session'](/sysmasterdb-for-postgresql1.0/8.3_manual/realtime/main-monitoring/session-monitoring.md#kill-session)을 참고한다.

Lock Monitoring의 Kill Session도 Session Monitoring과 동일하게 **SuperUser가 실행하고 있는 세션은 kill이 불가능**하다.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tibero.com/sysmasterdb-for-postgresql1.0/8.3_manual/realtime/lock-monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
