Adr*_*n S 7 sql-server availability-groups dbcc-checkdb sql-server-2016
我们有一个 AlwaysOn 环境,其中包括我们 DR 站点中的一个副本,该副本设置为异步提交和可读辅助 = 否。
当我们在 SQL Server 2014 SP2 上运行时,我们能够针对 DR 副本上的数据库运行 DBCC CHECKDB。但是自从升级到 SQL Server 2016 后,我们就无法升级,而且我们的每周完整性作业因错误而失败。
'The target database is participating in an availability group and is currently not accessible for queries.
Either data movement is suspended or the availability replica is not enabled for read access.
To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group. For more information,
see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.
Run Code Online (Sandbox Code Playgroud)
显然 2016 年发生了一些变化以防止这种情况发生,我只是不知道是什么?
我可以说您收到的错误消息是由于 SQL Server 2016 中的错误。Microsoft 知道并已在 SQL Server 2016 RTM 的 CU3 中修复它。
注意:报告了用户错误,但CHECKDB应按原样继续。
请参阅修复:在 SQL Server 2016 可用性组的不可读辅助副本上运行 DBCC CHECKDB 命令时发生错误 976
您可以拍摄数据库的快照并在其上运行 checkdb。在这种情况下它不会失败。数据库快照是企业功能我确定您没有使用基本可用性组
Adr*_*n S -2
Microsoft 已在 SQL 2016 CU3 中发布了针对此问题的修复程序 https://support.microsoft.com/en-us/kb/3194923