Source:  http://www.sqlservergeeks.com/category/one-dmv-a-day/

 

1.  

sys.dm_db_index_physical_stats

 

2.

 

sys.dm_db_index_usage_stats

3.

sys.dm_db_missing_index_details

….many more

 

How to kill multiple sessions

SELECT ‘KILL ‘ + CAST(session_id as varchar(100)) AS Sessions_to_kill
FROM sys.dm_exec_requests where session_id in (54,57,58)
GO
The above query generates the kill statements on the fly for the multiple session which are to be killed.

Another way is to execute the KILL query as a dynamic query instead of getting the list. However, it’s better to check the sessions again before killing them.

The next step is to copy and paste the list in a new query window and execute the KILL command.

Advertisements