Skip to content
Merged

Dev #619

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
be7257f
Appended _ms where it was missing for avg_cpu_time
ReeceGoding May 4, 2025
65ca591
Merge pull request #600 from ReeceGoding/dev
erikdarlingdata May 4, 2025
1de337f
Moved validation of @sort_order to be much earlier on. It's ugly, but…
ReeceGoding May 4, 2025
7dc6ed6
Merge branch 'FixBadWaits' into dev
ReeceGoding May 4, 2025
275520d
Merge pull request #602 from ReeceGoding/dev
erikdarlingdata May 4, 2025
7465e70
Moved special sorting columns for special sort order values to be jus…
ReeceGoding May 4, 2025
734d2da
Merge pull request #604 from ReeceGoding/dev
erikdarlingdata May 4, 2025
b1bd332
Documents that @format_output = 1 removes most decimals.
ReeceGoding May 5, 2025
6dcade9
Made plan hash, query hash, or sql handle show when the parameter for…
ReeceGoding May 5, 2025
9a7dcfc
Made multiple hash/handle columns able to show at once.
ReeceGoding May 5, 2025
fd929c7
Made the plan count by hashes sort order show plan hashes.
ReeceGoding May 5, 2025
6684d1d
Merge pull request #608 from ReeceGoding/show-columns-when-filtering-out
erikdarlingdata May 5, 2025
d397daf
Closes #609
erikdarlingdata May 5, 2025
6715663
Merge pull request #606 from ReeceGoding/dev
erikdarlingdata May 5, 2025
34ed769
Adding support for indexed views in addition to indexes on tables.
FirstCall42 May 10, 2025
eaba7f5
Merge pull request #610 from FirstCall42/views-support
erikdarlingdata May 14, 2025
328bd4a
Moved all validation of the regression mode parameters to be before w…
ReeceGoding May 14, 2025
2a00534
Standardised checks for regression mode being enabled.
ReeceGoding May 14, 2025
9dea67d
Merge pull request #612 from ReeceGoding/Move-regression-validation-t…
erikdarlingdata May 14, 2025
5e28138
Made sp_HumanEventsBlockViewer not error out when system_health is us…
ReeceGoding May 24, 2025
89e4525
Made warning that we are using event_file more clear that we are doin…
ReeceGoding May 25, 2025
f268a59
Made DECLARE block be all one big block again, as per Erik's feedback…
ReeceGoding May 25, 2025
1cb9cfa
Merge pull request #618 from ReeceGoding/dev
erikdarlingdata May 27, 2025
5b22ee7
Update sp_HealthParser.sql
erikdarlingdata May 27, 2025
f31bad8
Update sp_HealthParser.sql
erikdarlingdata May 27, 2025
02fab8f
Update sp_HealthParser.sql
erikdarlingdata May 28, 2025
f018dc2
Update sp_HumanEventsBlockViewer.sql
erikdarlingdata May 28, 2025
eb779c7
Update sp_HumanEventsBlockViewer.sql
erikdarlingdata May 28, 2025
2eb0604
Delete .DS_Store
erikdarlingdata May 28, 2025
fe34015
Update sp_HumanEventsBlockViewer.sql
erikdarlingdata May 28, 2025
bbf1c6d
doot doot
erikdarlingdata May 28, 2025
bb53f5b
Merge branch 'dev' of https://github.com/erikdarlingdata/DarlingData …
erikdarlingdata May 28, 2025
8ea87fb
Update sp_HumanEventsBlockViewer.sql
erikdarlingdata May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
444 changes: 349 additions & 95 deletions sp_HealthParser/sp_HealthParser.sql

Large diffs are not rendered by default.

51 changes: 27 additions & 24 deletions sp_HumanEvents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ EXECUTE dbo.sp_HumanEvents

This was originally a companion script to analyze the blocked process report Extended Event created by sp_HumanEvents, but has since turned into its own monster.

It will work on any Extended Event that captures the blocked process report. If you need to set that up, run these two pieces of code.
It will work on any Extended Event that captures the blocked process report. If you need to set that up, run the next two pieces of code.

