user9419188
user9419188

Reputation: 27

How to determine the applications and application id holding locks on a certain table

I know the command for table holding locks.Can anyone give the command to determine application and application id holding locks for the certain table.

Thanks in advance

Upvotes: 1

Views: 1592

Answers (1)

mustaccio
mustaccio

Reputation: 18945

You can use the monitor function MON_GET_LOCKS(), for example

SELECT lock_name, 
       member, 
       lock_status,
       application_handle 
FROM 
    TABLE (MON_GET_LOCKS(NULL, -2))

You can then use MON_GET_CONNECTION() to retrieve application details by its handle and MON_FORMAT_LOCK_NAME() to obtain detailed information about a particular lock.

Upvotes: 1

Related Questions