7

We have an AlwaysOn environment, which includes a replica in our DR site that is setup with async commit and readable secondary = No.

When we were running on SQL Server 2014 SP2 we were able to run DBCC CHECKDB against the databases on our DR replica. But since upgrading to SQL Server 2016 we're unable to and our weekly integrity job is failing with the error.

'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.

Obviously something has changed in 2016 to prevent this, I just don't know what?

2 Answers 2

6

I can say that the error message you are getting is because of a bug in SQL Server 2016. Microsoft knows about it and has fixed it in CU3 for SQL Server 2016 RTM.

Note: The user error is reported but the CHECKDB should continue as is.

See FIX: Error 976 occurs when you run the DBCC CHECKDB command on an unreadable secondary replica of SQL Server 2016 Availability Group

Workaround

You can take snapshot of the databases and can run checkdb on it. In this case it would not fail.Database snapshot is enterprise feature I am sure you are not using basic availability group

1
  • I am not sure if the CHECKDB does continue. It isn't reflected in DBCC DBINFO('<>') WITH TABLERESULTS the value for dbi_dbccLastKnownGood isn't updated.
    – Adrian S
    Oct 31, 2016 at 8:42
-2

Microsoft have released a fix for this in SQL 2016 CU3 https://support.microsoft.com/en-us/kb/3194923

1
  • 3
    I don't think you needed to add this as answer, Paul White already edited my answer and added the same
    – Shanky
    Nov 18, 2016 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.