Skip to content

Commit dc366d9

Browse files
Merge pull request #619 from erikdarlingdata/dev
Dev
2 parents 59d9c9d + 8ea87fb commit dc366d9

File tree

7 files changed

+832
-446
lines changed

7 files changed

+832
-446
lines changed

.DS_Store

-10 KB
Binary file not shown.

sp_HealthParser/sp_HealthParser.sql

Lines changed: 349 additions & 95 deletions
Large diffs are not rendered by default.

sp_HumanEvents/README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ EXECUTE dbo.sp_HumanEvents
122122

123123
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.
124124

125-
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.
125+
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.
126+
127+
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.
126128

127129
## Setup
128130

@@ -172,28 +174,29 @@ ON SERVER
172174

173175
## Parameters
174176

175-
| parameter_name | data_type | description | valid_inputs | defaults |
176-
|-----------------------|-----------|-------------------------------------------------|------------------------------------------------------------------------|------------------------------------|
177-
| @session_name | sysname | name of the extended event session to pull from | extended event session name capturing sqlserver.blocked_process_report | keeper_HumanEvents_blocking |
178-
| @target_type | sysname | target of the extended event session | event_file or ring_buffer | NULL |
179-
| @start_date | datetime2 | filter by date | a reasonable date | NULL; will shortcut to last 7 days |
180-
| @end_date | datetime2 | filter by date | a reasonable date | NULL |
181-
| @database_name | sysname | filter by database name | a database that exists on this server | NULL |
182-
| @object_name | sysname | filter by table name | a schema-prefixed table name | NULL |
183-
| @target_database | sysname | database containing the table with BPR data | a valid database name | NULL |
184-
| @target_schema | sysname | schema of the table | a valid schema name | NULL |
185-
| @target_table | sysname | table name | a valid table name | NULL |
186-
| @target_column | sysname | column containing XML data | a valid column name | NULL |
187-
| @timestamp_column | sysname | column containing timestamp (optional) | a valid column name | NULL |
188-
| @log_to_table | bit | enable logging to permanent tables | 0 or 1 | 0 |
189-
| @log_database_name | sysname | database to store logging tables | a valid database name | NULL |
190-
| @log_schema_name | sysname | schema to store logging tables | a valid schema name | NULL |
191-
| @log_table_name_prefix| sysname | prefix for all logging tables | a valid table name prefix | 'HumanEventsBlockViewer' |
192-
| @log_retention_days | integer | Number of days to keep logs, 0 = keep indefinitely | a valid integer | 30 |
193-
| @help | bit | how you got here | 0 or 1 | 0 |
194-
| @debug | bit | dumps raw temp table contents | 0 or 1 | 0 |
195-
| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
196-
| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
177+
| parameter_name | data_type | description | valid_inputs | defaults |
178+
|-----------------------|-----------|----------------------------------------------------|--------------------------------------------------------------------------------------------------|------------------------------------|
179+
| @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 |
180+
| @target_type | sysname | target of the extended event session | event_file or ring_buffer or table | NULL |
181+
| @start_date | datetime2 | filter by date | a reasonable date | NULL; will shortcut to last 7 days |
182+
| @end_date | datetime2 | filter by date | a reasonable date | NULL |
183+
| @database_name | sysname | filter by database name | a database that exists on this server | NULL |
184+
| @object_name | sysname | filter by table name | a schema-prefixed table name | NULL |
185+
| @target_database | sysname | database containing the table with BPR data | a valid database name | NULL |
186+
| @target_schema | sysname | schema of the table | a valid schema name | NULL |
187+
| @target_table | sysname | table name | a valid table name | NULL |
188+
| @target_column | sysname | column containing XML data | a valid column name | NULL |
189+
| @timestamp_column | sysname | column containing timestamp (optional) | a valid column name | NULL |
190+
| @log_to_table | bit | enable logging to permanent tables | 0 or 1 | 0 |
191+
| @log_database_name | sysname | database to store logging tables | a valid database name | NULL |
192+
| @log_schema_name | sysname | schema to store logging tables | a valid schema name | NULL |
193+
| @log_table_name_prefix| sysname | prefix for all logging tables | a valid table name prefix | 'HumanEventsBlockViewer' |
194+
| @log_retention_days | integer | Number of days to keep logs, 0 = keep indefinitely | a valid integer | 30 |
195+
| @max_blocking_events | bigint | maximum blocking events to analyze, 0 = unlimited | 0 to 9223372036854775807 | 5000 |
196+
| @help | bit | how you got here | 0 or 1 | 0 |
197+
| @debug | bit | dumps raw temp table contents | 0 or 1 | 0 |
198+
| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
199+
| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT |
197200

198201
## Usage Examples
199202

@@ -219,4 +222,4 @@ EXECUTE dbo.sp_HumanEventsBlockViewer
219222
@log_to_table = 1,
220223
@log_database_name = 'DBA',
221224
@log_schema_name = 'dbo';
222-
```
225+
```

0 commit comments

Comments
 (0)