SQL Always on connectivity

xhope 221 Reputation points
2022-11-09T03:38:04.62+00:00

Dear experts, we have a SQL database configured in always on environment. Today morning, our database switch from A server to B server automatically and we found nothing in SQL log. I want to know how to check it.

Then, when databases are on B server and users are connected to it, after several seconds, users all get disconected and we found below error in the log "Unable to access availability db because the db replica is not in the PRIMARY or SECONDARY role"

I want to know why databases get switched automatically and why users get disconnected?

Azure SQL Database
SQL Server Other
{count} votes

Accepted answer
  1. PandaPan-MSFT 1,931 Reputation points
    2022-11-10T03:01:15.27+00:00

    Hi @xhope

    I want to know how to check it.

    I guess that your demand is to check the error log.
    258977-image.png

    I want to know why databases get switched automatically and why users get disconnected?

    If the databases switch, which means some error happens you need to check the error log and see what's going on.
    I suppose that the shared disk or node falling down .......... too many possibilties


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2022-11-09T04:42:52.593+00:00

    Please see the log at the Windows operating system level as explained here.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.