Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I need some assistance and some bandages for shooting myself in the foot. This is a DEV environment but I need to bring it up.

I am using SQL Server 2012 Enterprise on Windows 2008 R2. Somehow our AG listener group disappeared. I tried to recreated AG listener and it was giving error regarding computer account not having permissions. The genius inside of me decided to delete AG group from Windows Cluster Admin and now I cannot recreate AG group (I should've done it via SQL Server instead of Windows).

I keep on getting the following error :

Creating availability group resulted in an error. (Microsoft.SqlServer.Management.HadrTasks)

ADDITIONAL INFORMATION:

Create failed for Availability Group 'SQLAG_D'. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

The availability group 'SQLAG_D' already exists. This error could be caused by a previous failed CREATE AVAILABILITY GROUP or DROP AVAILABILITY GROUP operation. If the availability group name you specified is correct, try dropping the availability group and then retry CREATE AVAILABILITY GROUP operation.

Failed to create availability group 'SQLAG_D'. The operation encountered SQL Server error 41042 and has been rolled back. Check the SQL Server error log for more details. When the cause of the error has been resolved, retry CREATE AVAILABILITY GROUP command. (Microsoft SQL Server, Error: 41042)

Does anyone have any suggestions?

share|improve this question
    
Have you tried what the error message says, by attempting to drop the AG? –  Thomas Stringer Aug 20 '13 at 19:22
    
@ThomasStringer The AG Group is already dropped in windows cluster and it is not showing in SQL Availability Group –  Rizwan Aug 20 '13 at 19:23
2  
Does the sys.availability_groups system catalog view have your "deleted" AG in it? –  Thomas Stringer Aug 20 '13 at 19:25
    
@ThomasStringer yes, there is no mention of SQLAG_D in it –  Rizwan Aug 20 '13 at 19:26

2 Answers 2

up vote 3 down vote accepted

You have to do following :

  1. Drop the availability group then
  2. using regedit, (first backup the registry of old availability group that starts with HKEY_LOCAL_MACHINE\Cluster\HadrAgNameToldMap) and then delete that key and
  3. Finally create a new Availability Group with new name.

Note: Extra Caution .. as you are dealing with Windows Registry, Back it up first

share|improve this answer
    
Thank you... it worked –  Rizwan Aug 20 '13 at 20:17

The AD object for the listener is still there--deleting it from the cluster doesn't delete it from AD. If you have a Domain Admin reset the account, you should be able to recreate the availability group.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.