Skip to content

Commit

Permalink
Merge pull request #276 from VladDBA/dev
Browse files Browse the repository at this point in the history
Updated sp_Blitz scripts
  • Loading branch information
VladDBA authored Oct 22, 2024
2 parents 87c31c7 + a80c7fb commit a81dd11
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 101 deletions.
5 changes: 3 additions & 2 deletions PSBlitz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
.PARAMETER CheckDB
Used to provide the name of a specific database against which sp_BlitzIndex, sp_BlitzCache,
and sp_BlitzLock will be ran. Omit to run against the whole instance.
Also used to provide the name of the Azure SQL DB database.
.PARAMETER CacheTop
Used to specify if more/less than the default top 10 queries should be returned for the
Expand Down Expand Up @@ -264,8 +265,8 @@ param(

###Internal params
#Version
$Vers = "4.4.0"
$VersDate = "2024-10-15"
$Vers = "4.4.1"
$VersDate = "2024-10-22"
$TwoMonthsFromRelease = [datetime]::ParseExact("$VersDate", 'yyyy-MM-dd', $null).AddMonths(2)
$NowDate = Get-Date
#Get script path
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ You can find the all the scripts in the repository's [Resources](/Resources) dir
## Paramaters
| Parameter | Description|
|-----------|------------|
|`-ServerName`| The name of your SQL Server instance or Azure SQL DB connection info. <br><br> Accepted input format: <br> `HostName\InstanceID` for named instances. <br> `HostName,Port` when using a port number instead of an instance ID. <br> `HostName` for default instances. <br><br>For Azure SQL DB the format is: <br> `YourServer.database.windows.net,PortNumber:YourDatabase`if you want to specify the port number. <br> `YourServer.database.windows.net:YourDatabase` if you don't want to specify the port number. <br><br>Other options:<br> If you provide `?` or `Help` as a value for `-ServerName`, the script will return a brief help menu. <br> If no value is provided, the script will go into interactive mode and prompt for the appropriate input |
|`-ServerName`| The name of your SQL Server instance or Azure SQL DB connection info. <br><br> Accepted input format: <br> `HostName\InstanceID` for named instances. <br> `HostName,Port` when using a port number instead of an instance ID. <br> `HostName` for default instances. <br><br>For Azure SQL DB the format is: <br> `YourServer.database.windows.net,PortNumber:YourDatabase` if you want to specify the port number. <br> `YourServer.database.windows.net:YourDatabase` if you don't want to specify the port number. <br> If your Azure SQL DB instance doesn't use the `database.windows.net` portion (e.g.: it's configured to use an IP instead) then you should provide the database name via the `-CheckDB` parameter.<br><br>Other options:<br> If you provide `?` or `Help` as a value for `-ServerName`, the script will return a brief help menu. <br> If no value is provided, the script will go into interactive mode and prompt for the appropriate input |
|`-SQLLogin`| The name of the SQL login used to run the script. If not provided, the script will use integrated security. |
|`-SQLPass` | The password for the SQL login provided via the -SQLLogin parameter, omit if `-SQLLogin` was not used. |
|`-IsIndepth` | Providing Y as a value will tell PSBlitz.ps1 to run a more in-depth check against the instance/database. Omit for default check. |
|`-CheckDB` | Used to provide the name of a specific database against which sp_BlitzIndex, sp_BlitzCache, and sp_BlitzLock will be ran. Omit to run against the whole instance.|
|`-CheckDB` | Used to provide the name of a specific database against which sp_BlitzIndex, sp_BlitzCache, and sp_BlitzLock will be ran. Omit to run against the whole instance.<br><br>__For Azure SQL DB__<br>Can also be used to provide the name of the Azure SQL DB database if you haven't provided it as part of the <br>`-ServerName` paramter.<br>If the database name is not provided here, nor as part of the `-ServerName`, and the environment is detected as Azure SQL DB, then you'll be prompted to provide the database name.|
|`-CacheTop`| Used to specify if more/less than the default top 10 queries should be returned for the sp_BlitzCache step. Only works for HTML output (`-ToHTM Y`). Has no effect on the `recent compilations` sort order.|
|`-CacheMinutesBack`| Used to specify how many minutes back to begin plan cache analysis. Defaults to entire contents of the plan cache since instance startup.<br> In order to avoid missing the desired timeframe, the value is dynamically adjusted based on the runtime of PSBlitz up until the plan cache analysis point.|
|`-OutputDir`| Used to provide a path where the output directory should be saved to. Defaults to PSBlitz.ps1's directory if not specified or a non-existent path is provided.|
Expand Down
2 changes: 1 addition & 1 deletion Resources/spBlitzCache_NonSPLatest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.21', @VersionDate = '20240701';
SELECT @Version = '8.22', @VersionDate = '20241019';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down
2 changes: 1 addition & 1 deletion Resources/spBlitzFirst_NonSPLatest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.21', @VersionDate = '20240701';
SELECT @Version = '8.22', @VersionDate = '20241019';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
Loading

0 comments on commit a81dd11

Please sign in to comment.