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_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

Closed
Tisit opened this issue Oct 8, 2024 · 1 comment
Assignees

Comments

@Tisit
Copy link
Contributor

Tisit commented Oct 8, 2024

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.

@BrentOzar
Copy link
Member

Thanks for the pull request! Looks good, merging into the dev branch, will be in the October release with credit to you in the release notes.

@BrentOzar BrentOzar added this to the 2024-10 Release milestone Oct 14, 2024
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