Issue:- Sometime issue comes like, when you try to access a database in AlwaysOn it gives error like "Unable to access availability database 'AdventureWorks2014' because the database replica is not in the PRIMARY or SECONDARY role. Connections to an availability database is permitted only when the database replica is in the PRIMARY or SECONDARY role. Try the operation again later. "
Error: 983
When you try to expand AlwaysOn High Availability Folder it will not expand..
TITLE: Microsoft SQL Server Management Studio
------------------------------
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Unable to access availability database 'AdventureWorks2014' because the database replica is not in the PRIMARY or SECONDARY role. Connections to an availability database is permitted only when the database replica is in the PRIMARY or SECONDARY role. Try the operation again later. (Microsoft SQL Server, Error: 983)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.4001&EvtSrc=MSSQLServer&EvtID=983&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Troubleshooting steps:- In order to troubleshoot this issue..
Go to
1. Cluster Administrator on same Node
2. Connect to the Cluster
3.Ensure you are connecting to correct clusterName
4. In my case Cluster core group resources was down as shown in below image.
5 Try to bring Cluster core group resource online.
6. if Cluster core resources start immediately its fine, proceed with step 7, otherwise check check clusterevent
below error may be appearing..
The cluster Resource Hosting Subsystem (RHS) process was terminated and will be restarted. This is typically associated with cluster health detection and recovery of a resource. Refer to the System event log to determine which resource and resource DLL is causing the issue.
Now we will check system event viewer for error like why it gave error like Failed to bring the resource 'Cluster Name' online.
when i checked system event viewer i got below error..
Error No : 10028
Description:
DCOM was unable to communicate with the computer Win2k12Cluster.Adven.com using any of the configured protocols; requested by PID ae4 (C:\Windows\system32\ServerManager.exe).
Restart Cluster service of all nodes.
in my case when i tried to restart cluster service i got below error..
when i see eventviewer.system i get below error message again..
DCOM was unable to communicate with the computer Win2k12Cluster.Adven.com using any of the configured protocols; requested by PID ae4 (C:\Windows\system32\ServerManager.exe).
Resolution:-
- Click Start, and then click Run.
- Type wf.msc, and then click OK. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
- In the console tree, click Inbound rules.
- In the list of firewall exception rules, look for COM+ Network Access (DCOM In).
- If the firewall exception rule is not enabled, in the details pane click Enable rule, and then scroll horizontally to confirm that the protocol is TCP and the LocalPort is 135.
- Close Windows Firewall with Advanced Security.
Then kill the clussvc.exe from task manager
I did repeat the same on another 2 nodes of cluster.
and then i was able to bring cluster core group resoources online and AlwaysOn Availability group online.
This is how i did resolve this issue. it looks Cluster service of one of node gone exhausted and even after restart it was not coming up, so the approach was just to restart 2nd node of Cluster service, it looks after successful restart of 2nd node Cluster service and later everything came up.
Thanks for Reading..