Description | File name |
select db_name(database_id) DB, object_name(object_id) Obj, row_lock_count + page_lock_count No_Of_Locks, row_lock_wait_count + page_lock_wait_count No_Of_Blocks, row_lock_wait_in_ms + page_lock_wait_in_ms Block_Wait_Time, index_id from sys.dm_db_index_operational_stats(NULL,NULL,NULL,NULL) order by Block_Wait_Time desc
| {ComputerName}_AX_SQLBlocking
|
select SELECT TOP 25 total_elapsed_time, execution_count, (total_elapsed_time/execution_count)/1000.0 AS [avg_elapsed_time_ms], total_logical_reads/execution_count AS [avg_logical_reads], SUBSTRING(st.text, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(st.text) ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) AS sql_text, qp.query_plan FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) as qp --where st.text like '%search criteria here%' ORDER BY total_elapsed_time DESC
| {ComputerName}_SQL Top 25 Queries
|
select * from sys.configurations(nolock)
| {ComputerName}_sys.databases.csv
|
select name as DBName, is_read_committed_snapshot_on, snapshot_isolation_state, is_auto_create_stats_on, is_auto_update_stats_on, is_auto_shrink_on, recovery_model, compatibility_level, is_auto_close_on, is_auto_shrink_on from sys.databases where name = @DBName
| {ComputerName}_Sys.Configurations.csv
|
select TOP(1000)* from SYSEXCEPTIONTABLE (nolock) order by Createddatetime desc
| {ComputerName}_AX_SYSEXCEPTIONTABLE
|