Error ID: SQL Server error 976
Error Message:
Cause:
Primarily this error occurs when something tries to run against a database in an Availability Group when the instance is acting as the secondary and therefore the databases are read only. For example, SQL Agent jobs may be configured on both the primary and secondary instances to run integrity checks against the databases (known as DBCC CHECKDB). They would succeed on the primary as they are read/write databases, but would fail on the secondary as they are read only. It is possible to configure both instances as read/write, but this requires additional licensing from Microsoft. The error can also occur for other reasons, such as a disconnected replica, suspended data movement or a temporary network issue.
Solutions:
If the error has occurred because of a SQL Agent job trying to run against a database on a secondary instance that is read only, the solution is to amend the job so that it only runs if the instance is the primary. There is no check box to tick unfortunately, it needs a step adding at the beginning of the job to determine whether it is running on the primary or the secondary and then only move onto the next step if it is the primary. If the error has occurred due to another reason, further investigation is required to identify the specific cause (e.g. a network issue).
Need Additional Assistance?
Xynomix and we'll assess your issue and help to action a fix.
Contact Us
On submitting this form, Xynomix will store your details and may contact you in relation to your request. For more information on how we process data, please see our privacy notice.
Testimonials

IT Manager – Trade Union
“Since 2003 Xynomix have provided support and consultancy for our Oracle and SQL Server databases. We’ve found their knowledge to be extensive and they’ve ensured that our databases run smoothly with very little downtime. The flexibility and creativity that Xynomix show when working with us enables us to meet budgets and hit our project timescales.”

Enterprise Architect – North Yorkshire County Council
“Xynomix worked with us on our recent Oracle License Review and provided us with valuable independent and confidential advice to help us through what can be a confusing and complex process. They provided useful expert knowledge on Oracle Licensing policy and also suggested how any gaps could be most effectively licensed. I would certainly recommend working with Xynomix on any future Oracle License Review.”

Data Systems Manager – Media Industry
“Xynomix investigated the performance bottlenecks that we were experiencing after updating our data warehouse application. After investigating the system, Xynomix concluded that the database server’s cache-hit rates and available memory were both low, which was impacting negatively on performance. The technician rectified this and we are now very happy with the function of the application.”