SQL Server error 976

Error ID: SQL Server error 976

Error Message:

“The target database, ‘%.*ls’, 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.”

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?

Looking for a second opinion on a SQL Server error code? Get in touch with
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

    Success Stories
    Testimonials

    IT Infrastructure Engineer – Welcome Finance

    “A recent project required the redaction of a large volume of data against a strict deadline. Xynomix were able to take a copy of the data and carry out the work all whilst maintaining the meaning of the data for review by other parties, within the deadline. The technical expertise and swift proactive support of the Xynomix team has ensured that even during a challenging period for Welcome Finance, we are able to ensure that our data and database performance is consistent which, in turn enables us to focus on additional projects.”

    Read More »
    Application Manager - Banham Group
    Testimonials

    Application Manager – Banham Group

    “The Oracle database supports a key ERP application which holds information on our customers, invoicing and fulfilment and is therefore essential to the successful day to day running of our business. For over 6 years, Xynomix has provided us with outstanding database support and expertise. We work with a number of Xynomix senior Oracle DBA’s who know our systems inside and out.”

    Read More »