olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

SQL Server 2022 Contained AG - Error Running Database Integrity Check #756

Closed SQLDBAWithoutABeard closed 1 year ago

SQLDBAWithoutABeard commented 1 year ago

Description of the issue I am trying to run a Database Integrity Check against a SQL Server 2022 Enterprise server that has Contained Always On Availabity Groups (AGs), and the integrity check fails while checking the auto generated {AG}_Master database, All other DBs complete successfully. The error is: Msg 8906, Level 16, State 1, Line 1 Page (1:10) in database ID 16375 is allocated in the SGAM (1:3) and PFS (1:1), but was not allocated in any IAM. PFS flags 'MIXED_EXT ALLOCATED 0_PCT_FULL'.

If I connect to the AG Listener, the {AG}_Master DB and the other DBs within the AG scan successfully.

SQL Server version and edition Microsoft SQL Server 2022 (RTM-CU3) (KB5024396) - 16.0.4025.1 (X64) Mar 13 2023 19:10:08 Copyright (C) 2022 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: ) (Hypervisor)

Version of the script Version: 2022-12-03 17:23:44

What command are you executing? EXECUTE [dbo].[DatabaseIntegrityCheck] @Databases = 'USER_DATABASES', @LogToTable = 'Y'

Which executes: DBCC CHECKDB ([TEST_AG_master]) WITH NO_INFOMSGS, ALL_ERRORMSGS

What output are you getting? Msg 8906, Level 16, State 1, Line 1 Page (1:10) in database ID 16375 is allocated in the SGAM (1:3) and PFS (1:1), but was not allocated in any IAM. PFS flags 'MIXED_EXT ALLOCATED 0_PCT_FULL'.