Metadata Lock 모니터링
Metadata Lock 모니터링
SELECT b.OBJECT_TYPE, b.OBJECT_SCHEMA, b.OBJECT_NAME,
b.LOCK_TYPE, b.LOCK_STATUS, c.THREAD_ID, c.PROCESSLIST_ID,c.PROCESSLIST_INFO
FROM performance_schema.metadata_locks a JOIN performance_schema.metadata_locks b
ON a.OWNER_THREAD_ID<>b.OWNER_THREAD_ID AND a.OBJECT_NAME=b.OBJECT_NAME
AND a.LOCK_STATUS = 'PENDING'
JOIN performance_schema.threads c
ON b.OWNER_THREAD_ID = c.THREAD_ID;