CHECKDB works on an Enterprise Edition readable secondary, but not CHECKCATALOG
3
votes
1
answer
115
views
I have an Enterprise Edition SQL Server 2022 cluster with multiple AGs.
Two of the AGs consider different instances primary. Both of these consider their secondaries readable and are correct to think this.
Aside from being in this readable secondary configuration, nothing makes any of the databases on any of the instances read-only. They are not Basic Availability Groups.
Here's the shocker: when I run
DBCC CHECKCATALOG
targeting a readable secondary database while connected to an instance that is not that database's primary, the query fails like this
> Msg 3906, Level 16, State 8, Line 1
>
> Failed to update database "DB NAME" because the database is read-only.
#### but DBCC CHECKDB
works just fine!
I've searched high and low, but I've found nothing helpful about this.
* [This issue on Ola Hallengren's Maintenance Solution's GitHub](https://github.com/olahallengren/sql-server-maintenance-solution/issues/403) is identical, but has no solution. Ola, who I trust to be an utter expert in this, seems to think it's a bug on his end rather than Microsoft's.
* [This git commit](https://github.com/rentadba/dbaTDPMon/commit/077a1de89570a469df14f834cac01f1e25a64b23) suggests that its author, dan-andreistefan, has seen this before. I found no corresponding issue or PR. [Dan emerged from the void and solved the problem](https://xkcd.com/979/) .
* Aside from the limitations on BAGs, I cannot find *anything at all* in the official SQL Server documentation about doing integrity checks on AGs. It's only in the licensing guide.
How can I debug this? Why would DBCC CHECKDB
, which is a superset of DBCC CHECKCATALOG
, work where DBCC CHECKCATALOG
fails?
Asked by J. Mini
(1237 rep)
Mar 28, 2025, 11:48 PM
Last activity: Mar 30, 2025, 07:59 PM
Last activity: Mar 30, 2025, 07:59 PM