摘要:
查看连接当前数据库的SPID所加的锁 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT DB_NAME(resource_database_id) AS DatabaseName , request_session_id , resource_type , CASE WHEN resource_type = 'OBJECT' THEN OBJECT_NAME(resource_associated_entity_id) WHEN resource_type IN ('KEY', 'PA... 阅读全文
摘要:
查看被缓存的查询计划 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT TOP 20 st.text AS [SQL] , cp.cacheobjtype , cp.objtype , COALESCE(DB_NAME(st.dbid), DB_NAME(CAST(pa.value AS INT))+'*', 'Resource') AS [DatabaseName] , cp.usecounts AS [P... 阅读全文
摘要:
有关索引的DMV 1.查看那些被大量更新,却很少被使用的索引 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT DB_NAME() AS DatabaseName , SCHEMA_NAME(o.Schema_ID) AS SchemaName , OBJECT_NAME(s.[object_id]) AS TableName , i.name A... 阅读全文