The system_health Extended Event works, but its blocked process report is much less comprehensive than the real thing. I do not allow logging to a table from this, because the set of columns and available data is too incomplete, and I don't want to juggle multiple table definitions.

## Setup

Expand Down Expand Up @@ -172,28 +174,29 @@ ON SERVER

## Parameters

| parameter_name | data_type | description | valid_inputs | defaults |
|-----------------------|-----------|-------------------------------------------------|------------------------------------------------------------------------|------------------------------------|
| @session_name | sysname | name of the extended event session to pull from | extended event session name capturing sqlserver.blocked_process_report | keeper_HumanEvents_blocking |
| @target_type | sysname | target of the extended event session | event_file or ring_buffer | NULL |
| @start_date | datetime2 | filter by date | a reasonable date | NULL; will shortcut to last 7 days |
| @end_date | datetime2 | filter by date | a reasonable date | NULL |
| @database_name | sysname | filter by database name | a database that exists on this server | NULL |
| @object_name | sysname | filter by table name | a schema-prefixed table name | NULL |
| @target_database | sysname | database containing the table with BPR data | a valid database name | NULL |
| @target_schema | sysname | schema of the table | a valid schema name | NULL |
| @target_table | sysname | table name | a valid table name | NULL |
| @target_column | sysname | column containing XML data | a valid column name | NULL |
| @timestamp_column | sysname | column containing timestamp (optional) | a valid column name | NULL |
| @log_to_table | bit | enable logging to permanent tables | 0 or 1 | 0 |
| @log_database_name | sysname | database to store logging tables | a valid database name | NULL |
| @log_schema_name | sysname | schema to store logging tables | a valid schema name | NULL |
| @log_table_name_prefix| sysname | prefix for all logging tables | a valid table name prefix | 'HumanEventsBlockViewer' |
| @log_retention_days | integer | Number of days to keep logs, 0 = keep indefinitely | a valid integer | 30 |
| @help | bit | how you got here | 0 or 1 | 0 |
| @debug | bit | dumps raw temp table contents | 0 or 1 | 0 |
| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
| parameter_name | data_type | description | valid_inputs | defaults |
|-----------------------|-----------|----------------------------------------------------|--------------------------------------------------------------------------------------------------|------------------------------------|
| @session_name | sysname | name of the extended event session to pull from | extended event session name capturing sqlserver.blocked_process_report, system_health also works | keeper_HumanEvents_blocking |
| @target_type | sysname | target of the extended event session | event_file or ring_buffer or table | NULL |
| @start_date | datetime2 | filter by date | a reasonable date | NULL; will shortcut to last 7 days |
| @end_date | datetime2 | filter by date | a reasonable date | NULL |
| @database_name | sysname | filter by database name | a database that exists on this server | NULL |
| @object_name | sysname | filter by table name | a schema-prefixed table name | NULL |
| @target_database | sysname | database containing the table with BPR data | a valid database name | NULL |
| @target_schema | sysname | schema of the table | a valid schema name | NULL |
| @target_table | sysname | table name | a valid table name | NULL |
| @target_column | sysname | column containing XML data | a valid column name | NULL |
| @timestamp_column | sysname | column containing timestamp (optional) | a valid column name | NULL |
| @log_to_table | bit | enable logging to permanent tables | 0 or 1 | 0 |
| @log_database_name | sysname | database to store logging tables | a valid database name | NULL |
| @log_schema_name | sysname | schema to store logging tables | a valid schema name | NULL |
| @log_table_name_prefix| sysname | prefix for all logging tables | a valid table name prefix | 'HumanEventsBlockViewer' |
| @log_retention_days | integer | Number of days to keep logs, 0 = keep indefinitely | a valid integer | 30 |
| @max_blocking_events | bigint | maximum blocking events to analyze, 0 = unlimited | 0 to 9223372036854775807 | 5000 |
| @help | bit | how you got here | 0 or 1 | 0 |
| @debug | bit | dumps raw temp table contents | 0 or 1 | 0 |
| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT |

## Usage Examples

Expand All @@ -219,4 +222,4 @@ EXECUTE dbo.sp_HumanEventsBlockViewer
@log_to_table = 1,
@log_database_name = 'DBA',
@log_schema_name = 'dbo';
```
```
Loading