-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Page Verify - False Flag on <= 2005 TempDB #435
Comments
I've been working on much faster database tests which are not using SMO, this issue presents very interesting challenge for me, especially that I haven't seen a 2000 or even 2005 instance for quite a few years now. I will try to make the newer version work with older versions, but I will need some help testing. I don't suppose we have an VMs in VSTS hosting 2000 @SQLDBAWithABeard? ;) |
Definitely wish I didn't need to make this bug, sigh. I'm quite happy to be a guinea pig if you can get something working, though I know those versions are far from priorities. |
what a nice surprise, we still have |
I can be a guinea pig for 2005, not for 2000, but I don't see why it'd be that hard.
last but not least, I think @potatoqualitee has a 2000 around for quick testing |
I was able to turn it on despite compatibility level 80, as I was working through some old servers. Sort of surprised it worked. |
The Overall I think @potatoqualitee should decide whether we want to even try and support 2000 because I don't think we should for this module. We already require PowerShell 4.0, which dbatools goes back to 3.0. So considering this module is for newer "tech" I would draw the line somewhere and not have the same backward support we do with dbatools because this module does not serve the same purpose. The documentation itself for SQL Server 2000....is only available if you still have the installation media. Microsoft has already removed it from BOL and it was not ( and is not ) migrated to the new docs formatted site. |
Compatibility 80 is another beast to deal with as well because certain DMVs and system views will not work the same either. Most things will but we have bugs in dbatools functions (recall a few issues got submitted) because of this as well. |
I am happy to not support 2000 for everything. Some will work some won’t. That’s ok. |
I would like to give it a go if somebody can help me.
@lowlydba any chance you could complete that query so that it returns as much of this information as possible? compare it to the one i have here https://github.com/michalporeba/dbachecks/blob/316-assert-functions-2000/internal/functions/Get-DatabaseInfo.ps1 |
@michalporeba Got most of the data: select [d].[name] [Database]
,databasepropertyex([d].[name], 'Collation') [DatabaseCollation]
,suser_sname([d].[sid]) [Owner]
,databasepropertyex([d].[name], 'Recovery') [RecoveryModel]
,convert(bit, (databasepropertyex([d].[name], 'IsAutoClose'))) [AutoClose]
,convert(bit, (databasepropertyex([d].[name], 'IsAutoCreateStatistics'))) [AutoCreateStatistics]
,convert(bit, (databasepropertyex([d].[name], 'IsAutoShrink'))) [AutoShrink]
,convert(bit, (databasepropertyex([d].[name], 'IsAutoUpdateStatistics'))) [AutoUpdateStatistics]
,convert(bit, 0) [AutoUpdateStatisticsAsynchronously]
,case
when 16 = 16 & [d].[status] then 'TORN_PAGE_DETECTION'
else 'NONE'
end [PageVerify]
,convert(bit, 0) [SuspectPages]
,case
when 32 = 32 & [d].[status] then 'LOADING'
when 64 = 64 & [d].[status] then 'PRE_RECOVERY'
when 128 = 128 & [d].[status] then 'RECOVERING'
when 128 = 128 & [d].[status] then 'NOT_RECOVERED'
when 512 = 512 & [d].[status] then 'OFFLINE'
when 32768 = 32768 & [d].[status] then 'EMERGENCY'
when 1073741824 = 1073741824 & [d].[status] then 'CLEANLY_SHUT_DOWN'
else 'ONLINE'
end [Status]
,convert(bit, 0) [Trustworthy]
,[d].[cmptlevel] [CompatibilityLevel]
,databasepropertyex([d].[name], 'UserAccess') [UserAccess]
,convert(bit, case when 1024 = 1024 & [d].[status] then 1 else 0 end) [IsReadOnly]
,convert(bit, 0) [DataFilesWithoutBackup]
from sysdatabases d |
Thanks, that will be very useful, but implementing it (the way I want) depends now on ability to skip tests from inside the It block, so we can skip rather than fail tests which are not support in the specific version, and that we can unit test that behaviour. I've got a PR with pester already, I'm now waiting for it to hopefully get approved soon but it seems every body is on conferences these days ;) |
Any chance of this moving forward? The above-linked Pester issue was last commented-on in July. I run over 31,000 tests (in total) every day. This issue explains 3 of my 17 failures. I would like to get those 3 items out of the list of "I just need to ignore that one" that I keep in my head. I can test against 1 development and 2 production SQL 2005 instances, which will be up and running for another 6 to 12 months. |
Issue
The check does not skip over tempdb in 2005, where checksum is available overall but not able to be set on TempDB, and does not skip over 2000 where it is not available at all. For 2000, torn page detection should be the best practice option.
Note: Compatibility level does not affect this option, it is only dictated by the instance version
Bug Report
General Troubleshooting steps
Does
(Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()
Y
powershell -NoProfile
)The text was updated successfully, but these errors were encountered: