SQL Reference

By Frederic JOFES and Co.

Étiquette : Locks

Give locks and deadlocks by type

-- Donne la liste des locks et deadlock en fonction des types
SELECT [counter_name],"OibTrackTbl","AllocUnit","HoBT","Metadata","Application","RID","Extent","Key","Page","Object","File","Database","_Total"
FROM (SELECT [counter_name],[instance_name],[cntr_value] FROM sys.dm_os_performance_counters WHERE OBJECT_NAME LIKE '%:Locks%') os_pc
PIVOT (AVG([cntr_value]) FOR [instance_name] IN ("OibTrackTbl","AllocUnit","HoBT","Metadata","Application","RID","Extent","Key","Page","Object","File","Database","_Total")) AS Pvt;

List of all current locks

Donne la liste de tous les locks

Lire la suite

Fièrement propulsé par Fred & Co.