sp_Blitz: Check 191 - 'Mismatch between the number of TempDB files in sys.master_files versus tempdb.sys.database_files' falsely reported when run without sysadmin #3578
What is the current behavior?
Check 191 - 'Mismatch between the number of TempDB files in sys.master_files versus tempdb.sys.database_files' falsely reported when run without sysadmin permission
If the current behavior is a bug, please provide the steps to reproduce.
Run sp_Blitz with user having securityadmin and VIEW SERVER STATE permissions -> Check is always reported
Running sp_Blitz with sysadmin -> Check is not reported, unless there is a real mismatch
What is the expected behavior?
The check is skipped when user cannot properly read sys.master_files table
Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
I'm sure this affects any SQL Server version, but I'm using following:
Microsoft SQL Server 2019 (RTM-CU25-GDR) (KB5036335) - 15.0.4360.2 (X64) Mar 19 2024 00:23:01 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 19045: )
############################################
Regarding your comment from my pull request: I couldn't find a situation where row count from sys.master_files < tempdb.sys.database_files and sys.master_files > 0. But granted I didn't look for long. I will try reworking the fix according to your suggestion.
Version of the script 8.21 - top Github commit
What is the current behavior? Check 191 - 'Mismatch between the number of TempDB files in sys.master_files versus tempdb.sys.database_files' falsely reported when run without sysadmin permission
If the current behavior is a bug, please provide the steps to reproduce. Run sp_Blitz with user having securityadmin and VIEW SERVER STATE permissions -> Check is always reported Running sp_Blitz with sysadmin -> Check is not reported, unless there is a real mismatch
What is the expected behavior? The check is skipped when user cannot properly read sys.master_files table
Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures? I'm sure this affects any SQL Server version, but I'm using following: Microsoft SQL Server 2019 (RTM-CU25-GDR) (KB5036335) - 15.0.4360.2 (X64) Mar 19 2024 00:23:01 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 19045: )
############################################
Regarding your comment from my pull request: I couldn't find a situation where row count from sys.master_files < tempdb.sys.database_files and sys.master_files > 0. But granted I didn't look for long. I will try reworking the fix according to your suggestion.