Reputation: 27
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
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