Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_BlitzInMemoryOLTP Fails to run -- 2 Issues #209

Open
mmcdonald-1 opened this issue Oct 13, 2022 · 2 comments
Open

sp_BlitzInMemoryOLTP Fails to run -- 2 Issues #209

mmcdonald-1 opened this issue Oct 13, 2022 · 2 comments

Comments

@mmcdonald-1
Copy link

mmcdonald-1 commented Oct 13, 2022

First issue is @VersionDate. It should be '20220718' instead of '202204718'.

The second is the data loaded into #moduleSplit -- the format for the check point files changed from 2017 to 2019. The below correction starts at line 992

`

        /*
        #####################################################
            List *loaded* natively compiled modules in this database, i.e. executed at least 1x
        #####################################################
        */

        /*
            the format for checkpoint files changed from SQL 2014 to SQL 2016

            SQL 2014 format:
            database_id = 5
            object_id = 309576141

            H:\SQLDATA\xtp\5\xtp_p_5_309576141.dll

            SQL 2016+ format
            database_id = 9
            object_id = 1600880920

            H:\SQLDATA\xtp\9\xtp_p_9_1600880920_185048689287400_1.dll

            the following code should handle all versions
        */
        -- NOTE: disabling this for Azure SQL DB
        IF @tableName IS NULL AND @RunningOnAzureSQLDB = 0
        BEGIN
           SELECT @sql =
                CONCAT
                (
                    ';WITH nativeModuleObjectID AS
                     (
                        SELECT DISTINCT REPLACE(value, ''.dll'', '''') AS object_id
                        FROM #moduleSplit
                        WHERE rowNumber % ' 
                 ,CASE WHEN @MSSQLVersion = 12 THEN ' 4 = 0'
--                           ELSE ' 6 = 4'  -- @MSSQLVersion >= 13 
/*Change because 2019 differs from 2016 & 2017*/
			 WHEN @MSSQLVersion IN (13,14) THEN ' 6 = 4'		/*SQL2016 & 2017*/
			 ELSE ' 7 = 5'			/*SQL2019*/
                  END 
                    ,')'
                );

`

Plus two additional changes -- #resultsContainerFileDetails -- sizeGB. The data going in is actually in MB

`

CREATE TABLE #resultsContainerFileDetails 
(
     [object] NVARCHAR(256)
    ,databaseName NVARCHAR(256)
    ,containerName NVARCHAR(256)
    ,container_id BIGINT
    ,fileType NVARCHAR(256)
    ,fileState NVARCHAR(256)
    ,sizeBytes NVARCHAR(256)
    ,sizeMB NVARCHAR(256)            /*Change from sizeGB to sizeMB*/
    ,fileCount INT 
    ,fileGroupState NVARCHAR(256)
);

`

And near 1523
,FORMAT(ContainerFileDetails.sizeinBytes / 1048576., ''###,###,###'') AS sizeMB /Change from sizeGB/

Originally raised in FRK -- BrentOzarULTD/SQL-Server-First-Responder-Kit#3152

@ktaranov
Copy link
Owner

@mmcdonald-1 Hello, thanks for issue, could you create PR with this changes? I will test it

@mmcdonald-1
Copy link
Author

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants