Hi @Dipto Adhikary,
Welcome to the Microsoft Q&A platform!
According to your description,The status of the WitnessShareInUse
for dag01
changing to "None" and the files being missing from the witness share directory may indicate that there is an issue with the witness server configuration or that the witness server for dag01
is no longer being used.
Here are some steps you can follow to diagnose and potentially resolve this issue:
- Ensure that the witness server for
dag01
is correctly configured and reachable. You can do this by running the following command to check the current witness server settings:Get-DatabaseAvailabilityGroup dag01 | Format-List Name, WitnessServer, WitnessDirectory
- Ensure that the witness server and witness directory for
dag01
are accessible from all nodes of the DAG. Test connectivity and permissions to the witness share:
ReplaceTest-Path \\<WitnessServer>\WitnessDirectory
<WitnessServer>
andWitnessDirectory
with the actual server name and directory path. - Manually check the witness server to see if the
VerifyShareWriteAccess.txt
andWitness.log
files exist in the witness directory fordag01
. - If the witness share is not correctly created, you may need to reconfigure it. You can set a new witness server or the existing one again using:
Set-DatabaseAvailabilityGroup -Identity dag01 -WitnessServer <WitnessServer> -WitnessDirectory <WitnessDirectory>
- In some cases, restarting the DAG members can help to reset the state and reconfigure the witness server properly.
- Always ensure the overall health of the DAG is good. Use the following command to check the health status:
Test-ReplicationHealth -Identity dag01 Test-ReplicationHealth -Identity dag02
Notes:
- The
WitnessShareInUse
status being "Primary" indicates that the witness is being used as the primary witness server for the DAG. - Each DAG will have its own witness server and directory, so setting both to "Primary" isn't typically necessary or possible as it relates to their individual usage statuses.
Please feel free to contact me if you have any queries.
Best,
Jake Zhang