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 #3152

Closed
mmcdonald-1 opened this issue Oct 12, 2022 · 1 comment
Closed

sp_BlitzInMemoryOLTP Fails to run -- 2 Issues #3152

mmcdonald-1 opened this issue Oct 12, 2022 · 1 comment

Comments

@mmcdonald-1
Copy link

mmcdonald-1 commented Oct 12, 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 one additional change -- #resultsContainerFileDetails -- sizeGB. They 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/

@BrentOzar
Copy link
Member

Hi. This is a little tricky to catch, but in that script, we actually point out that we're mirroring it from another repo. For changes to that script, head over here:

https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/dbo.sp_BlitzInMemoryOLTP.sql

Thanks!

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