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?

asked Oct 29, 2016 at 14:39

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

answered Oct 29, 2016 at 15:04
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. Commented 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

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.